login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A080883
Distance of n to next square.
10
1, 3, 2, 1, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 19, 18, 17, 16, 15, 14, 13
OFFSET
0,2
COMMENTS
The following sequences all have the same parity: A004737, A006590, A027052, A071028, A071797, A078358, A078446, A080883. - Jeremy Gardiner, Dec 30 2006
LINKS
FORMULA
a(n) = floor( sqrt(n)+1 )^2 - n.
MAPLE
A080883 := proc(n) (floor(sqrt(n)+1))^2 -n ; end: seq( A080883(n), n=0..40) ; # R. J. Mathar, Aug 08 2009
MATHEMATICA
Table[Floor[1+Sqrt[n]]^2 -n, {n, 0, 90}] (* G. C. Greubel, Nov 07 2019 *)
PROG
(PARI) a(n) = (sqrtint(n)+1)^2-n; \\ Michel Marcus, May 22 2024
(Magma) [Floor(1+Sqrt(n))^2 -n: n in [0..90]]; // G. C. Greubel, Nov 07 2019
(Sage) [floor(1+sqrt(n))^2 -n for n in (0..90)] # G. C. Greubel, Nov 07 2019
(GAP) List([0..90], n-> Int(1+RootInt(n))^2 -n); # G. C. Greubel, Nov 07 2019
CROSSREFS
Cf. A075555.
Cf. A066635, A053188. - R. J. Mathar, Aug 08 2009
Sequence in context: A309219 A019587 A102427 * A021315 A337315 A068389
KEYWORD
nonn,easy
AUTHOR
Ralf Stephan, Mar 29 2003
STATUS
approved