login
A109595
n^3 followed by n^2 followed by n.
1
1, 1, 1, 8, 4, 2, 27, 9, 3, 64, 16, 4, 125, 25, 5, 216, 36, 6, 343, 49, 7, 512, 64, 8, 729, 81, 9, 1000, 100, 10, 1331, 121, 11, 1728, 144, 12, 2197, 169, 13, 2744, 196, 14, 3375, 225, 15, 4096, 256, 16, 4913, 289, 17, 5832, 324, 18, 6859, 361, 19, 8000, 400, 20
OFFSET
1,4
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