OFFSET
1,2
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
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (2,-1,0,0,0,0,0,0,1,-2,1).
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
EXAMPLE
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.
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 *)
PROG
(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
(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
(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
(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
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Aug 30 2004
STATUS
approved