OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,6,0,0,0,0,1,0,0,0,0,-6).
FORMULA
G.f.: (1+2*x+3*x^2+4*x^3+5*x^4+4*x^5+5*x^6+1*x^8+2*x^9)*x / (1-6*x^5-1*x^10+6*x^15). - Alois P. Heinz, Feb 25 2011
a(n) = 6*a(n-5)+a(n-10)-6*a(n-15) for n>15. - Colin Barker, Jun 01 2015
MAPLE
a:= proc(n) local c, d, i, m; c, d:= 0, 1+irem(n-1, 5, 'm'); for i to m+1 do c:= 6*c +d; d:= d +`if`(d<3, 3, -3) od; c end:
seq(a(n), n=1..50); # Alois P. Heinz, Feb 26 2011
MATHEMATICA
Join[Range[5], Select[Range[52*10^5], Union[Abs[Differences[ IntegerDigits[ #, 6]]]] == {3}&]] (* Harvey P. Dale, Oct 25 2020 *)
PROG
(PARI) Vec((1+2*x+3*x^2+4*x^3+5*x^4+4*x^5+5*x^6+1*x^8+2*x^9)*x/ (1-6*x^5-1*x^10+6*x^15) + O(x^100)) \\ Colin Barker, Jun 01 2015
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved
