text:
Do the circles overlap?
Given the coordinates of the centres and the radii of 2 circles, output a truthy value of whether they do or do not overlap.
Input

Input may be taken via STDIN or equivalent, function arguments, but not as a variable. You can take them as a single variable (list, string etc) or as multiple inputs / arguments, in whatever order you want.

The input will be six floats. These floats will be up to 3 decimal places. The coordinates can be positive or negative. The radii will be positive.

Output

Output can be via STDOUT or function return.

The program must have exactly 2 distinct outputs - one for a True value (the circles do overlap) and one for a False output (they don't overlap).

Test cases
(Input is given as list of tuples [(x1, y1, r1), (x2, y2, r2)] for the test cases; you can take input in any format)
True
[(5.86, 3.92, 1.670), (11.8, 2.98, 4.571)]
[(8.26, -2.72, 2.488), (4.59, -2.97, 1.345)]
[(9.32, -7.77, 2.8), (6.21, -8.51, 0.4)]

False
[(4.59, -2.97, 1.345), (11.8, 2.98, 4.571)]
[(9.32, -7.77, 2.8), (4.59, -2.97, 1.345)]
[(5.86, 3.92, 1.670), (6.21, -8.51, 0.4)]

This is Code Golf, shortest answer in bytes wins.

we usually are a bit more relaxed on the I/O...could I take (x1,y1),(x2,y2),(r1,r2)?

@Giuseppe sorry that was just how I presented them for the test cases. You can take them however you like. (You can take them as a single variable (list, string etc) or as multiple inputs / arguments.)

What do we need to return if two circles are touching externally?

@JungHwanMin I've been thinking about that. The idea of circles touching but not overlapping gives me a headache - I'm not sure it's a real thing. I think that touching circles are technically overlapping, but that might invalidate some answers, so you can return either True or False, as long as it is consistent for your program.

The technical term for "touching but not overlapping" is "tangent" and it is a thing in geometry if nowhere else.

Taking floats seems like a pretty stringent requirement. Could you relax it to a more general representation?  I would like to solve this in Brain-Flak, but I am unlikely to take the time to implement IEEE floats, and if I did it would be 90% of the byte count anyway so I would just be golfing a float implementation.

I would also like to point out that floats are not accurate up to "three decimal places" in a lot of cases.  I'm not sure exactly what you want answers to handle, but its a little confusing right now.

Related.

Is it really necessary to have float inputs? If the inputs were restricted to integers, a lot more languages could participate, and there wouldn't be issues w.r.t. floating-point imprecision, which would greatly improve this challenge.

With hindsight the floats requirement was stringent (there was a reason for it - I had to solve this problem myself with floats and wasn’t thinking carefully enough). I’m not changing it now because I’ve got 19 answers, and some could be affected (maybe they could be shorter if they didn’t handle floats). I’m not sure how it’s confusing - they handle numbers which have any number of digits and optionally a decimal point followed by up to 3 digits.

I think you might have a fundamental misunderstanding of how floats work. Because they are fixed-size, as the values get larger, the precision gets lower. There is a point beyond which a float cannot accurately represent all values within 3 decimal places. Also, editing a challenge to remove an unnecessary restriction is not discouraged.

@Mego you can assume the number is small enough that it is accurate to 3dp

Specifying 'up to four decimal digits precision' would (a) encompass all the test cases shown and (b) ensure that IEEE 32-bit floats could convincingly represent such numbers over a wide range of magnitudes.

Is [x1, x2, y1, y2, r1, r2] acceptable input?

@Alexander yes it is

Jelly, 5 bytes
IA<S}

Takes two complex numbers (centers) as first argument, and two real numbers (radii) as second argument.
Try it online!
How it works
IA<S}  Main link.
       Left argument:  [x1 + iy1, x2 + iy2]
       Right argument: [r1, r2]

I      Increments; yield (x2 - x1) + i(y2 - y1).
 A     Absolute value; yield √((x2 - x1)² + (y2 - y1)²).
   S}  Take the sum of the right argument, yielding r1 + r2.
  <    Compare the results.

Damn, I forgot about using complex numbers for coordinates. Good one! :D

Out of interest would the result of A here be considered the norm of the row vector "centers"? (ÆḊ itself errors with complex content.)

@JonathanAllan Yes, A computes the distances of the centers as the norm of their difference vector.

JavaScript (ES6), 38 bytes
Takes input as 6 distinct variables x1, y1, r1, x2, y2, r2.
(x,y,r,X,Y,R)=>Math.hypot(x-X,y-Y)<r+R

Test cases

let f =

(x,y,r,X,Y,R)=>Math.hypot(x-X,y-Y)<r+R

// True
console.log(f(5.86, 3.92, 1.670, 11.8, 2.98, 4.571))
console.log(f(8.26, -2.72, 2.488, 4.59, -2.97, 1.345))
console.log(f(9.32, -7.77, 2.8, 6.21, -8.51, 0.4))

// False
console.log(f(4.59, -2.97, 1.345, 11.8, 2.98, 4.571))
console.log(f(9.32, -7.77, 2.8, 4.59, -2.97, 1.345))
console.log(f(5.86, 3.92, 1.670, 6.21, -8.51, 0.4))

For anyone who hasn't seem Math.hypot before.

scala polyglot :) but it does not work for some reason

@V.Courtois The way you pass the parameters doesn't match the method declaration. It should be a:Double,x:Double,b:Double,y:Double,r:Double,q:Double.

@Arnauld ooh~ thanks! Should I post it separately?

@V.Courtois Sure. Go for it!

@Pureferret this whole time I've been typing this out explicitly in code, that's great!

Pyth, 5 bytes
gsE.a

Input format:
[x1, y1], [x2, y2]
r1, r2

Try it online
How it works
     Q   autoinitialized to eval(input())
   .a    L2 norm of vector difference of Q[0] and Q[1]
gsE      sum(eval(input()) >= that

MATL, 5 bytes
ZPis<

Input format is:
[x1, y1]
[x2, y2]
[r1, r2]

Try it online! Or verify all test cases.
How it works
ZP   % Take two vectors as input. Push their Euclidean distance
i    % Input the vector of radii
s    % Sum of vector
<    % Less than?

Not sure if it is me, but when I use your trial link and press run I get 'Error The server's response could not be decoded' -- Also Not sure if it helps, but did you think about (ab) using complex numbers like in the Jelly answer?

@DennisJaheruddin Hey, nice to see you again here! (1) Blame caching, probably. Did you try a hard refresh? (2) I did, but I think it's also 5 bytes (-| instead of ZP)

I suppose it is the firewall. Now i'm wondering whether  an input format with something like -r2 instead of r2 would help because then you would need three differences, instead of 2 differences and an addition... I'd better run before I get drawn in too deep!

I don't think that negating one input is acceptable as input format. If you find any problems with the Try It Online service, would you please report here?

R, 39 bytes
function(k,r)dist(matrix(k,2,2))<sum(r)

takes input k=c(x1,x2,y1,y2) and r=c(r1,r2); returns FALSE for tangent circles.
Try it online!
27 bytes:
function(m,r)dist(m)<sum(r)

Takes input as a matrix with the circle centers given as rows and a vector of radii.
Try it online!

-2 bytes function(k,r)dist(matrix(k,2))<sum(r)

What about dist(matrix(scan(),2))<sum(scan())?

Python, 40 bytes
lambda x,y,r,X,Y,R:abs(x-X+(y-Y)*1j)<r+R

Try it online!
Uses Python's complex arithmetic to compute the distance between the two centers. I'm assuming we can't take the input points directly as complex numbers, so the code expresses them like x+y*1j.

Python 3, 45 bytes
lambda a,b,c,d,e,f:(a-d)**2+(b-e)**2<(c+f)**2

Try it online!
-8 bytes thanks to Neil/Step Hen

This code works in python 2 also.

@micsthepick Cool, thanks. It's just the way TIO does formatting.

Python 3, 45 bytes
lambda X,Y,R,x,y,r:(X-x)**2+(Y-y)**2<(R+r)**2

Try it online!

05AB1E, 6 bytes
αs--0›

Try it online!
-1 byte by using a - b > 0 rather than (reverse) b - a < 0

Oh 05AB1E does imaginary now?

@MagicOctopusUrn Apparently /shrug

APL (Dyalog), 10 bytes
Prompts for circle centers as list of two complex numbers, then for radii as list of two numbers
(+/⎕)>|-/⎕

Try it online!
(+/⎕) [is] the sum of the radii
> greater than
| the magnitude of
-/⎕ the difference in centers

Jelly, 12 bytes
I²+⁴I²¤<⁵S²¤

Try it online!
-2 bytes thanks to Dennis

Wouldn't creating a new link with ạ/² on it same bytes?

@cairdcoinheringaahing ?

Never mind, I got 14 bytes by doing this

You can use I instead of reducing by absolute difference.

@Dennis Ooh thanks

Haskell, 37 36 bytes
(u#v)r x y s=(u-x)^2+(v-y)^2<(r+s)^2

Try it online!
Thanks @AndersKaseorg for -1 byte!

Shorter as an operator: (u!v)r x y s.

Mathematica, 16 bytes
Norm[#-#2]<+##3&

Input: [{x1, y1}, {x2, y2}, r1, r2]

Mathematica has a RegionIntersection builtin, but that alone is 18 bytes long...
Built-in version:
RegionIntersection@##==EmptyRegion@2&

Takes 2 Disk objects. [Disk[{x1, y1}, r1], Disk[{x2, y2}, r2]].

Java (OpenJDK 8), 38 bytes
(a,b,c,x,y,z)->Math.hypot(a-x,b-y)<c+z

Try it online!

Java 8, 41 38 bytes
(x,y,r,X,Y,R)->Math.hypot(x-X,y-Y)<r+R

Try it here.
Apparently, Java also has Math.hypot, which is 3 bytes shorter.
EDIT: Just realized this answer is now exactly the same as @OlivierGrégoire's Java 8 answer, so please upvote him instead of me if you like the 38-byte answer.
Old answer (41 bytes):
(x,y,r,X,Y,R)->(x-=X)*x+(y-=Y)*y<(r+=R)*r

Try it here.

Oh! So that's why I got 3 upvotes today, but 0 when the challenge was posted? ^^ I was wondering what triggered this weird behavior ;) Since I like my answer, and you posted the same, you get a +1 as well! :p

Pyth, 15 bytes
<sm^-EE2 2^+EE2

Takes input in the order x1,x2,y1,y2,r1,r2
Test suite!

Perl 6, 13 bytes
*+*>(*-*).abs

Try it online!
The first two arguments are the radii, in either order.  The third and fourth arguments are the coordinates of the centers, as complex numbers, in either order.

C#, 50 41 bytes
(x,y,r,X,Y,R)=>(x-=X)*x+(y-=Y)*y<(r+=R)*r

Saved 9 bytes thanks to @KevinCruijssen.

Can't you save a few bytes there by writing (r+R)*2 instead of (r+R)+(r+R)?

@IanH. Yeah don't know how I missed that.

Am I missing something or does this not work?

@IanH. I'd made a typo, the + on the RHS should have been a *.

And my feedback even made that worse. Good job on the solution though!

You can golf it to 41 bytes like this: (x,y,r,X,Y,R)=>(x-=X)*x+(y-=Y)*y<(r+=R)*r. I just posted the Java 8 equivalent myself.

@KevinCruijssen Nice idea!

Taxi, 1582 bytes
Go to Post Office:w 1 l 1 r 1 l.Pickup a passenger going to The Babelfishery.Pickup a passenger going to Tom's Trims.Pickup a passenger going to Tom's Trims.Go to Tom's Trims:n.[a]Go to Post Office:s.Pickup a passenger going to The Babelfishery.Go to The Babelfishery:s 1 l 1 r.Pickup a passenger going to What's The Difference.Pickup a passenger going to What's The Difference.Go to What's The Difference:n 5 l.Pickup a passenger going to Cyclone.Go to Cyclone:e 1 r.Pickup a passenger going to Multiplication Station.Pickup a passenger going to Multiplication Station.Go to Multiplication Station:s 1 l 2 r 4 l.Pickup a passenger going to Addition Alley.Go to Tom's Trims:s 1 r 3 r.Pickup a passenger going to The Babelfishery.Switch to plan "b" if no one is waiting.Switch to plan "a".[b]Go to Addition Alley:n 1 r 1 l 3 l 1 l.Pickup a passenger going to Magic Eight.Go to Post Office:n 1 r 1 r 3 r 1 l.Pickup a passenger going to The Babelfishery.Go to The Babelfishery:s 1 l 1 r.Pickup a passenger going to Addition Alley.Pickup a passenger going to Addition Alley.Go to Addition Alley:n 5 l 1 l.Pickup a passenger going to Cyclone.Go to Cyclone:n 1 l 1 l.Pickup a passenger going to Multiplication Station.Pickup a passenger going to Multiplication Station.Go to Multiplication Station:s 1 l 2 r 4 l.Pickup a passenger going to Magic Eight.Go to Magic Eight:s 1 r.Switch to plan "c" if no one is waiting.'1' is waiting at Writer's Depot.[c]'0' is waiting at Writer's Depot.Go to Writer's Depot:w 1 l 2 l.Pickup a passenger going to Post Office.Go to Post Office:n 1 r 2 r 1 l.

Try it online!
Outputs 1 for overlapping circles.
Outputs 0 for non-overlapping circles (including tangential circles).
Ungolfed / formatted:
Go to Post Office: west 1st left 1st right 1st left.
Pickup a passenger going to The Babelfishery.
Pickup a passenger going to Tom's Trims.
Pickup a passenger going to Tom's Trims.
Go to Tom's Trims: north.
[a]
Go to Post Office: south.
Pickup a passenger going to The Babelfishery.
Go to The Babelfishery: south 1st left 1st right.
Pickup a passenger going to What's The Difference.
Pickup a passenger going to What's The Difference.
Go to What's The Difference: north 5th left.
Pickup a passenger going to Cyclone.
Go to Cyclone: east 1st right.
Pickup a passenger going to Multiplication Station.
Pickup a passenger going to Multiplication Station.
Go to Multiplication Station: south 1st left 2nd right 4th left.
Pickup a passenger going to Addition Alley.
Go to Tom's Trims: south 1st right 3rd right.
Pickup a passenger going to The Babelfishery.
Switch to plan "b" if no one is waiting.
Switch to plan "a".
[b]
Go to Addition Alley: north 1st right 1st left 3rd left 1st left.
Pickup a passenger going to Magic Eight.
Go to Post Office: north 1st right 1st right 3rd right 1st left.
Pickup a passenger going to The Babelfishery.
Go to The Babelfishery: south 1st left 1st right.
Pickup a passenger going to Addition Alley.
Pickup a passenger going to Addition Alley.
Go to Addition Alley: north 5th left 1st left.
Pickup a passenger going to Cyclone.
Go to Cyclone: north 1st left 1st left.
Pickup a passenger going to Multiplication Station.
Pickup a passenger going to Multiplication Station.
Go to Multiplication Station: south 1st left 2nd right 4th left.
Pickup a passenger going to Magic Eight.
Go to Magic Eight: south 1st right.
Switch to plan "c" if no one is waiting.
'1' is waiting at Writer's Depot.
[c]
'0' is waiting at Writer's Depot.
Go to Writer's Depot: west 1st left 2nd left.
Pickup a passenger going to Post Office.
Go to Post Office: north 1st right 2nd right 1st left.

x86 Machine Code (with SSE2), 36 bytes
; bool CirclesOverlap(double x1, double y1, double r1,
;                     double x2, double y2, double r2);
F2 0F 5C C3        subsd   xmm0, xmm3      ; x1 - x2
F2 0F 5C CC        subsd   xmm1, xmm4      ; y1 - y2
F2 0F 58 D5        addsd   xmm2, xmm5      ; r1 + r2
F2 0F 59 C0        mulsd   xmm0, xmm0      ; (x1 - x2)^2
F2 0F 59 C9        mulsd   xmm1, xmm1      ; (y1 - y2)^2
F2 0F 59 D2        mulsd   xmm2, xmm2      ; (r1 + r2)^2
F2 0F 58 C1        addsd   xmm0, xmm1      ; (x1 - x2)^2 + (y1 - y2)^2
66 0F 2F D0        comisd  xmm2, xmm0
0F 97 C0           seta    al              ; ((r1 + r2)^2) > ((x1 - x2)^2 + (y1 - y2)^2)
C3                 ret

The above function accepts descriptions of two circles (x- and y-coordinates of center point and a radius), and returns a Boolean value indicating whether or not they intersect.
It uses a vector calling convention, where the parameters are passed in SIMD registers. On x86-32 and 64-bit Windows, this is the __vectorcall calling convention. On 64-bit Unix/Linux/Gnu, this is the standard System V AMD64 calling convention.
The return value is left in the low byte of EAX, as is standard with all x86 calling conventions.
This code works equally well on 32-bit and 64-bit x86 processors, as long as they support the SSE2 instruction set (which would be Intel Pentium 4 and later, or AMD Athlon 64 and later).
AVX version, still 36 bytes
If you were targeting AVX, you would probably want to add a VEX prefix to the instructions. This does not change the byte count; just the actual bytes used to encode the instructions:
; bool CirclesOverlap(double x1, double y1, double r1,
;                     double x2, double y2, double r2);
C5 FB 5C C3      vsubsd   xmm0, xmm0, xmm3   ; x1 - x2
C5 F3 5C CC      vsubsd   xmm1, xmm1, xmm4   ; y1 - y2
C5 EB 58 D5      vaddsd   xmm2, xmm2, xmm5   ; r1 + r2
C5 FB 59 C0      vmulsd   xmm0, xmm0, xmm0   ; (x1 - x2)^2
C5 F3 59 C9      vmulsd   xmm1, xmm1, xmm1   ; (y1 - y2)^2
C5 EB 59 D2      vmulsd   xmm2, xmm2, xmm2   ; (r1 + r2)^2
C5 FB 58 C1      vaddsd   xmm0, xmm0, xmm1   ; (x1 - x2)^2 + (y1 - y2)^2
C5 F9 2F D0      vcomisd  xmm2, xmm0
0F 97 C0         seta     al                 ; ((r1 + r2)^2) > ((x1 - x2)^2 + (y1 - y2)^2)
C3               ret

AVX instructions have the advantage of taking three operands, allowing you to do non-destructive operations, but that doesn't really help us to compact the code any here. However, mixing instructions with and without VEX prefixes can result in sub-optimal code, so you generally want to stick with all AVX instructions if you're targeting AVX, and in this case, it doesn't even hurt your byte count.

Java, 50 38 bytes
(x,y,r,X,Y,R)->Math.hypot(x-X,y-Y)<r+R

Using ideas in other answers, this can be shortened to 38 like so: (x,y,r,X,Y,R)->Math.hypot(x-X,y-Y)<r+R. In fact, just realised this is the exact same as Arnauld's JavaScript answer.

Thanks... This answer was nevee intended to be golfed... i thought it was such a simple challenge there wouldn't be anything that can be golfed...

I'm afraid your answer is now exactly the same as the already posted answer by @OlivierGrégoire..

Scala, 23 bytes
Thanks @Arnauld for his almost polyglot answer.
math.hypot(a-x,b-y)<r+q

Try it online!

PostgreSQL, 41 characters
prepare f(circle,circle)as select $1&&$2;

Prepared statement, takes input as 2 parameters in any circle notation.
Sample run:
Tuples only is on.
Output format is unaligned.
psql (9.6.3, server 9.4.8)
Type "help" for help.

psql=# prepare f(circle,circle)as select $1&&$2;
PREPARE

psql=# execute f('5.86, 3.92, 1.670', '11.8, 2.98, 4.571');
t

psql=# execute f('8.26, -2.72, 2.488', '4.59, -2.97, 1.345');
t

psql=# execute f('9.32, -7.77, 2.8', '6.21, -8.51, 0.4');
t

psql=# execute f('4.59, -2.97, 1.345', '11.8, 2.98, 4.571');
f

psql=# execute f('9.32, -7.77, 2.8', '4.59, -2.97, 1.345');
f

psql=# execute f('5.86, 3.92, 1.670', '6.21, -8.51, 0.4');
f

05AB1E, 10 bytes
-¨nOt²¹+θ‹

Try it online!

PHP, 66 bytes
<?php $i=$argv;echo hypot($i[1]-$i[4],$i[2]-$i[5])<$i[3]+$i[6]?:0;

Try it online!
Runs from the command line, taking input as 6 command-line parameter arguments, and prints 1 if the circles overlap, else 0.

dc, 22 bytes
9k?+_5R-d*_3R-d*+v-vzp

Try it online!
Or try the test suite!
Input is read from stdin in the format x1 x2 y1 y2 r1 r2.  Note that negative numbers are written in dc with an underscore _ instead of a minus sign -.
Output is on stdout: 1 for truthy, 0 for falsey.  If the two circles are tangent to one another or if they're identical, they're considered to be overlapping.

This requires a recent version of GNU dc which supports the R operation (rotate).
On versions of dc which don't support R, you can instead use
9k?-d*sY-d*lY+vsD+lD-vzp
(24 bytes long), with input presented on stdin in the order r1 r2 x1 x2 y1 y2.  Here's a test suite for the 24-byte program, for older versions of dc

Explanation
9k   Set precision to 9 decimal places.
?    Read the input and push all 6 numbers on the stack (r2 is at the top of the stack since it's entered last).
+    Add r1 and r2
_5R  Rotate the stack so that r1+r2 is now at the bottom.
-d*  Compute (y1-y2)^2.
_3R  Rotate the stack so that it's now: r1+r2 (y1-y2)^2 x1 x2 (top on the right)
-d*  Compute (x1-x2)^2.
+    Compute (x1-x2)^2 + (y1-y2)^2.
v    Take the square root to compute the distance between the centers.
-    Subtract the distance between the centers from r1-r2.
v    Pop one number from the stack. If it's non-negative, then compute its square root and push that back on the stack.
z    Push the size of the stack onto the stack. (This is 0 if the difference was negative, and it's 1 if the difference was positive.)
p    Print the item at the top of the stack.

R (+pryr), 31 bytes
pryr::f(sum((x-y)^2)^.5<sum(r))

Which evaluates to the function
function (x, y, z)
sum((x - y)^2)^0.5 < sum(z)

Where x are the coordinates of circle 1, y are the coordinates of circle 2 and z the radii.
Calculates the distance between the two centers using Pythagoras and tests if that distance is smaller than the sum of the radii.
Makes use of R's vectorisation to simultaneously calculate (x1-x2)^2 and (y1-y2)^2. These are then summed and squarely rooted.

Go, 93 bytes
package q
import c "math/cmplx"
func o(a,b complex128,r,R float64)bool{return c.Abs(b-a)<r+R}

Fairly simple algorithm, same as several other answers, except it uses the built-in complex type and calls math/cmplx.Abs().
Taking the radii as complex numbers doesn't help, because the cast to float64 adds more bytes than the variable declaration saves (can't do float64 < complex128).
Try it online! Includes the test cases, and uses package main instead of a library.

Javascript, 38 chars
(x,y,r,X,Y,R)=>Math.hypot(X-x,Y-y)<R+r

Test:

f=(x,y,r,X,Y,R)=>Math.hypot(X-x,Y-y)<R+r

console.log(
  f(5.86, 3.92, 1.670, 11.8, 2.98, 4.571),
  f(8.26, -2.72, 2.488, 4.59, -2.97, 1.345),
  f(9.32, -7.77, 2.8, 6.21, -8.51, 0.4)
);

console.log(
  f(4.59, -2.97, 1.345, 11.8, 2.98, 4.571),
  f(9.32, -7.77, 2.8, 4.59, -2.97, 1.345),
  f(5.86, 3.92, 1.670, 6.21, -8.51, 0.4)
);

QBIC, 30 bytes
?abs(:-:)^2+abs(:-:)^2<(:+:)^2

Basically does a²+b²=c². Takes parameters in the order of x1, x2, y1, y2, r1, r2.
                 The code builds a triangle y doing a²+b²=c²
?abs(:-:)^2      Takes the size of our triangle along the x-axis
+abs(:-:)^2      Takes the size of our triangle along the y-axis
 (:+:)^2         Takes the length of both radii
<                And compares them. The circles overlap (-1) if their combined
                 radii is bigger than the c-side of the triangle

Julia 0.6.0 (46 bytes)
a->((a[1]-a[2])^2+(a[3]-a[4])^2<(a[5]+a[6])^2)

Clojure, 68 bytes
#(<(+(*(- %4 %)(- %4 %))(*(- %5 %2)(- %5 %2)))(*(+ %6 %3)(+ %6 %3)))

Takes six arguments: x1, y1, r1, x2, y2, r2. Returns true or false.
Sadly, Clojure does not have a pow function of some sorts. Costs a lot of bytes.

Actually, 8 bytes
-)-(h@+>

Try it online!
Explanation:
-)-(h@+>  (implicit input: [y1, y2, x1, x2, r1, r2])
-         y2-y1 ([y2-y1, x1, x2, r1, r2])
 )-       move to bottom, x1-x2 ([x1-x2, r1, r2, y2-y1])
   (h     move from bottom, Euclidean norm ([sqrt((y2-y1)**2+(x2-x1)**2), r1, r2])
     @+   r1+r2 ([r1+r2, norm])
       >  is r1+r2 greater than norm?

Swift, 47 Bytes
($0-$3)*($0-$3)+($1-$4)*($1-$4)<($2+$5)*($2+$5)

$0, $1, ... are implicit closure parameters. To use, assign to a variable with a type annotation:
let f: (
    _ x1: Double, // $0 ----+
    _ y1: Double, // $1 ----|----+
    _ r1: Double, // $2 ----|----|----+
    _ x2: Double, // $3 ----+    |    |
    _ y2: Double, // $4 ---------+    |
    _ r2: Double  // $5 --------------+
    ) -> Bool = {
     ($0-$3)*($0-$3)+($1-$4)*($1-$4)<($2+$5)*($2+$5)
}

Perl 5, 54 bytes
$_=$F[2]+$F[5]>sqrt(($F[0]-$F[3])**2+($F[1]-$F[4])**2)

Try it online!
Input format:
x1 y1 r1 x2 y2 r2


text:
Four In A Row: AI Tournament
Four-In-A-Row AI Tournament
Today, we will be playing a Four-In-A-Row tournament. However, it is not us humans playing... instead, we must have our computers battle instead! This challenge is completely in C#.
Rules
Basic Game Rules
If you have never played, there are simple rules. 2 players take turns putting pieces into a 6x7 grid. The player chooses one of the 7 holes at the top of the grid, and puts a piece in. Gravity pulls the piece down, until it hits another piece underneath it.
The game is won when a player gets four of their pieces in a straight line, either vertical or horizontal. Diagonal lines do not count in this challenge, as I was lazy when programming my simulator. This will also make it easier for you to code your AIs.
Code Format
You will write code that goes into a function that gets called when it is your turn. You can receive an argument, states[,] board where states is an enum with defender, attacker, empty. This represents the occupation of a space. Your method must return an int.
Game Ending
The game ends when someone gets a four-in-a-row, or makes an illegal move. An illegal move is when your program returns an int that is 1) off the board (< 0 or > 6) or in a column that is completely filled. In the case of an illegal move, the opponent immediately wins.
Additionally, if your program exits the function or the program, you automatically lose the match. If your program causes a runtime error, you lose the match. You are allowed to try to make the other program cause a runtime error.
Variables
You are not allowed to access any variables, properties, or run any methods outside of your function's scope. You are not allowed to define any variables outside of your function's scope.
One exception is the Dictionary<string, object> names variables I have provided for your convenience. It is in the class Programs, so it will keep it's data for the whole match. However, the opponent uses the same dictionary to save its data. One strategy is to sabotage the enemy program by modifying the data it uses.
Closing the Loopholes
Your submission may not make any external requests, for example to an online API. Your submission may not include a library that is made to solve four-in-a-row games. As a rule of thumb, your program shouldn't need to use anything except system or anything included in the system library.
You may not exploit any loopholes, either stated or implied in the rules, unless you have asked me through comments and I agreed.
Tournament Format
This is a king-of-the-hill tournament, so the AI will be competing against each other. I will post the first answer. The next person will have to beat my program. To beat a program, you must never lose to it. You are only required to beat the program right before you. This process goes on until an answer has not been superseded after one week.
You may answer as many times as you want, but you may not counter your own program.
You may make edits to your code until it has been superseded.
In a nutshell, you must write a program that never loses to its predecessor.
Testing
Click here to see my match simulation. Paste in your code in the Programs.cs file, in your corresponding function. The attacker is the one who is trying to supersede a program. The defender is the one whos program is attempting to hold its place. The defender always moves first.
After your program has been pasted in, run it. The console will open, and it will run the simulation.
Submission Format
Your submission must be in C#. Your submission must compile correctly.
Your submission must follow this format:
#<answer number>
[Previous](<Permalink to previous answer>)

    CODE HERE
    CODE HERE

TL;DR
Basically, you will be coding AIs to compete in four-in-a-row.
However, read the whole thing if you want to compete!
Good luck!

@musicman523 that's in Java, this is C# - not sure if that affects dupeyness

1
First answer!
if(!variables.ContainsKey("randy")){
    variables["randy"] = new Random();
}
return ((Random)variables["randy"]).Next(0, 7);

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
2D partitioned cumulative sum
Challenge
Given a matrix M with r rows and c columns, and two Boolean lists V of length r and H of length c, calculate the partitioned cumulative vertical and horizontal sums.
Rules

r and c are greater than or equal to one
H and V begin with a true value
The values in M are within your language's reasonable numeric domain.
Partitioning and summing begins in the top left corner.

Walk through
Given M:
┌──────────────┐
│ 1  2  3  4  5│
│ 6  7  8  9 10│
│11 12 13 14 15│
│16 17 18 19 20│
└──────────────┘

H: 1 0 1 0 0
V: 1 1 0 1
Split M into groups of columns, beginning a new group at every true value of H
┌─────┬────────┐
│ 1  2│ 3  4  5│
│ 6  7│ 8  9 10│
│11 12│13 14 15│
│16 17│18 19 20│
└─────┴────────┘

Split each group of columns into groups of rows, beginning a new group at every true value of V:
┌─────┬────────┐
│ 1  2│ 3  4  5│
├─────┼────────┤
│ 6  7│ 8  9 10│
│11 12│13 14 15│
├─────┼────────┤
│16 17│18 19 20│
└─────┴────────┘

Cumulatively sum each cell horizontally:
┌─────┬────────┐
│ 1  3│ 3  7 12│
├─────┼────────┤
│ 6 13│ 8 17 27│
│11 23│13 27 42│
├─────┼────────┤
│16 33│18 37 57│
└─────┴────────┘

Cumulatively sum each cell vertically:
┌─────┬────────┐
│ 1  3│ 3  7 12│
├─────┼────────┤
│ 6 13│ 8 17 27│
│17 36│21 44 69│
├─────┼────────┤
│16 33│18 37 57│
└─────┴────────┘

Result:
┌──────────────┐
│ 1  3  3  7 12│
│ 6 13  8 17 27│
│17 36 21 44 69│
│16 33 18 37 57│
└──────────────┘

Additional test cases
M:
┌───────────┐
│15 11 11 17│
│13 20 18  8│
└───────────┘

H: 1 0 0 1 V: 1 0
Result:
┌───────────┐
│15 26 37 17│
│28 59 88 25│
└───────────┘

M:
┌─┐
│7│
└─┘

Result (H and V must be 1):
┌─┐
│7│
└─┘

M:
┌──┐
│ 3│
│-1│
│ 4│
└──┘

V: 1 1 0 (H must be 1)
Result:
┌──┐
│ 3│
│-1│
│ 3│
└──┘

M:
┌───────────────────────────────────────────────────────┐
│10    7.7 1.9 1.5 5.4  1.2 7.8 0.6 4.3 1.2  4.5 5.4 0.3│
│ 2.3  3.8 4.1 4.5 1    7.7 3   3.4 6.9 5.8  9.5 1.3 7.5│
│ 9.1  3.7 7.2 9.8 3.9 10   7.6 9.6 7.3 6.2  3.3 9.2 9.4│
│ 4.3  4.9 7.6 2   1.4  5.8 8.1 2.4 1.1 2.3  7.3 3.6 6  │
│ 9.3 10   5.8 9.6 5.7  8.1 2.1 3.9 4   1.3  6.3 3.1 9  │
│ 6.6  1.4 0.5 6.5 4.6  2.1 7.5 4.3 9   7.2  2.8 3.6 4.6│
│ 1.7  9.9 2.4 4.5 1.3  2.6 6.4 7.8 6.2 3.2 10   5.2 8.9│
│ 9.9  5.3 4.5 6.3 1.4  3.1 2.3 7.9 7.8 7.9  9.6 4   5.8│
└───────────────────────────────────────────────────────┘

H: 1 0 0 1 0 1 1 1 0 1 1 1 0
V: 1 0 0 0 0 1 0 0
Result:
┌────────────────────────────────────────────────────────────────┐
│10   17.7 19.6  1.5  6.9  1.2  7.8  0.6  4.9  1.2  4.5  5.4  5.7│
│12.3 23.8 29.8  6   12.4  8.9 10.8  4   15.2  7   14    6.7 14.5│
│21.4 36.6 49.8 15.8 26.1 18.9 18.4 13.6 32.1 13.2 17.3 15.9 33.1│
│25.7 45.8 66.6 17.8 29.5 24.7 26.5 16   35.6 15.5 24.6 19.5 42.7│
│35   65.1 91.7 27.4 44.8 32.8 28.6 19.9 43.5 16.8 30.9 22.6 54.8│
│ 6.6  8    8.5  6.5 11.1  2.1  7.5  4.3 13.3  7.2  2.8  3.6  8.2│
│ 8.3 19.6 22.5 11   16.9  4.7 13.9 12.1 27.3 10.4 12.8  8.8 22.3│
│18.2 34.8 42.2 17.3 24.6  7.8 16.2 20   43   18.3 22.4 12.8 32.1│
└────────────────────────────────────────────────────────────────┘

Jelly, 10 bytes
Zœṗ@+\€Ẏð/

Try it online! and The Last Test Case
 (With a G at the end for readability).
Input is taken as a list [M, H, V].
Explanation
Zœṗ@+\€Ẏð/  Input: [M, H, V]
        ð/  Insert the previous (f) as a dyadic link
            Forms f( f(M, H) , V)
            For f(x, y):
Z             Transpose x
 œṗ@          Partition the rows of x^T at each true in y
    +\€       Compute the cumulative sums in each partition
       Ẏ      Tighten (Joins all the lists at the next depth)

You can use a footer like this so that you don't have to tamper with your actual code.

APL (Dyalog), 13 bytes
Takes ist of V H M as argument.
{⍉⊃,/+\¨⍺⊂⍵}/

Try it online!
{…}/ insert (reduce by) the following anonymous function, where the term in the left is represented by ⍺ and the term on the right is represented by ⍵. Due to APL functions being right associative, this is therefore V f (H f M).
⍺⊂⍵ partition ⍵ according to ⍺
+\¨ cumulative sum of each part
,/ reduce by concatenation (this encloses the result to reduce rank)
⊃ disclose
⍉ transpose

Python 2 + numpy, 143 138 117 115 110 108 bytes
-21 bytes thanks to Adám!
lambda M,*L:reduce(lambda m,l:vstack(map(lambda p:cumsum(p,0),split(m,*where(l)))).T,L,M)
from numpy import*

Try it online!

ask for partition, split, and cumsum once, transpose, repeat.

@Adám Thanks, I didn't think of that for some reason.

I liked the list lookup of two functions anyway :)

Please make header "Python 3 + numpy"

Jelly,  15  14 bytes
œṗ+\€Ẏ
ḢçÐ€Zð⁺

A dyadic link taking H,V on the left and M on the right and returning the resulting matrix.
Try it online!
Alternatively as a single line also for 14: Ḣœṗ+\€Ẏ$¥Ð€Zð⁺
How?
œṗ+\€Ẏ - Link 1: partition and cumSum: list of partition bools, list of values
œṗ     - partition (the values) at truthy indexes (of the bools)
    €  - for €ach part:
  +\   -   cumulative reduce by addition
     Ẏ - tighten (flattens back into a list)

ḢçÐ€Zð⁺ - Main link: list of lists, [H,V]; list of lists, M
      ⁺ - perform this twice:
     ð  - [it's a dyadic chain for the second pass, first pass is dyadic implicitly]
Ḣ       -   head, pop it & modify (so H the first time, V the second)
  Ð€    -   map across right: (M the first time, the intermediate result the second)
 ç      -     the last link (1) as a dyad
    Z   -   transpose the result (do the rows first time, and the columns the second)

Previous:
œṗ@+\€Ẏ
ç€Zç€⁵Z

A full program printing a representation of the result.

Whoa -50% from previous Jelly answer!

Whoa what? Wow. I really need to study how you did this... Incredible compared to mine!

Oh this is doing the two directions separately, right? Smart.

I think it's doing roughly the same thing...

Good method. Means I can beat this with APL. I've got 14 bytes.

@Adám ...I'm almost certain there is a shorter way by taking H,V as one argument ad using reduce, but I can't quite work out how.

I am amazed that Jelly is so golfable - first 31 then 14 and now a 10...

@JerryJeremiah I thought a reduce would be available for less, but did not think to start with all 3 inputs in 1 list - that was key.

MATL, 19 bytes
,!ix"0GYs@12XQ!g]v!

Inputs are M (matrix), H (column vector), V (column vector). The row separator is ;.
Try it online! Or verify all test cases: 1, 2, 3, 4, 5.
Explanation
This does the cumulative sum horizontally, then vertically.
,          % Do the following twice
  !        %   First time this inputs M implicitly. Transpose. Second time
           %   it transposes the result of the horizontal cumulative sum
  ix       %   Input H (first time) or V (second time). Delete it; but gets
           %   copied into clipboard G
  "        %   For each column of the matrix
    0G     %     Push most recent input: H (first time) or V (second)
    Ys     %     Cumulative sum. This produces a vector of integer values
           %     such that all columns (first time) or rows (second) of M
           %     with the same value in this vector should be cumulatively
           %     summed
    @      %     Push current column of M transposed (first time) or M after
           %     horizontal cumulative sum (second time)
    12XQ   %     Cumulative sum. Gives a cell array of row vectors
    !g     %     Join those vectors into one row vector
  ]        %   End
  v        %   Concatenate the row vectors vertically into a matrix
  !        %   Transpose. This corrects for the fact that each column vector
           %   of the matrix was cumulatively summed into a row vector
           % Implicit end. Implicit display

Most impressive. I guess Matlab was kinda made for stuff like this.

@Adám I'm sure APL's length won't be very different :-)

My reference implementation used to generate the test cases is 26 bytes.

@Adám Darn! APL beating Jelly? This is unacceptable! (must golf my solution... lol) xD

@HyperNeutrino Well, Jelly doesn't have both rank and depth like APL and J have.

@Adám Yeah... Jelly wasn't a great choice. I seems to me that Matrix Laboratories (MATLAB if I remember correctly?) might be a better choice for matrices :)))

@HyperNeutrino Heh, I should have gone full 3D or nD.

@Adám 3D could make a nice challenge (in the not-too-near future). The problem may be how to represent the ouput

@LuisMendo Easy; stack of matrices. Or with box drawing.

J, 20 bytes
;@(<@(+/\);.1|:)&.>/

Try it online!
Input is taken as an array of boxes containing [V, H, M].
Explanation
;@(<@(+/\);.1|:)&.>/  Input: [V H M]
  (     g      )   /  Insert g and reduce (right-to-left)
                      Forms V g H g M = V g (H g M)
                & >     Unbox each
             |:         Transpose the right arg
          ;.1           Partition
      +/\               Reduce each prefix using addition (cumulative sum)
   <@                   Box each partition
;@                      Raze (Concatenate the contents in each box)
                &.>     Box the result

Mathematica, 212 bytes
(T=Transpose;A=AppendTo;J=Flatten;f[s_]:=Block[{},t=2;r=1;w={};While[t<=Length@s,If[s[[t]]==0,r++,w~A~r;r=1];t++];w~A~r];K[x_,y_]:=Accumulate/@#&/@(FoldPairList[TakeDrop,#,f@y]&/@x);d=J/@K[#,#2];T[J/@K[T@d,#3]])&

input
[M,H,V]

[{{15, 11, 11, 17}, {13, 20, 18, 8}}, {1, 0, 0, 1}, {1, 0}]

C# (.NET Core), 164 bytes
(M,H,V)=>{int a=M.Length,b=M[0].Length,i,j;for(i=0;i<a;i++)for(j=0;j<b;j++)if(!H[j])M[i][j]+=M[i][j-1];for(i=0;i<a;i++)for(j=0;j<b;j++)if(!V[i])M[i][j]+=M[i-1][j];}

Try it online!
Basically it does exactly as specified in the OP. It first iterates to sum horizontally and then it iterates again to sum vertically.

Haskell, 129 bytes 119 bytes
s m v=tail$scanl(\a(x,s)->if s then x else zipWith(+)a x)[](zip m v)
t=foldr(zipWith(:))$repeat[]
f m h v=t$s(t$s m v)h

Try it online!
Saved 10 bytes thanks to @ceasedtoturncounterclockwis
t (for transpose) switches rows and columns. A quick explanation:
foldr(zipWith(:))(repeat[])(r1,...,rn) =
zipWith(:) r1 (zipWith(:) r2 (... zipWith(:) rn (repeat [])))

Read from right to left: we browse rows from bottom to up, and push each value in its destination column.
s is basically a rolling sum of vectors, but resets when a True value arises in v
f sums the rows with s following v and do the same with the columns following h

t=foldr(zipWith(:))(repeat[]). Not only shorter, also much less inefficient.

@ceasedtoturncounterclockwis Thanks for the tip.

JavaScript (ES6), 88 bytes
(a,h,v)=>a.map(b=>b.map((e,i)=>t=h[i]?e:t+e)).map((b,j)=>t=v[j]?b:t.map((e,i)=>e+b[i]))

Jelly, 31 bytes
+\€€
œṗḊZ€⁵œṗ$€Ḋ€Ç€ÇZ€€Z€;/€€;/

Try it online!
Gah this is way too long for Jelly xD
BTW, 11/31 bytes in this program consists of euro characters. That's over a third of the program!

Too many Euros.

@Adám My thoughts exactly :P Working with doubly partitioned matrices isn't as fun as I thought it would be, because I'm doing second-level to third-level mapping xD

Why are you wasting your money like this €-€

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Do the circles intersect?
This question is similar to Do the circles overlap?, except your program should return True if the circumference of one circle intersects the other, and false if they do not. If they touch, this is considered an intersection. Note that concentric circles only intersect when both radii are equal
Input is two x, y coordinates for the circle centres and two radius lengths, as either 6 floats or ints, in any order, and output a boolean value, (you may print True or False if you choose)
test cases are in format (x1, y1 x2, y2, r1, r2):
these inputs should output true:
0 0 2 2 2 2
1 1 1 5 2 2
0.55 0.57 1.97 2.24 1.97 2.12

these should output false:
0 0 0 1 5 3
0 0 5 5 2 2
1.57 3.29 4.45 6.67 1.09 3.25

So this is the same as the other one except for if one circle is entirely inside the other?

@geokavel essentially, yes

The slight variation makes for a very different problem. Good job!

Related.

You are using an unusual definition of intersection. In Mathematics, one circle being entirely within the other implies there is intersection. So you should perhaps rephrase, replacing "intersection" by "partial intersection"

@LuisMendo I don't think such a rephrasing is necessary. the usual mathematical definition of a circle is the set of points a given distance from a center, so I would say that this is the usual mathematical definition of circle intersection (i.e., is there a point on both circles).

@Giuseppe I understood "circle" as the line and its interior. Potentially confusing, but I think you are right

Mathematica 67 bytes
This checks whether the area of the intersection of two disks is positive.
RegionMeasure@RegionIntersection[{#,#2}~Disk~#3,{#4,#5}~Disk~#6]>0&

Mathematics. Isn't this Mathematica?

APL (Dyalog), 20 bytes
Uses Anders Kaseorg's formula: 0≤(x₁−x₂)²−(r₁−r₂)²+(y₁−y₂)²≤4r₁r₂
Takes (x₁, r₁, y₁) as left argument and (x₂, r₂, y₂) as right argument.
(-/2*⍨-)(≤∧0≤⊣)4×2⊃×

Try it online!
The overall function's structure is a fork (3-train) where the tines are -/2*⍨- and ≤∧0≤⊣ and 4×2⊃×*. The middle tine takes the results of the side tines as arguments. The side tines use the overall function's arguments.
Right tine:
× multiply the arguments (x₁x₂, r₁r₂, y₁y₂)
2⊃ pick the second element (r₁r₂)
4× multiply by four (4r₁r₂)
Left tine:
- subtract the arguments (x₁−x₂, r₁−r₂, y₁−y₂)
2*⍨ square ((x₁−x₂)², (r₁−r₂)², (y₁−y₂)²)
-/ minus reduction i.e. alternate sum* ((x₁−x₂)²−((r₁−r₂)²−(y₁−y₂)²))
Now we use these results as arguments to the middle tine:
0≤⊣ is the left argument greater than or equal to zero
∧ and
≤ the left argument smaller than or equal to the right argument?

* due to APL's right associativity

APL (Dyalog Classic), 17 bytes
(+/∧.≥+⍨)⎕,|0j1⊥⎕

Try it online!
expects two lines of input: x1 y1 x2 y2 and r1 r2
⎕ read and evaluate a line
0j1 imaginary constant i=sqrt(-1)
0j1⊥ decode from base-i, thus computing: i3x1 + i2y1 + i1x2 + i0y2 = -i x1 - y1 + ix2  + y2 = i(x2-x1) + (y2-y1)
| magnitude of that complex number, i.e. distance between the two points
⎕, read the two radii and prepend them, so we have a list of 3 reals
(+/∧.≥+⍨) flat-tolerant triangle inequality: the sum (+/) must be greater than or equal to (≥) the double of each side (+⍨), and all these results must be true (∧.)

Python 3, 56 55 bytes
lambda X,Y,x,y,R,r:0<=(X-x)**2+(Y-y)**2-(R-r)**2<=4*r*R

Try it online!

-1 byte.

@notjagan Sure, thanks!

GolfScript, 20 bytes
~@- 2?@@- 2?+@@+2?>!

Try it online!
Takes arguments in the following form r1 r2 x1 y1 x2 y2
Implements the formula below

GolfScript Does not inherently support floating point types. See this post for more details about passing floats https://codegolf.stackexchange.com/a/26553
My original intention was to use GolfScript's zip and fold operations.
GolfScript, 26 bytes
1:a;~zip{{a*+2?-1:a;}*}/+>

Try it online!

@JamesHolderness I forgot to mention that little quirk in GolfScript. See the edit concerning this.

Just updated the input to be an implementation of the truthy float test. The values aren't exact, but it still works.

JavaScript, 52 bytes
(X,Y,x,y,R,r)=>4*r*R/((X-x)**2+(Y-y)**2-(R-r)**2)>=1

Some how Based on Anders Kaseorg Python solution

Scala, 59 bytes
This might be golfable.
val u=(a-x)*(a-x)+(b-y)*(b-y)
(q-r)*(q-r)<=u&u<=(q+r)*(q+r)

Try it online!
Scala, 66 bytes
I do like this one, but sadly the previous was shorter. I hate Scala for forcing defining parameter type...
var p=math.pow(_:Double,2)
val u=p(a-x)+p(b-y)
p(q-r)<=u&u<=p(q+r)

Try it online!


text:
Number of Managers
A company is arranged in a heirarchical structure, with a layer of workers at the bottom. Each worker is managed by a manager. Consequently, each manager is managed by another manager until there is a company "boss". Each manager is restricted to managing, at most, x workers. For a company of size y calculate the number of managers required (including the boss)
Function should take two inputs.
Eg non-golfed definition:
calc_num_managers(num_workers, num_workers_per_manager)
You can assume that the number of workers per manager will be greater than 1.
Examples:

A company with 0 workers needs 0 managers
If the company has 4 workers, and each manager can manage 8 workers, then there is 1 manager.
If the company has 4 workers, and each manager can manage 4 workers,  then you need 1 manager
If the company has 12 workers, and each manager can manage 8 workers, then there are 3 managers:

I don't understand "If the company has 12 workers, and each manager can manage 8 workers, then there are 3 managers (two team leaders and a boss)" and the next one either : 11*3 = 33, which is far more than 20, why not 7 managers (7*3=21) ?

"two team leaders and a boss" - This needs to be expanded on.

Hello and Welcome to PPCG. You should consider posting in the sandbox first. Your examples make no sense. I´d say 7 or 5 managers for the last example, depending on wether the managers are workers too or not.

At first I thought, you were asking for ceiling(y/x) but now I'm confused..

I have clarified the question.

@sdfgeoff So it is a pyramid scheme where each new layer can handle x employees until the top of the pyramid when there is only 1? What happens when managers can only handle one or no employees? What happens with empty companies? etc...

Empty companies have no managers (seems obvious to me, but I will add it to examples), and the case of managers handling one employee is mentioned at the bottom of the question - probably not the best place to put it, so I've moved it further up.

I propose making the examples easier to read/understand and also reformatting the whole challenge a bit. Have a look at some other recent challenges around the site to get an idea.

Still not clear, why 3 managers are needed.. here

So the managers need to be managed too? But aren´t they workers then?

@BruceForte I assume it is because it's a pyramid scheme but I do agree it's unclear as to why.

Can't the last case be done with just two managers?  One manager manages 8 people so that leaves 4 remaining, the other manager can manage the 4 workers and the other manager, thats a total of 5 which is less than 8.

And who manages those two managers. Because it's heirachical, there eventually should be just one "boss". As Titus says, yes, the manages need to be managed,

The second manager is the one boss in Wheat Wizard's organogram.

Do we assume that the num_workers_per_manager parameter is always greater than 0 ?

C, C++, Java, C#, D : 73 69 bytes
-4 bytes thanks to Zacharý
Due to the similarities between theses languages, this answer works for each.
Maybe it works in processing too, but i can't test
int c(int w,int p){int r=0;do{w=(w+p-1)/p;r+=w;}while(w>1);return r;}

Here is an optimized version in D : 62 bytes thanks to Zacharý
T c(T)(T w,T p){T r;do{w=(w+p-1)/p;r+=w;}while(w>1);return r;}

T here is a type for template metaprogramming. This function is callable with c(4,8);

Amazing, one code for 3 langs))

@ЕвгенийНовиков 4* languages. Just edited to test for C :)

And how about includes ? https://codegolf.meta.stackexchange.com/questions/7515/when-do-i-have-to-include-things-like-javas-public-static-void-main/7516#7516

@ЕвгенийНовиков Well, the question just says to have a function, not a full program

I think this works in D (wow, actually a decent D answer) and Processing as well.

@Zacharý Are you sure about that ? If not, is there anyway to "test" that without downloading the compiler ? I currently have a internet connection that struggle to deliver a 144p youtube video.

https://tio.run/, and just 144 pixels?!

I've tested D on my machine.
I am unsure of Processing.

Converting it to D would actually save you two bytes (in D, the =0 is not needed).

@Zacharý Tested in D with TIO, but it does not seems they also have processing. And for my internet connection, let's just say i'm far far away from big cities with broadband fiber connections, in a country where unlimited internet connections is pretty rare. I will update my post for optimized D version

Sorry for the spam! I know D passes ints by value, but I'm not sure about C/C++/C#/Java, if they all pass an int by value rather than by reference, you could remove t and change all occurrences of t to w.

@Zacharý C, C++, Java and C# all pass by values in this case

Also, D's solution can become T c(T)(T w,T p){T r;do{w=(w+p-1)/p;r+=w;}while(w>1);return r;}, since D has a golfy template system.

Husk, 7 bytes
ΣtU¡(⌈/

Try it online!
Repeatedly (¡) takes the ceiling (⌈) of the division (/) of the number of workers by the number of workers per manager and sums (Σ) all the unique results (U).

Jelly, 14 bytes
Ṃ÷⁴Ċ0Ṃ’$?µÐĿḊS

Try it online!

JavaScript, 46 43 bytes
If scheme isn't solvable, there will be stack exeeded error
-3 bytes ceil trick inspired by Cows quack

f=(w,m)=>(r=0|(w+m-1)/m,r>1&&(r+=f(r,m)),r)

//test
;[[0,1],[4,8],[4,4],[12,8],[8,3],[10,3]]//0;1;1;3;4;7
.map(e=>console.log("w="+e[0]+" m="+e[1]+" result="+f(e[0],e[1])))

Requirements
w count of workers, non-negative integer
m count of max workers per manager, positive integer

I believe |1 is shorter than Math.ceil

@Cowsquack (19/10)|1 is 1, but ceil 2

Perl 5, 44 + 1 (-n) = 45bytes
$t=<>;$m+=$_=1+int$_/$t while($_>1);say$m|$_

Try it online!

authors: Евгений Новиков


text:
Create an omnifix calculator
Inspiration. Inverse.
Evaluate a given omnifix expression.
Omnifix is like normal mathematics' infix notation, but with additional copies of each symbol surrounding the arguments. The outer symbols take the place of parentheses, and there is therefore no need for additional parentheses.
You must support addition, subtraction, multiplication, division, and positive real numbers (negative ones can be written -0-n-) within a reasonable range for your language.
Plus and minus must be + and -, but you may use * or × for times and / or ÷ for divide. Other reasonable symbols will be allowed upon request.
Brownie points for explanation and additional features (like additional operations, negative numbers, strings, etc.) Even if your answer does not have these features, feel free to show how it could.
Please provide a link to test your solution if at all possible.
Examples
For clarity, the explanations below use high minus (¯) to indicate negative numbers. You may return negative numbers using any reasonable format.
-5-2- → 3
+2+×3×2×+ → 8 (+2+×3×2×+ → +2+6+ → 8)
-14--3-1-- → 12 (-4--3-1-- → -14-2- → 12)
+2.1+×3.5×2.2×+ → 9.8 (+2.1+×3.5×2.2×+ → +2.1+7.7+ → 9.8)
×3×÷-0-6-÷2÷× → -9 (×3×÷-0-6-÷2÷× → ×3×÷¯6÷2÷× → ×3×¯3× → ¯9)
÷4÷-3-÷1÷2÷-÷ → 1.6 (÷4÷-3-÷1÷2÷-÷ → ÷4÷-3-0.5-÷ → ÷4÷2.5÷ → 1.6)

The explanations below use high minus (\¯`) to indicate negative numbers.` You definitely love APL.

@EriktheOutgolfer You have a better suggestion? Also, TI-BASIC uses high minus.

Actually not since -s can be confused with -s while ¯s can't be confused with -s.

Bah, I just noticed the real number requirement. So much for my 290-byte integer arithmetic Retina solution...

@Neil Why don't you post it as an answer?

@Adám Your wish is my command!

Python 3, 159 158 152 144 136 135 132 bytes
def t(i,a=1):
 while'-'<l[i]!='/':i+=1;a=0
 if a:l[i]='(';i=t(t(i+1));l[i-1]=')'
 return-~i
*l,=input()
t(0)
print(eval(''.join(l)))

Try it online!
Doesn't allow negative numbers (though -0-5- works of course) and requires python operators.

Can you add a TIO link?

Sure, give me a minute to figure that out

while~-(l[i]in'+-*/'):i+=1;a=1 and *l,=input() for 152 bytes

with all the test cases: link

144 bytes

if a:l[i]='(';i=t(t(i+1));l[i-1]=')' with return-~i for 135 bytes :P

C# (.NET Core), 198 197 188 bytes
float O(string s){try{return float.Parse(s);}catch{var f=s[0];int i=s.IndexOf(f,1);float a=O(s.Substring(1,i-1)),b=O(s.Substring(i+1,s.Length-i-2));return f<43?a*b:f<44?a+b:f<46?a-b:a/b;}}

Try it online!
Uses * and /.
A recursive function. It first tries to parse the input string as a float. If it fails, it calls itself recursively passing as arguments the first and second operands and then performs the selected operation on the results.

1 byte saved thanks to Mr. Xcoder!
9 bytes saved thanks to TheLethalCoder!

IndefOf(f, 1) can be IndexOf(f,1)

Use floats instead, use the char codes, when you have them can probably shorten them with > and < in a couple of places.

You can golf a byte changing i+1,s.Length-i-2 to ++i,s.Length+~i.

Retina, 290 287 286 bytes
\d+
¦$&$*
¯¦
¯
{`\+([¯¦]1*)\+([¯¦]1*)\+
-$1-¯$2-
-(¯|¦)(1*)-([¯¦]+1*\2)-
-¯$3-¯$1$2-
(×|÷)¯(1*\1)([¯¦]1*\1)
$1¦$2¯$3
×¦×[¯¦]1*×|¯¯¦?
¦
¯¦|¦¯
¯
+`-((¯|¦)1*)(1*)-\2\3-
$1
-([¯¦]1*)-[¯¦](1*)-
$1$2
×¦1(1*)×([¯¦]1*)×
+×¦$1×$2×+$2+
}`÷¦(?=1*÷(¯|¦)(1+)÷)(\2)*1*÷\1\2÷
$1$#3$*
((¯)|¦)(1*)
$2$.3

Try it online! Note: Only capable of integer arithmetic, so some of the test cases have been removed. Accepts and returns negative numbers using the ¯ prefix. Edit: Saved 3 4 bytes thanks to @Cowsquack. Explanation:
\d+
¦$&$*

I needed some way of handling zero, so I use ¦ as a positive number prefix. The numbers are then converted to unary.
¯¦
¯

But negative numbers only need a ¯ prefix.
{`\+([¯¦]1*)\+([¯¦]1*)\+
-$1-¯$2-

Quoting +s gets ugly, so I turn additions into subtractions.
-(¯|¦)(1*)-([¯¦]+1*\2)-
-¯$3-¯$1$2-

If the absolute value of the LHS of a subtraction is less than the RHS, switch them around and negate both sides.
(×|÷)¯(1*\1)([¯¦]1*\1)
$1¦$2¯$3

Also if the LHS of a multiplication or division is negative, negate both sides.
×¦×[¯¦]1*×|¯¯¦?
¦

Also if the LHS of a multiplication is zero, then the result is zero. Also, two minuses make a plus.
¯¦|¦¯
¯

But a minus and a plus (or vice versa) make a minus.
+`-((¯|¦)1*)(1*)-\2\3-
$1

Subtract two numbers of the same sign. Do this repeatedly until there are no such subtractions left.
-([¯¦]1*)-[¯¦](1*)-
$1$2

If there's still a subtraction, the signs must be different, so add the numbers together. (But only do this once, since this may reveal a subtraction of two numbers of the same sign again.)
×¦1(1*)×([¯¦]1*)×
+×¦$1×$2×+$2+

Perform multiplication by repeated addition.
}`÷¦(?=1*÷(¯|¦)(1+)÷)(\2)*1*÷\1\2÷
$1$#3$*

Perform integer division. One of the above steps will have simplified the expression, so loop back until there are no operations left.
((¯)|¦)(1*)
$2$.3

Convert back to decimal.

Wow, that is – epic. Largest Retina post on PPCG? However, usually QuadR and Retina solutions resemble each other closely. Can I maybe inspire?

In this line +\-(([¯¦])1*)(1*)-\2\3-, [¯¦]can become¯|¦`

@Cowsquack Happens three times in fact, thanks!

There's one you missed ([×÷]) ;)

@Cowsquack You'd better not find another one, otherwise I'll have to cross out 4...

PHP, 116 114 109 bytes
-5 thanks to Martin Ender
for($s=$argv[$o=1];$o!=$s;)$s=preg_replace('#([*+/-])(([\d.]+|(?R))\1(?3))\1#','($2)',$o=$s);eval("echo$s;");

Uses * for multiplication and / for division. Negative numbers happen to work despite me making no specific attempts for that to be the case.
Try it online!
Ungolfed and Explained
for($s=$argv[$o=1];   # Initialize with $s = input and $o = 1;
    $o!=$s;)          # While $o != $s
    # Set $o to $s and set $s to be $s after this regex replacement:
    $s=preg_replace('#([*+/-])(([\d.]+|(?R))\1(?3))\1#','($2)',$o=$s);
    # i.e., continue to do this replacement until the result is the same on two consecutive
    # steps (no replacement was made)
# Once $o == $s (i.e. no more replacement can be made), eval the result and print
eval("echo$s;");

I'll also explain the regex because it's a bit magical:
([*+/-])(([\d.]+|(?R))\1(?3))\1

([*+/-])

First, we want to match any of the four operators: *+/-
([\d.]+|(?R))

Then, we need to match either a number [\d.]+ or another valid omnifix expression (?R).
\1

Then, we match the same operator that was at the beginning.
(?3)

Then we do the same thing we did in group 3: match a number or an omnifix expression.
\1

Finally, match the initial operator again.
Whatever matches this is replaced with ($2). This takes the part inside the surrounding operators and puts it inside brackets, so it looks like normal infix notation.

QuadR, 33 32 27 bytes
-1 thanks to Cows Quack. -5 thanks to Erik the Outgolfer.
((.)[\d¯\.]+){2}\2
⍎¯1↓1↓⍵M

with the argument/flag ≡
Try it online!
This is equivalent to the 40-byte Dyalog APL solution:
'((.)[\d¯\.]+){2}\2'⎕R{⍕⍎1↓¯1↓⍵.Match}⍣≡

Try it online!
Explanation
(parenthesised text refers to Dyalog APL instead of QuadR)
 (…){2}\2 the following pattern twice, and the whole match twice too:
  (.) any character
  […]+ followed by one or more of the following set of characters:
   \d digits,
   ¯ high minus (negative sign)
   \. period
(⎕R is Replaced with:)
({…} the result of the following anonymous function applied to the namespace ⍵:)
 ⍵M (⍵.Match) the text of the Match
 ¯1↓ drop the last character (the symbol + - × or ÷)
 1↓ drop the first character (symbol)
 ⍎ execute as APL code
 (⍕ stringify)
≡ (⍣≡) repeat the replacement until no more changes happen

I think you can drop ⍕

@Cowsquack You are right about QuadR. ⎕R cannot operate on numeric data. Thanks.

Shorter regex; -5 bytes.

Haskell, 132 chars
(134 bytes, because × and ÷ take two bytes in UTF-8)
f y|(n@(_:_),r)<-span(`elem`['.'..'9'])y=(read n,r)
f(c:d)|(l,_:s)<-f d,(m,_:r)<-f s=(o[c]l m,r)
o"+"=(+)
o"-"=(-)
o"×"=(*)
o"÷"=(/)

Try it online!
f parses as much of the input as it can and yields the result as well as the remaining string (which is empty in the test cases). If that's not rule-conformant, strip the unparseable remainder string with
Haskell, 139 chars
...
g=fst.f

Perl, 64 53 bytes
Include +1 for -p
perl -pe 's%([*-/])(([\d.]+|(?0))\1(?3))\1%($2)%&&redo;$_=eval' <<< "/4/-3-/1/2/-/"

Accidentally also implements , (throws away the first argument) and sometimes . (append the arguments together). . doesn't work very reliable though since it interferes with decimal point both at the parsing level and at the evaluation level

Java 8, 205 200 bytes
float O(String s){try{return new Float(s);}catch(Exception e){int f=s.charAt(0),i=s.indexOf(f,1);float a=O(s.substring(1,i)),b=O(s.substring(i+1,s.length()-1));return f<43?a*b:f<44?a+b:f<46?a-b:a/b;}}

Port of @Charlie's C# answer.
-5 bytes thanks to @ceilingcat.
Try it online.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Output Rhombus Sequence without Nested Loops
The following is the rhombus sequence.
1
121
12321
1234321
123454321
12345654321
1234567654321
123456787654321
12345678987654321

Your task is to output this, taking no input and using standard output methods (STDOUT, list of numbers or list of strings, etc.).
There's a hitch. You may only use up to one loop - no nested loops. Recursion counts as a loop, so you can either recurse or loop, not both. Non-standard languages will be dealt with on a case-by-case basis.
This is code-golf, so shortest program in bytes wins. This is kolmorgorov-complexity, so you may not take any input whatsoever.

Hey pluto, I edited your challenge to be on-topic here. Let me know if you disagree with anything I said - I think you'll get answers now though, if it gets reopened.

Appreciate the effort @StepHen! I think I should have put my question this way itself.

Does mapping over a list count as a loop?

This is a do X without Y challenge, which are discouraged.

FYI: This is 1², 11², 111², ..., 111111111²

@Shaggy I don't think so, this is [tag:restricted-source].

Banning loops is not a source restriction.

Is looping & recursion only banned at the highest level (explicitly instructed in the source) or should lower levels avoid them too; if so to what level?

Mathematica, 23 bytes
((10^#-1)/9)^2&~Array~9

Try it online!

Nice use of math formulas. I borrowed that for my Python answer too. +1

05AB1E, 7 bytes
Only one for-loop here
TG1N×n,

Uses the 05AB1E encoding. Try it online!
Explanation:
TG        # For N in range(1, 10):
  1N×     # Push a string of N 1's
     n    # Square that number
      ,   # Pop and print with a newline

9LηεûJ= counts as 1 loop or 3 loops? I guess prefixes would loop and so would range?

Python 2, 32 31 bytes
-1 byte thanks to  officialaimm

o=0
exec"o=o*10+1;print o*o;"*9

Try it online!

Python 2, 42 40 38 35 bytes
-2 thanks to @officialaimm
I ported Jenny_mathy's Mathematica answer to Python, because the arithmetic approach is much shorter:
i=1;exec"print(10**i/9)**2;i+=1;"*9

Try it online!
Exaplanation

i=1 - Initializes a variable i to 1.

exec"..."*9 - Executes ... 9 times.

print(10**i/9)**2 - Prints 10 i and divides the result by 9, which then gets sqaured.

i+=1 - Increment i and execute again.

Python 2, 37 bytes
for i in range(9):print(10**-~i/9)**2

Try it online!

Python 2, 63 bytes
This is the initial version.
l='123456789'
for i in l:s=l.index(i);print l[:s]+l[:s+1][::-1]

Try it online!

@officialaimm Too late, I already have 35 :)

Jelly, 5 bytes
9ŒḄ€Y

Try it online!
This only uses one mapping loop (€) since ŒḄ (palindromize) is a builtin already. Explanation:
9ŒḄ€Y
9     9
   €  Map (our looping construct)
 ŒḄ     Palindromize (make range)
    Y Join by newlines.

ŒḄ€Y everybody, ŒB€Y!

Brachylog, 15 bytes
9⟦₁{⟦₁⟨kc↔⟩cẉ}ᵐ

Try it online!
Yeah this doesn't feel much declarative...

Vim + coreutils, 42 bytes
i1⏎12<Esc>qqYp$ylp<C-a>q6@qggqqjYpv$!rev⏎kJd2lq7@q

Try it online!
Ungolfed/Explanation
i1⏎12<Esc>                                          " start with lines 1,12 in the buffer
          qq           q6@q                         " record macro and run it 6 times:
            Yp                                      "  - duplicate line
              $ylp                                  "  - duplicate last character
                  <C-a>                             "  - increment it
                           gg                       " go to the beginning (buffer is now: 1,12,123,...,12..89)
                             qq               q7@q  " record macro and run it 6 times:
                               jYp                  "  - go to line below and duplicate it
                                  v$!rev⏎           "  - mark it and reverse it
                                         kJ         "  - join the line above with the current one
                                           d2l      "  - remove the space and character that are too much

C#, 101 bytes
using System.Linq;_=>new int[9].Select((n,i)=>"123456789".Substring(0,i+1)+"87654321".Substring(8-i))

Try it online!

Or the loop approach for 111 bytes:
_=>{var a=new string[9];for(int i=0;i<9;)a[i]="123456789".Substring(0,++i)+"87654321".Substring(9-i);return a;}

Try it online!

SOGL V0.12, 8 7 bytes
9∫Δø∑ΓO

Try it Here!
Explanation:
9∫       do 9 times, pushing 1-indexed counter
  Δ        get 1-indexed (last inclusive) range
   ø∑      join together
     Γ     palindromise
      O    output it

Dyalog APL, 20 bytes
⍪(' '~⍨∘⍕⍳,1↓⌽∘⍳)¨⍳9

Try it online!
How?
¨⍳9 - for each in range 1..9
    ⍳, - produce the range of this number
    1↓⌽∘⍳ - appended to itself reversed without the last item
    ⍕ - format to string
    ' '~⍨ - remove spaces
⍪ - output vertically
17 bytes, doesn't work because of precision issues
⌽⍕×⍨⍪(10⊥1⍴⍨⊢)¨⍳9

This one uses the i ones squared identity, but replaces the first one on the last line with a 0, because the decoding rounds it up.

QBIC, 17 bytes
[9|?((z^a-1)/9)^2

From oeis.

R, 18 bytes
cumsum(10^(0:8))^2

Returns the values.
Try it online!
Due to floating point precision issues, the last number is 12345678987654320 which is equal to 12345678987654321 in R, as the footer shows. In the header, it sets the options to get the numbers to print in non-scientific notation.

Javascript 66 bytes
Returns an array of strings representing the numbers in the sequence (necessary because 12345678987654321 is too large to be accurately represented as an int in Javascript)
o=>Array(9).fill``.map(x=>(x+(n=n*10+1)*n).replace(0,1),n=0)

Explanation
o=>                               // o is unused input (saves 1 byte vs ())
    Array(9)                      // create an array of length 9
        .fill``                   // fill it with empty strings
                                  // we must fill it with something, because map skips
                                  // empty entries
        .map(                     // loop over the array and return a new array with the
                                  // values returned by the callback
            x=>(                  // x is the element in the array
                (x+(n=n*10+1)*n)  // make n 1, 11, 111, 1111, etc, and get the string
                                  // value of n^2
                    .replace(0,1) // replace 0's with 1's (necessary for
                                  // 12345678987654321, because
                                  // 111111111^2 = 12345678987654320 in javascript)
            ),
            n=0                   // n^2 is the rhombus number at each stage
        )

-6 bytes: o=>Array(9).fillBTBT.map(x=>(x+(n=n*10+1)*n).replace(0,1),n=0) (replace BT with backticks)

Thanks, I should have remember the backticks bit. Apparently my golf game just wasn't on yesterday >;o)

Kotlin, 46 bytes
(1..9).map{"1".repeat(it).toLong()}.map{it*it}

PHP, 38 37 bytes
for(;$i<9**8;)echo(($i.='1')**2)."
";

with warnings
PHP, 42 41 bytes
for($i=0;$i<9**8;)echo(($i.='1')**2)."
";

without warnings

Swift, 76 bytes
import Foundation
for i in 1...9{print(Int(pow((pow(10,Double(i))-1)/9,2)))}

Try it online!
If printing as an array of lines is allowed, here is 74 byte approach:
import Foundation
print((1...9).map{Int(pow((pow(10,Double($0))-1)/9,2))})

Try it online!

Perl 5, 22 bytes
say((1x$_)**2)for 1..9

Try it online!
Using Jenny_mathy's formula to save a lot of bytes.

Pyth, 11 bytes
jm^s*d\12S9

Try it online!

How does this work?

 m       S9         - Map over [1...9]
  ^s    2           - The square of the integer formed by:
    *d\1            - the string with n consecutive 1s.
j                   - Join by newlines

Haskell, 39 32 bytes
No for loops/recursion at all, makes use of list comprehension:
[[1..x]++[x-1,x-2..1]|x<-[1..9]]

Try it online!

List of numbers is allowed output, however im not sure if list of list of numbers is allowed.

Scala, 69 bytes
There is only one "loop", when I iterate over (1 to 9). But you could consider that there are loops in reverse and Range instanciations.
(1 to 9).map(x=>println(((1 to x)++(1 to x-1).reverse).mkString("")))

Try it online!

Google Sheets, 66 bytes
=ArrayFormula(Join("
",REPT(1,ROW(A1:A8))^2,"12345678987654321"))

No loops, just a matrix. It would only be 46 bytes but Sheets only has 15 decimal points of precision so the last number is displayed as 12345678987654300 or 1.23457E+1621 so I had to add it manually.

AHK, 55 bytes
a=1
Loop,9{
b:=a**2
Send %b%`n
a:=a 1
}
Send {VK08 2}1

This was too stupid of a result for me to not post. AHK messes rounds the last output to 12345678987654320 so we backspace twice and add a 1.


text:
How does the square end?
In base-10, all perfect squares end in \$0\$, \$1\$, \$4\$, \$5\$, \$6\$, or \$9\$.
In base-16, all perfect squares end in \$0\$, \$1\$, \$4\$, or \$9\$.
Nilknarf describes why this is and how to work this out very well in this answer, but I'll also give a brief description here:
When squaring a base-10 number, \$N\$, the "ones" digit is not affected by what's in the "tens" digit, or the "hundreds" digit, and so on. Only the "ones" digit in \$N\$ affects the "ones" digit in \$N^2\$, so an easy (but maybe not golfiest) way to find all possible last digits for \$N^2\$ is to find \$n^2 \mod 10\$ for all \$0 \le n < 10\$. Each result is a possible last digit. For base-\$m\$, you could find \$n^2 \mod m\$ for all \$0 \le n < m\$.
Write a program which, when given the input \$N\$, outputs all possible last digits for a perfect square in base-\$N\$ (without duplicates). You may assume \$N\$ is greater than \$0\$, and that \$N\$ is small enough that \$N^2\$ won't overflow (If you can test all the way up to \$N^2\$, I'll give you a finite amount of brownie points, but know that the exchange rate of brownie points to real points is infinity to one).
Tests:
 Input -> Output
 1     -> 0
 2     -> 0,1
 10    -> 0,1,5,6,4,9
 16    -> 0,1,4,9
 31    -> 0,1,2,4,5,7,8,9,10,14,16,18,19,20,25,28
 120   -> 0,1,4,9,16,24,25,36,40,49,60,64,76,81,84,96,100,105

this is code-golf, so standard rules apply!
(If you find this too easy, or you want a more in-depth question on the topic, consider this question: Minimal cover of bases for quadratic residue testing of squareness).

Does the output array need to be sorted?

@Shaggy Nope! Mego, Duplication is not allowed. Theoretically, N could be enormous, so duplicates would make the output pretty unreadable. I'll adit the question

Is outputting a set acceptable?

@totallyhuman Why wouldn't it be valid? Sets are unordered collections and it must not be sorted, so...

https://en.wikipedia.org/wiki/Quadratic_residue#Table_of_quadratic_residues for a table of testcases from 0 to 75.

Jelly, 5 bytes
R²%³Q

Try it online!
Explanation
R²%³Q   Main link, argument: n

R       Range from 1 to n
 ²      Square each
  %³    Mod each by n
    Q   Deduplicate

Google Sheets, 52 51 47 bytes
=ArrayFormula(Join(",",Unique(Mod(Row(A:A)^2,A1

Saved 4 bytes thanks to Taylor Scott
Sheets will automatically add 4 closing parentheses to the end of the formula.
It doesn't return the results in ascending order but it does return the correct results.

Holy cow, man that is fricken killer! Who would’ve thought?  +1

This is definitely my favorite answer so far.

@LordFarquaad I am surprised and pleased this was so well received. I've been trying to golf more in Sheets and Excel even though - and partially because - they have such limited ranges. It's led to a lot of array formulas.

You should be able to drop the terminating )s for -4 bytes

@TaylorScott Thanks! I saw that trick somewhere recently - probably on one of your answers - and need to remember to start using it.

Swift, 47 35 32* bytes
* -3 thanks to @Alexander.
Possibly the first time in history Swift ties beats Python?
{m in Set((0..<m).map{$0*$0%m})}

Try it online!

Explanation

(0..<m).map{} - Iterates through the range [0...m) and map the following results:

$0*$0%m - The square of each integer modulo the base m.

Set(...) - Removes the duplicates.

m in - Assigns the base to a variable m

Username checks out... wait a second.

More like it beats Python. That is impressive! I thought I would never see the day that would happen.

@CalebKleveter Thanks! I'm glad you found it impressive :)

05AB1E, 5 bytes
Lns%ê

Try it online! or as a Test Suite
L     # Range 1 .. input
 n    # Square each
  s%  # Mod by input
    ê # Uniquify (also sorts as a bonus)

How does s work here? Is the input repeated?

@LuisMendo s is pop a,b; push b,a. When a command tries to pop something from the stack and there isn't anything left the next input is used. If there isn't any more input the last input is used (here is an example). In this case I could have used ¹ which pushes the first input, but s works better for the test suite.

Thanks. Do you have more info regarding the criterion for which input gets reused? (if there have been say three inputs and you try to pop two values from an empty stack)?

@LuisMendo Input is used in order until it runs out, then it continues to use the last element. You could imagine it like the stack was padded with each input in order and an infinite number of the last element.

@LuisMendo Ln¹%ê is equivalent here. s.

APL (Dyalog Unicode), 6 bytes
∪⊢|⍳×⍳

Try it online!
Explanation:
∪⊢|⍳×⍳
   ⍳×⍳    ⍝ square every number in range from 1 to ⍵
 ⊢|       ⍝ modulo ⍵
∪         ⍝ unique elements

2*⍨⍳ → ⍳×⍳ for -1 byte.

Pyth, 6 bytes
{%RQ*R

Try it online
How it works
{%RQ*RdQ    implicit variables
       Q    autoinitialized to eval(input())
    *R      over [0, …, Q-1], map d ↦ d times
      d         d
 %R         map d ↦ d modulo
   Q            Q
{           deduplicate

Japt, 7 6 bytes
Ç²%UÃâ

Test it
1 byte saved thanks to Oliver

Explanation
Implicit input of integer U.
Ç   Ã

Create an array of integers from 0 to U-1, inclusive and pass each though a function.
²

Square.
%U

Modulo U.
â

Get all unique elements in the array and implicitly output the result.

I don't think the range needs to be inclusive. Ç²%UÃâ seems to work just fine.

Python 3, 40 39 37 bytes
-1 byte thanks to Mr. Xcoder. -2 bytes thanks to Business Cat.
lambda m:[*{n*n%m for n in range(m)}]

Try it online!

Can't you replace n**2 with n*n?

Yup, always forget that. >< Thanks!

Also, just range(m) is sufficient

You can use sets for 34 bytes

Brachylog, 10 9 bytes
>ℕ^₂;?%≜ᶠ

Try it online!
Explanation
       ≜ᶠ       Find all numbers satisfying those constraints:
    ;?%           It must be the result of X mod Input where X…
  ^₂              …is a square…
>ℕ                …of an integer in [0, …, Input - 1]

I was about to suggest {>≜^₂;?%}ᵘ as an alternative...then I realized there are negative numbers too. >_<

@EriktheOutgolfer Once a commit gets pulled to TIO, I can actually reduce this answer to 9 bytes indeed using ≜.

OK...how would it work when there are negative numbers too? Would it simply ignore them or something?

@EriktheOutgolfer mod can be defined as remainder of division, which would be positive (the quotient takes the sign). EDIT: also, squares are positive.

@jaxad0127 I don't think that's the case here, since > would still account for negative numbers afaik.

@EriktheOutgolfer See edit

@Fatalize You used ≜ so that you can save over {}...seems legit.

C#, 63 bytes
using System.Linq;m=>new int[m].Select((_,n)=>n*n%m).Distinct()

Try it online!

JavaScript (ES6), 52 bytes
f=(m,k=m,x={})=>k?f(x[k*k%m]=m,k-1,x):Object.keys(x)

Test cases

f=(m,k=m,x={})=>k?f(x[k*k%m]=m,k-1,x):Object.keys(x)

;[1, 2, 10, 16, 31, 120]
.map(m => console.log(m + ' -> ' + f(m)))

Non-recursive version, 60 58 bytes
Saved 2 bytes thanks to @ThePirateBay
m=>(a=[...Array(m).keys()]).filter(v=>a.some(n=>n*n%m==v))

Test cases

let f =

m=>(a=[...Array(m).keys()]).filter(v=>a.some(n=>n*n%m==v))

;[1, 2, 10, 16, 31, 120]
.map(m => console.log(m + ' -> ' + f(m)))

Non-recursive 58 bytes: m=>(a=[...Array(m).keys()]).filter(v=>a.some(n=>n*n%m==v))

@ThePirateBay Good catch. Thanks.

MATL, 6 5 bytes
-1 byte thanks to @LuisMendo
:UG\u

Try it online!

Thanks! I looked through the doc searching for that function but wasn't able to find it.

BTW this interpreter created by Suever has documentation search, you may find it useful

Actually, 11 bytes
;╗r⌠²╜@%⌡M╔

Try it online!
Explanation:
;╗r⌠²╜@%⌡M╔
;╗           store a copy of m in register 0
  r          range(m)
   ⌠²╜@%⌡M   for n in range:
    ²          n**2
     ╜@%       mod m
          ╔  remove duplicates

Haskell, 45 bytes
import Data.List
f m=nub[n^2`mod`m|n<-[0..m]]

-4 bytes from Anders Kaseorg
Try it online!

Sadly point-free version f m=nub$map((\mod`m).(^2))[0..m]` is just as long, unless there is a sneaky syntax to get rid of extra parentheses.

CJam, 12 bytes
{_,_.*\f%_&}

Anonymous block accepting a number and returning a list.
Try it online!
Explanation
_,          Copy n and get the range [0 .. n-1]
  _.*       Multiply each element by itself (square each)
     \f%    Mod each by n
        _&  Deduplicate

Nice! I had {:X{_*X%}%_&} for 13 bytes

AWK, 44 43 40 bytes
{for(;i++<$0;)if(!a[j=i*i%$0]++)print j}

I managed to cut off 3 bytes after revisiting this old answer.
Step by step:
{
for(;i++<$0;)        For all numbers less of equal to the input...

if(!a[j=i*i%$0]++)   Increments the element j of the array a.
                     j is the last digit of each i*i.
                     If the element a[j] is being incremented
                     for the first time (a[j]++ returns 0,
                     so negating it (!a[j]++) returns 1)...

print j              Prints j.
}

Try it online!
Former answer (43 bytes)
{for(;i++<$0;)a[i*i%$0];for(j in a)print j}

Edit: Incrementing the i variable during the for condition saved one more byte.
Step by step:
{
for(;               # starts the loop with no previous statement.
    i++<$0;)        # loops while _i_ is less than the input ($0).
                    # also increments 1 to the _i_ variable after
                    # it is evaluated.

    a[i*i%$0];      # fiat the _i*i%$0_ element of the _a_ array!
                    # by only stating _array[element]_, the element exists.
                    # i*i%$0 means: i squared (mod $0), i.e., the last digit.

for(j in a)         # for every element _j_ existing in the _a_ array,
    print j         # prints the element _j_
}

Try it online!

Perl 6, 19 bytes
{set (^$_)»²X%$_}

Test it
Expanded:
{ # bare block lambda with implicit param ｢$_｣

  set        # turn the following into a Set (shorter than ｢unique｣)

      (
        ^$_  # a Range upto (and excluding) ｢$_｣
      )»²    # square each of them (possibly in parallel)

    X%       # cross modulus the squared values by

      $_     # the input
}

Scala, 32 30 bytes
Simple use of the easy tip from OP.
(0 to n-1).map(x=>x*x%n).toSet

Try it online!
-2 bytes thanks to @MrXcoder, with priorities (no need for () around * operation)
Wondering: is this possible to implicitly tell the compiler to understand things like (0 to n-1)map(x=>x*x%n)toSet (without having to import scala.language.postfixOps)?

(0 to n-1).map(x=>x*x%n).toSet for 30 bytes. Exponentiation has higher precedence than modulo.

@Mr.Xcoder ooh~ thanks :)

Octave, 27 bytes
@(n)unique(mod((1:n).^2,n))

Try it online!

Mathematica, 30 bytes
Union@Table[Mod[i^2,#],{i,#}]&

Try it online!

JavaScript (ES6), 48 bytes

f=
n=>[...new Set([...Array(n)].map((_,i)=>i*i%n))]
<input type=number min=0 oninput=o.textContent=f(+this.value)><pre id=o>

43 bytes if returning a Set instead of an array is acceptable.

Ruby, 31 30 bytes
->m{(0..m).map{|n|n*n%m}.uniq}

Try it online!

Haskell, 44 bytes
f m=[k|k<-[0..m],or[mod(n^2)m==k|n<-[0..m]]]

Try it online!

Whispers v2, 71 bytes
> Input
>> [1)
>> L²
>> L%1
>> Each 3 2
>> Each 4 5
>> {6}
>> Output 7

Try it online!
The TIO Footer simply sorts the output, remove it to see the unsorted set.

K (ngn/k), 11 10 bytes
{?x!*/&=x}

Try it online!

&=x generate a list containing (0..x; 0..x)
*/ multiply the two items of the list together
x! mod the result by x
? (implicitly) return the distinct last digits

Vyxal, 5 bytes
ɾ²$%U

Try it Online!
ɾ     # 1...n
 ²    # Each squared
   %  # Modulo...
  $   # input
    U # Uniquify the result

Nibbles, 5 bytes
`$.,$%^$~@

Attempt This Online!
`$ Deduplicate
.   map
,    range
$     input
%    mod
^     power
$      it
~      2
@     input

Thunno 2, 4 bytes
L²ŒU

Try it online!
Explanation
L²ŒU  # Implicit input
L     # Push [0..input)
 ²    # Square each value
  Œ   # Mod by input
   U  # Uniquify
      # Implicit output

Pyth, 13 bytes
VQ aY.^N2Q){Y

Try online.
Lame attempt at explaining:
VQ               for N in [0 .. input-1]
                   blank space to supress implicit print inside the loop
     .^N2Q         N ^ 2 % input
   aY              append that to Y, which is initially an empty list
          )      end for
           {Y    deduplicate and implicit print

To sort the output, insert an S on any side of the {
I think there should be a shorter way...

Yeah, the functional style of Pyth tends to be much more concise. map is your friend!

Python 2, 59 bytes
t=int(input())
print list(set([(i*i)%t for i in range(t)]))

Try it online!

PowerShell, 35 bytes
0..($n="$args")|%{$_*$_%$n}|sort -u

Try it online!

R, 28 bytes
unique((1:(n<-scan()))^2%%n)

Try it online!

Retina, 70 bytes
.+
$*

;$`¶$`
1(?=.*;(.*))|;1*
$1
(1+)(?=((.*¶)+\1)?$)

D`1*¶
^|1+
$.&

Try it online! Warning: Slow for large inputs. Slightly faster 72-byte version:
.+
$*

$'¶$';
1(?=.*;(.*))|;1*
$1
+s`^((1+)¶.*)\2
$1
^1+

D`1*¶
^|1+
$.&

Try it online!

Clojure, 40 bytes
#(set(map(fn[x](mod(* x x)%))(range %)))

8th, 138 131 bytes
Code
[] swap dup >r ( 2 ^ r@ n:mod a:push ) 1 rot loop rdrop ' n:cmp a:sort ' n:cmp >r -1 a:@ swap ( tuck r@ w:exec ) a:filter rdrop nip

Explanation
[] - Create output array
swap dup >r - Save input for later use
( 2 ^ r@ n:mod a:push ) 1 rot loop - Compute square end
rdrop - Clean r-stack
' n:cmp a:sort - Sort output array
' n:cmp >r -1 a:@ swap ( tuck r@ w:exec ) a:filter rdrop nip - Get rid of consecutive duplicates from array
SED (Stack Effect Diagram) is: a -- a
Usage and example
: f [] swap dup >r ( 2 n:^ r@ n:mod a:push ) 1 rot loop rdrop ' n:cmp a:sort ' n:cmp >r -1 a:@ swap ( tuck r@ w:exec ) a:filter rdrop nip ;

ok> 120 f .
[0,1,4,9,16,24,25,36,40,49,60,64,76,81,84,96,100,105]

Java (OpenJDK 8), 86 77 bytes
n->java.util.stream.IntStream.range(1,n+1).map(a->a*a%n).distinct().toArray()

Try it online!

Check your byte count, and you can save by using java.util.stream.IntStream instead of the import.

PHP, 53 bytes
for(;$i<$t=$argv[1];)$a[$z=$i++**2%$t]++?:print"$z
";

Loop from 0 to the input number, using the n^2 mod base formula to mark numbers that have been used. It goes to that position in an array, checking if it's been incremented and outputting it if it hasn't. It then increments it afterwards so duplicate values don't get printed.
Try it online!

Perl 5 -MList::Util=uniq -na, 32 bytes
say for uniq map$_**2%"@F",0..$_

Try it online!

Pari/GP, 25 bytes
n->Set([x^2%n|x<-[1..n]])

Try it online!

Prolog (SWI), 49 bytes
N+X:-setof(K,A^(between(0,N,A),K is A^2mod N),X).

Try it online!
Creates a set of values from K=(A^2)%N, where 0<=A<=N.

JavaScript, 45 bytes
n=>(g=x=>x?g(g[x*x%n]=x-1):Object.keys(g))(n)

Try it online!
40 bytes
With output as an array that could contain multiple empty items.
n=>(g=x=>x?g(x-1,a[y=x*x%n]=y):a)(a=[n])

Try it online!

Pyt, 7 bytes
Đř²⇹%Ụş

Try it online!
Đ            implicit input (n); Đuplicate on stack
 ř           řangify (push [1,2,...,n])
  ²          square
   ⇹%        modulo n
     Ụş      get Ụnique elements and şort in ascending order; implicit print

Thunno D, \$ 6 \log_{256}(96) \approx \$ 4.94 bytes
R2^$ZU

Attempt This Online!
Thunno, \$ 7 \log_{256}(96) \approx \$ 5.76 bytes
DR2^$ZU

Attempt This Online!
Explanation
DR2^$ZU  # Implicit input
DR       # Duplicate and get range(input)
  2^     # Square each number
    $    # Mod by the input
     ZU  # Uniquify
         # Implicit output

J, 10 bytes
~.@:|2^~i.

Attempt This Online!
~.@:|2^~i.
        i.  NB. range [0..n)
     2^~    NB. square
  @:        NB. then
~.          NB. uniquify

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Listify a number
Given a real number, convert it to a list of lists, with the negative sign (if any) becoming an empty list, the integer part becoming a list of digits, and the fractional part (if any) becoming a list of digits. The digits must be actual numbers, not strings.
Examples
0 → [[0]]
123 → [[1,2,3]]
-123 → [[],[1,2,3]]
123.45 → [[1,2,3],[4,5]]
0.45 → [[0],[4,5]]
-0.45 → [[],[0],[4,5]]
-123.45 → [[],[1,2,3],[4,5]]

are the digits in the array allowed to be single-char strings?

@dzaima No. I'll add that.

can the number be taken as a string?

@Uriel If you get input from STDIN then yes (there is no difference). If as argument, no, I think. Whatever Meta consensus is.

If the whole part is zero can we use an empty list?

@WheatWizard No, that would create an ambiguity between 0.45 and -45.

Will there be input such as .45 or -.45?

@StepHen The input will be a number in whatever format your language uses (for results).

Out of curiosity, is there any context or motivation to this question?

@Quelklef Yes, in fact. It was the result of a long design discussion you can see here about the l (listify) command of totallyhuman's WIP language, Intrnt.

C#, 60 66 bytes
using System.Linq;s=>s.Split('-','.').Select(p=>p.Select(c=>c-48))

Try it online!

There are no visible outer brackets. Are your results actually lists?

@Adám Yeah (IEnumerable<char[]>) it's just the printing code doesn't add them in.

@TheLethalCoder The requirements state that the required return type is a list of digits as numbers, not strings or chars which display those numbers.

@KamilDrakari Oh didn't see the spec had been updated...

@KamilDrakari Fixed, thanks for letting me know about the update.

JavaScript (ES6), 33 44 43 41 bytes
Takes input as a string. Sacrificed 11 10 bytes converting the elements in the output to numbers after the challenge spec was updated.
s=>s.split(/\D/).map(a=>[...a].map(eval))

Saved a byte thanks to Arnauld's suggestion of using  eval.

Test it

console.log((
s=>s.split(/\D/).map(a=>[...a].map(eval))
)("-123.45"))

Explanation
s=>

Anonymous function taking the string as an argument via parameter s."-123.45"
s.split(/\D/)

Use RegEx to split the string to an array on all non-digit characters - i.e., - and .["","123","45"]
.map(a=>)

Map over the array, passing each string to a function via parameter a.
[...a]

Split to an array of individual character strings.[[],["1","2","3"],["4","5"]]
.map(eval)

Map over the subarray and eval each string, which converts it to an integer.[[],[1,2,3],[4,5]]

2D array of strings? How does the JSON look?

Digits must be numbers.

@Adám: Updated, at a cost of 11 bytes.

Jelly,  13  10 bytes
ŒṘµ<”/œpV€

A monadic link taking a number and returning the resulting list of lists of numbers.
Try it online! (the footer just prints the python representation to show all the actual lists)
...or see the test suite.
How?
ŒṘµ<”/œpV€ - Link: number
ŒṘ         - Python representation (yields a string representation of the number)
  µ        - monadic chain separation (call that s)
    ”/     - literal '/' character
   <       - less than? (vectorises) ('.' and '-' are, digit characters are not)
      œp   - partition s at truthy indexes of the resulting list discarding the borders
        V€ - evaluate €ach (list of characters) as Jelly code (vectorises)

And again Jelly is better than 05AB1E!

Python 2, 58 bytes
lambda x:[map(int,i)for i in`x`.replace(*'-.').split('.')]

Try it online!

05AB1E, 12 11 bytes
Thanks to Riley for saving a byte. Code:
'-'.:'.¡εSï

Uses the 05AB1E encoding. Try it online!
Explanation:
'-'.:            # Replace "-" by "."
     '.¡         # Split on "."
        ε        # Apply to each element..
         S       #   Split into a list of characters
          ï      #   Convert back to int

Do you technically need the ï?

@MagicOctopusUrn OP said The digits must be actual numbers, not strings.

That's a shame, I was thinking: „-.S€¡ for 6, but if they have to be ints... unsure.

Python 2, 59 bytes
lambda a:[[]]*(a<0)+[map(int,n)for n in`abs(a)`.split('.')]

Try it online!
-5 bytes from Felipe Nardi Batista

in your third output [[[1, 2, 3], [4, 5]]] there is an extra outer list

fixed and still uses 64 bytes link

you can get to 59 bytes if you change your outer map with list comprehension: link

Actually, 23 bytes
'.@;)A$s⌠♂≈⌡M[[]]+@s~@t

Try it online!
Explanation:
'.@;)A$s⌠♂≈⌡M[[]]+@s~@t
'.                       push "."
  @;)                    make a copy of the input and move it to the bottom of the stack
     A$s                 absolute value of input, stringify, split on periods
        ⌠♂≈⌡M            convert integer and fractional parts to lists of digits
             [[]]+       prepend an empty list
                  @s~    bitwise negation of sign of input (1 -> -2, 0 -> -1, -1 -> 0)
                     @t  elements in the list starting at that 0-based index (drops the leading empty list if the input was positive)

SOGL V0.12, 11 bytes
Ζ-.ŗ .Θ⌡č¹r

Try it Here!
Outputs to the top of the stack (because SOGL converts it to a multiline string because it is made for ascii-art). To view the result, look in the console after  `r`@10: (the outer brackets are the stack arrays) or just append οø∑ after the code
Ζ-.ŗ         replace "-" with "."
     .Θ      split on "."s
       ⌡     for each
        č      chop into characters (casts to strings :/)
         ¹   wrap in array (this + for each is like map())
          r  reverse types, vectorizing

Japt (v2.0a0), 12 10 8 bytes
Takes input as a string.
q\D ®¬®n

Test it (-Q flag for visualisation purposes only.)

2 bytes saved thanks to Justin.
2 bytes saved thanks to ETH.

Explanation
Implicit input of string U.
q\D

Use RegEx to split (q) to an array on all non-digit characters.
®

Map over the array.
¬

Split each string to an array of individual characters.
®

Map over the array.
n

Convert to integer.

Couldn't you split on \D, since the only non-digits will be . and -?

The best part is, you don't even need the /s :-)

@ETHproductions: Now, that's pretty sweet. I thought I might have been able to omit the closing / by going multiline. I never considered trying to omit both of them.

Perl 6, 23 bytes
+«*.split(/\D/)».comb

Test it
Expanded
+«\            # numify each of the following (possibly in parallel)
*\             # WhateverCode lambda (this is the input)
.split(/\D/)\  # split on non-digits ( . and - )
».comb         # split each of those into individual characters

Note that …».comb is a higher precedence than +«…

Octave, 54 bytes
@(x)cellfun(@(c){c-48},strsplit(num2str(x),{'-' '.'}))

Anonymous function that takes a number as input and produces a cell array of numeric vectors.
Try it online!
Explanation
@(x)cellfun(@(c){c-48},strsplit(num2str(x),{'-' '.'}))

@(x)                                                    % Function with input x
                                num2str(x)              % Convert x to string
                       strsplit(          ,{'-' '.'})   % Split at '-' or '.'. Gives a
                                                        % cell array of substrings
    cellfun(          ,                               ) % To each substring apply
                                                        % the following function
            @(c){c-48}                                  % Subtract 48 from each char
                                                        % and pack into a cell

C (gcc), 170 164 152 146 144 bytes
Should be able to golf this down a bit...
#define P printf
#define V *v[1]
main(c,v)char**v;{for(V^45?P("[[%c",V++):P("[[],[%c",V++,V++);V;V^46?P(",%c",V++):P("],[%c",V++,V++));P("]]");}

Try it online!

I think you can save a few bytes by doing #define P printf( and then omitting the parenthesis in the P calls

Jelly, 12 bytes
ŒṘ⁾-.yṣ”.V€€

Try it online!

Yeah I tried that too, currently I've only got 13 (I'll post that but think it must be able to be shorter) 0.45 returns [[],[4,5] instead of [[0],[4,5]] (it collides with -45)

@JonathanAllan Oh yeah indeed...not sure where I got that? Oh wait, it's Ṿ! Fixing...ok fixed. Who would expect that Jelly parses the 0 and .45 of 0.45 separately...and have it as Ṿ output too.

Actually, 16 bytes
$'.'-(Æ'.@s⌠♂≈⌡M

Try it online!
Explanation:
$'.'-(Æ'.@s⌠♂≈⌡M Implicit eval'd input
$                Convert to str
 '.              Push '.'
   '-            Push '-'
     (           Rotate stack left
      Æ          Pop a, b, c; push c.replace(b, a)
       '.        Push '.'
         @       Pop a, b; push b, a (swap)
          ⌠♂≈⌡   Push function ♂≈
           ♂       Map
            ≈        Convert to int
              M  Map

Outgolfed the creator, nice.

@Zacharý It's just a matter of algorithm choice.

And it's Mego you beat, not Dennis of course :)

@Zacharý Well, twice in this challenge to be fair...

Perl 5, 56 54 + 1 (-p) = 55 bytes
$_="[[$_]]";s/\D\K\./0./;s/\d(?=\d)/$&,/g;s/-|\./],[/g

Try it online!
Saved two bytes due to Dom reminding me about $&
Explanation:
$_="[[$_]]";        # Add opening and closing to ends of strings
s/\D\K\./0./;       # handle the case of .45 or -.45 by inserting 0 before
                    # the decimal.  Otherwise, .45 & 45 would be ambiguous.
s/\d(?=\d)/$&,/g;   # Put a comma between numbers.
s/-|\./],[/g        # Turn - and . into separators between lists

Had a little play with this and found breaking it down to be a bit shorter. Not sure if you can combine it based on mine to shrink yours down?  Try it online!

Used $& from yours.  I think the two are basically equivalent now, except that mine handles the ".45" vs. "45" case.

Ahhh, yeah, missed that one!

R, 51 47 72 bytes
x=RG::s(strtoi(s(gsub('-','.',scan()),on='\\.')))
x[is.na(x)]=list(NULL)

I'm loving the RG library.
Had to add 26 bytes to make sure the empty list was actually empty.
               gsub('-','.',scan())             # replace - with . in input; also converts to string
             s(                    ,on='\\.')   # split string on '.'
      strtoi(                                )  # convert to numeric
RG::s(                                        ) # convert to lists of digits

    x[is.na(x)]=list(NULL)                      # converts list of `NA` to empty list

Example output:
> x=RG::s(strtoi(s(gsub('-','.',-123.45),on='\\.')))
> x[is.na(x)]=list(NULL)
> x
[[1]]
NULL

[[2]]
[1] 1 2 3

[[3]]
[1] 4 5

well, there's numeric(0) for an empty numeric list or list() or NULL?

I tacked on a fix to make it NULL but now I'm sure there's a golfier way to do it. Maybe I'll come back to it.

RUBY, 75 bytes
->(x){(x<0?[[]]:[])+x.abs.to_s.split('.').map{|y|y.chars.map{|z|z.to_i}}}

Try it online!

Can you remove all that whitespace?

Yep, you're right, done!

The same with some syntax tweaks: Try it online! (BTW, if you use Header and Footer on TIO the size displayed on the right side of Code will be the actual size of the solution.)

Fixed, thanks for all the infos.

You can swap .map{z|z.to_i} for .map &:to_i

Python 2, 59 bytes
lambda x:(x<0)*[[]]+[map(int,i)for i in`abs(x)`.split('.')]

Try it online!

CJam, 13 bytes
r'-'.er'./::~

Try it online!

Pyth, 12 bytes
sMMcXz\-\.\.

Try it here.

Perl 6, 22 bytes
{m:g/^\d*|\d+/».comb}

Try it online!
The elements in the returned list are strings, but as is normal for Perl, they can be used as numbers and will be converted implicitly; they are "actual numbers" for all practical purposes.  To force them to be numbers in their most immediate representation, one need only prefix the contents of the code block with "+«" for three more bytes.

The challenge specifically states “The digits must be actual numbers, not strings.”, so the +« should probably be included.