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.

A097602 a(n+1) = a(n) + number of squares so far; a(1) = 1.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 19, 22, 25, 29, 33, 37, 41, 45, 49, 54, 59, 64, 70, 76, 82, 88, 94, 100, 107, 114, 121, 129, 137, 145, 153, 161, 169, 178, 187, 196, 206, 216, 226, 236, 246, 256, 267, 278, 289, 301, 313, 325, 337, 349, 361, 374, 387, 400, 414, 428
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 30 2004

Keywords

Comments

Conjecture: a(n) = m^2 iff m mod 3 > 0.
a(n) is a square iff n is congruent to {1, 4} mod 9. - Vladeta Jovovic, Aug 30 2004

Examples

			a(2) = a(1) + #{1} = 1 + 1 = 2;
a(3) = a(2) + #{1} = 2 + 1 = 3;
a(4) = a(3) + #{1} = 3 + 1 = 4;
a(5) = a(4) + #{1,4} = 4 + 2 = 6;
a(6) = a(5) + #{1,4} = 6 + 2 = 8;
a(7) = a(6) + #{1,4} = 8 + 2 = 10;
a(8) = a(7) + #{1,4} = 10 + 2 = 12;
a(9) = a(8) + #{1,4} = 12 + 2 = 14;
a(10) = a(9) + #{1,4} = 14 + 2 = 16;
a(11) = a(10) + #{1,4,16} = 16 + 3 = 19;
a(12) = a(11) + #{1,4,16} = 19 + 3 = 22.
		

Crossrefs

Programs

  • GAP
    a:=[1,2,3,4,6,8,10,12,14,16,19];; for n in [12..70] do a[n]:= 2*a[n-1]-a[n-2]+a[n-9]-2*a[n-10]+a[n-11]; od; a; # G. C. Greubel, Jan 14 2019
  • Haskell
    a097602 n = a097602_list !! (n-1)
    a097602_list = 1 : f 1 1 where
       f x c = y : f y (c + a010052 y) where y = x + c
    -- Reinhard Zumkeller, Nov 15 2011
    
  • Magma
    m:=70; R:=PowerSeriesRing(Integers(), m); Coefficients(R!( x*(1+x^4-x^9+x^10)/((1+x+x^2)*(1+x^3+x^6)*(1-x)^3) )); // G. C. Greubel, Jan 14 2019
    
  • Mathematica
    LinearRecurrence[{2,-1,0,0,0,0,0,0,1,-2,1}, {1,2,3,4,6,8,10,12,14,16,19}, 70] (* G. C. Greubel, Jan 14 2019 *)
  • PARI
    my(x='x+O('x^70)); Vec(x*(1+x^4-x^9+x^10)/((1+x+x^2)*(1+x^3+x^6)*(1-x)^3)) \\ G. C. Greubel, Jan 14 2019
    
  • Sage
    a=(x*(1+x^4-x^9+x^10)/((1+x+x^2)*(1+x^3+x^6)*(1-x)^3)).series(x, 70).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Jan 14 2019
    

Formula

a(9*n+1) = (3*n+1)^2; a(9*n+4) = (3*n+2)^2. - Vladeta Jovovic, Aug 30 2004
G.f.: x*(1+x^4-x^9+x^10)/((1+x+x^2)*(1+x^3+x^6)*(1-x)^3). - Vladeta Jovovic, Aug 30 2004
a(n+1) = a(n) + Sum_{k=1..n} A010052(a(k)). - Reinhard Zumkeller, Nov 15 2011