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”).
%I #21 Sep 08 2022 08:45:14
%S 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,
%T 88,94,100,107,114,121,129,137,145,153,161,169,178,187,196,206,216,
%U 226,236,246,256,267,278,289,301,313,325,337,349,361,374,387,400,414,428
%N a(n+1) = a(n) + number of squares so far; a(1) = 1.
%C Conjecture: a(n) = m^2 iff m mod 3 > 0.
%C a(n) is a square iff n is congruent to {1, 4} mod 9. - _Vladeta Jovovic_, Aug 30 2004
%H Reinhard Zumkeller, <a href="/A097602/b097602.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Rec#order_11">Index entries for linear recurrences with constant coefficients</a>, signature (2,-1,0,0,0,0,0,0,1,-2,1).
%F a(9*n+1) = (3*n+1)^2; a(9*n+4) = (3*n+2)^2. - _Vladeta Jovovic_, Aug 30 2004
%F 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
%F a(n+1) = a(n) + Sum_{k=1..n} A010052(a(k)). - _Reinhard Zumkeller_, Nov 15 2011
%e a(2) = a(1) + #{1} = 1 + 1 = 2;
%e a(3) = a(2) + #{1} = 2 + 1 = 3;
%e a(4) = a(3) + #{1} = 3 + 1 = 4;
%e a(5) = a(4) + #{1,4} = 4 + 2 = 6;
%e a(6) = a(5) + #{1,4} = 6 + 2 = 8;
%e a(7) = a(6) + #{1,4} = 8 + 2 = 10;
%e a(8) = a(7) + #{1,4} = 10 + 2 = 12;
%e a(9) = a(8) + #{1,4} = 12 + 2 = 14;
%e a(10) = a(9) + #{1,4} = 14 + 2 = 16;
%e a(11) = a(10) + #{1,4,16} = 16 + 3 = 19;
%e a(12) = a(11) + #{1,4,16} = 19 + 3 = 22.
%t 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 *)
%o (Haskell)
%o a097602 n = a097602_list !! (n-1)
%o a097602_list = 1 : f 1 1 where
%o f x c = y : f y (c + a010052 y) where y = x + c
%o -- _Reinhard Zumkeller_, Nov 15 2011
%o (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
%o (Magma) m:=70; R<x>:=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
%o (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
%o (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
%Y Cf. A101135, A096777, A131073.
%K nonn
%O 1,2
%A _Reinhard Zumkeller_, Aug 30 2004