OFFSET
0,2
COMMENTS
Periodic with length 3^3 = 27.
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,-1,1,0,-1,1,0,-1,1,0,-1,1,0,-1,1,0,-1,1,0,-1,1,0,-1,1).
FORMULA
a(n) = binomial(n+3,3) mod 3^2.
G.f.: (1 +3*x -3*x^2 +2*x^3 +9*x^4 -9*x^5 +3*x^6 +9*x^7 -9*x^8 +4*x^9 +12*x^10 -12*x^11 +5*x^12 +9*x^13 -9*x^14 +6*x^15 +9*x^16 -9*x^17 +7*x^18 +3*x^19 -3*x^20 +8*x^21) / ((1 -x)*(1 +x^3 +x^6)*(1 +x^9 +x^18)). - Colin Barker, Jul 19 2016
MATHEMATICA
Table[Mod[Binomial[n + 3, n], 9], {n, 0, 120}] (* or *)
CoefficientList[Series[(1 + 3 x - 3 x^2 + 2 x^3 + 9 x^4 - 9 x^5 + 3 x^6 + 9 x^7 - 9 x^8 + 4 x^9 + 12 x^10 - 12 x^11 + 5 x^12 + 9 x^13 - 9 x^14 + 6 x^15 + 9 x^16 - 9 x^17 + 7 x^18 + 3 x^19 - 3 x^20 + 8 x^21)/((1 - x) (1 + x^3 + x^6) (1 + x^9 + x^18)), {x, 0, 120}], x] (* Michael De Vlieger, Jul 19 2016 *)
PROG
(PARI) Vec((1 +3*x -3*x^2 +2*x^3 +9*x^4 -9*x^5 +3*x^6 +9*x^7 -9*x^8 +4*x^9 +12*x^10 -12*x^11 +5*x^12 +9*x^13 -9*x^14 +6*x^15 +9*x^16 -9*x^17 +7*x^18 +3*x^19 -3*x^20 +8*x^21) / ((1 -x)*(1 +x^3 +x^6)*(1 +x^9 +x^18)) + O(x^200)) \\ Colin Barker, Jul 19 2016
(Magma) [Binomial(n+3, n) mod 9: n in [0..60]]; // Vincenzo Librandi, Jul 20 2016
CROSSREFS
For the sequence regarding "Binomial(n+3, n) mod 3" see A133873.
KEYWORD
nonn,easy
AUTHOR
Hieronymus Fischer, Oct 10 2007
EXTENSIONS
Corrected g.f. by Colin Barker, Jul 19 2016
STATUS
approved