OFFSET
1,2
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,4,0,0,1,0,0,-4).
FORMULA
G.f.: x*(x^5+3*x^3+3*x^2+2*x+1) / (4*x^9-x^6-4*x^3+1). - Colin Barker, May 31 2015
a(n) = 4*a(n-3) + a(n-6) - 4*a(n-9) for n > 9. - Colin Barker, Jun 01 2015
MAPLE
a:= proc(n) option remember; `if`(n<1, 0,
a(n-3)*4 +[1, 2, 3, 3, 0, 1][1+irem(n-1, 6)])
end:
seq(a(n), n=1..50); # Alois P. Heinz, May 31 2015
MATHEMATICA
Join[{1, 2, 3}, Select[Range[230000], Union[Abs[Differences[ IntegerDigits[ #, 4]]]]=={2}&]] (* Harvey P. Dale, Sep 20 2011 *)
PROG
(PARI) Vec(x*(x^5+3*x^3+3*x^2+2*x+1)/(4*x^9-x^6-4*x^3+1) + O(x^100)) \\ Colin Barker, Jun 01 2015
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved