OFFSET
1,4
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,0,4,0,0,-6,0,0,4,0,0,-1).
FORMULA
a(n) = floor((n+2)/3)^((-3*(n mod 3)^2+7*(n mod 3)+2)/2). - Luce ETIENNE, Mar 01 2018
From Elmo R. Oliveira, Jul 01 2026: (Start)
a(n) = 4*a(n-3) - 6*a(n-6) + 4*a(n-9) - a(n-12).
G.f.: x*(1 + x + x^2 + 4*x^3 - 2*x^5 + x^6 - x^7 + x^8)/(1 - x^3)^4. (End)
MATHEMATICA
Flatten[Table[{n^3, n^2, n}, {n, 20}]] (* Harvey P. Dale, Aug 22 2014 *)
(* Alternative: *)
LinearRecurrence[{0, 0, 4, 0, 0, -6, 0, 0, 4, 0, 0, -1}, {1, 1, 1, 8, 4, 2, 27, 9, 3, 64, 16, 4}, 60] (* Harvey P. Dale, Aug 22 2014 *)
PROG
(Python)
def A109595(n): return n//3 if (m:=n%3)==0 else (n//3+1)**3 if m==1 else (n//3+1)**2 # Chai Wah Wu, Jul 01 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Mohammad K. Azarian, Aug 30 2005
STATUS
approved
