OFFSET
0,6
COMMENTS
Three arithmetic progressions interlaced: a(1)=1,2,0 and d=a(n+1)-a(n)=1,2,0. Cf. A115274(n) = n+a(n), n=1,2,3,...
FORMULA
a(3k+1) = k, a(3k+2) = 2k, a(3k+3) = 0, k=1, 2, ...
G.f.: x^4*(2*x+1) / ((x-1)^2*(x^2+x+1)^2). - Colin Barker, May 11 2015
MATHEMATICA
Table[Floor[n/3]*Mod[n, 3], {n, 0, 104}] \\ Extended to offset 0 by M. F. Hasler, May 11 2015
PROG
(PARI) a(n, b=3)=(n=divrem(n, b))[1]*n[2] \\ M. F. Hasler, May 10 2015
(Magma) [Floor(n/3)*(n mod 3): n in [0..100]]; // Vincenzo Librandi, May 11 2015
(Python)
from math import prod
def A115273(n): return prod(divmod(n, 3)) # Chai Wah Wu, Jan 19 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Jan 18 2006
EXTENSIONS
a(0)-a(3) and cross-references added by M. F. Hasler, May 11 2015
STATUS
approved