login
A111186
Difference between the closest squares surrounding nonsquare composite numbers.
0
5, 5, 7, 7, 7, 7, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 13, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19
OFFSET
1,1
FORMULA
Let k be a nonsquare composite number and r = floor(sqrt(k)). Then the closest surrounding squares of k are r^2 and (r+1)^2. So d = (r+1)^2 - r^2 = 2*r+1.
EXAMPLE
6 is the first nonsquare composite number. 2^2 and 3^2 are the closest squares surrounding 6. So the difference, 9-4 = 5, is the first entry in the table.
PROG
(PARI) surrsq(n) = { local(r, d); for(x=1, n, if(!issquare(x)&!isprime(x), r=sqrtint(x); d=r+r+1; print1(d", ") ) ) }
CROSSREFS
Cf. A089229.
Sequence in context: A231589 A133888 A244587 * A384502 A127798 A053671
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Nov 12 2005
EXTENSIONS
Name and offset corrected by Jason Yuen, Jan 06 2026
STATUS
approved