OFFSET
0,3
LINKS
Jeremy Gardiner, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,2,0,0,0,0,0,-1).
FORMULA
a(n) = 2*a(n-6) - a(n-12). - G. C. Greubel, Oct 26 2017 [corrected by Georg Fischer, Mar 12 2020]
a(n) = floor(n/6) + sign(n mod 6) * (n - floor(n/6)). - Wesley Ivan Hurt, Oct 28 2017
EXAMPLE
a(36) = 36/6 = 6.
MATHEMATICA
Table[If[Mod[n, 6] == 0, n/6, n], {n, 0, 50}] (* G. C. Greubel, Oct 26 2017 *)
PROG
(PARI) a(n)=if(n%6, n, n/6) \\ G. C. Greubel, Oct 26 2017
(PARI) first(n) = my(res = vector(n, i, i-1)); forstep(i = 1, n, 6, res[i] \= 6); res \\ David A. Corneth, Oct 28 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jeremy Gardiner, Jul 15 2012
STATUS
approved