cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A080883 Distance of n to next square.

Original entry on oeis.org

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

Views

Author

Ralf Stephan, Mar 29 2003

Keywords

Comments

The following sequences all have the same parity: A004737, A006590, A027052, A071028, A071797, A078358, A078446, A080883. - Jeremy Gardiner, Dec 30 2006

Crossrefs

Cf. A075555.
Cf. A066635, A053188. - R. J. Mathar, Aug 08 2009

Programs

  • GAP
    List([0..90], n-> Int(1+RootInt(n))^2 -n); # G. C. Greubel, Nov 07 2019
  • Magma
    [Floor(1+Sqrt(n))^2 -n: n in [0..90]]; // G. C. Greubel, Nov 07 2019
    
  • 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 *)
  • PARI
    a(n) = (sqrtint(n)+1)^2-n; \\ Michel Marcus, May 22 2024
    
  • Sage
    [floor(1+sqrt(n))^2 -n for n in (0..90)] # G. C. Greubel, Nov 07 2019
    

Formula

a(n) = floor( sqrt(n)+1 )^2 - n.