OFFSET
0,2
COMMENTS
A modified Pellian sequence.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (4,-4,0,1).
FORMULA
a(n)/a(n-1) tends to 1 + sqrt(2) = 2.414213562...(a(14)/a(13) = 430433/178287 = 2.4142702...).
a(n) = (1/2)*(Pell(n+2) + 2*Pell(n+1) - n - 2), with Pell(n) = A000129(n). - Ralf Stephan, May 15 2007
From R. J. Mathar, Aug 05 2009: (Start)
a(n) = 4*a(n-1) - 4*a(n-2) + a(n-4).
G.f.: (1-x+x^2)/((1-2*x-x^2)*(1-x)^2). (End)
EXAMPLE
a(4) = 61 = 2*(a(3)) + a(2) + 4 = 2*24 + 9 + 4.
a(4) = 61 = sum of terms in row 5 of A117584: 1 + 5 + 9 + 17 + 29.
MATHEMATICA
RecurrenceTable[{a[0]==1, a[1]==3, a[n]==2a[n-1]+a[n-2]+n}, a, {n, 30}] (* or *) LinearRecurrence[{4, -4, 0, 1}, {1, 3, 9, 24}, 30] (* Harvey P. Dale, Mar 11 2015 *)
PROG
(Magma)
P:= func< n | Round( ((1+Sqrt(2))^n - (1-Sqrt(2))^n)/(2*Sqrt(2)) ) >;
[(1/2)*(P(n+2) + 2*P(n+1) - (n+2)): n in [0..30]]; // G. C. Greubel, Jul 05 2021
(Sage)
def a(n): return (1/2)*(lucas_number1(n+2, 2, -1) + 2*lucas_number1(n+1, 2, -1) -n-2)
[a(n) for n in (0..30)] # G. C. Greubel, Jul 05 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Gary W. Adamson, Mar 29 2006
EXTENSIONS
Terms from a(20) on corrected by R. J. Mathar, Aug 05 2009
STATUS
approved