OFFSET
1,2
COMMENTS
a(k)^k+1==0 (mod 3) for k of the form 3*(2*j+1); for other forms of k, a(k)^k-1==0 (mod 3). - Bruno Berselli, Oct 29 2010
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
G.f.: x*(1+3*x+14*x^2+3*x^3+x^4)/((1-x)^3*(1+x)^2). - Alexander R. Povolotsky, Oct 21 2010
a(n) = (22*n*(n-1) - 5*(2*n-1)*(-1)^n + 3)/8.
a(n) = a(n-1) +2*a(n-2) -2*a(n-3) -a(n-4) +a(n-5) for n>5, a(1)=1, a(2)=4, a(3)=20, a(4)=29, a(5)=61.
Sum_{i=1..n} a(i) = n*(22*n^2-15*(-1)^n-13)/24.
MATHEMATICA
Sort[Flatten[ Table[{((7 + 11 k)^2 - 5)/11, ((4 + 11 k)^2 - 5)/11}, {k, 0, 20, 1}]]]
Select[Range[7000], IntegerQ[Sqrt[11#+5]]&] (* Harvey P. Dale, Nov 21 2014 *)
PROG
(Magma) &cat[ [((4+11*k)^2-5)/11, ((7+11*k)^2-5)/11] : k in [0..23] ]; // Klaus Brockhaus, Oct 20 2010
(PARI) x='x+O('x^50); Vec(x*(1+3*x+14*x^2+3*x^3+x^4)/((1-x)^3*(1+x)^2)) \\ G. C. Greubel, Feb 25 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jon Perry, Oct 20 2010
EXTENSIONS
Formulas and more terms from Klaus Brockhaus and Bruno Berselli, Oct 20 2010
Sum added and superfluous formula removed by Bruno Berselli, Oct 22 2010 - Nov 15 2010
STATUS
approved