OFFSET
1,4
COMMENTS
If the offset were 0, the formula would be: a(0)=0, a(1)=1, for n>=2: a(n) = (n-1)^3 - a(n-2).
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (4,-7,8,-7,4,-1).
FORMULA
a(n) = (1/2)*((n-3)*n^2-4*cos((Pi*n)/2)+2). - _Harvey P. Dale_, Sep 14 2012
G.f.: x^2*(1 - 3*x + 10*x^2 - 3*x^3 + x^4)/((1-x)^4*(1+x^2)). - _Paul D. Hanna_, Sep 14 2012
MATHEMATICA
LinearRecurrence[{4, -7, 8, -7, 4, -1}, {0, 1, 1, 7, 26, 57}, 60]
RecurrenceTable[{a[1]==0, a[2]==1, a[n]==(n-2)^3-a[n-2]}, a, {n, 50}] (* _Harvey P. Dale_, Sep 14 2012 *)
PROG
(Python)
prpr = 0
prev = 1
for n in range(1, 77):
print(prpr, end=', ')
curr = n*n*n - prpr # a(n+1)
prpr = prev
prev = curr
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vladimir Joseph Stephan Orlovsky, Feb 08 2012
STATUS
approved