OFFSET
0,2
LINKS
S. R. Finch and Pascal Sebah, Squares and Cubes Modulo n, arXiv:math/0604465 [math.NT], 2006-2016.
Index entries for linear recurrences with constant coefficients, signature (3,0,1,-3).
FORMULA
G.f.: (-3*x^3-6*x^2+1)/((1-3*x)*(1-x^3)).
a(n) = A046530(3^n) = 4/3 + 3^(n+1)/13 - (22*A049347(n) - 16*A049347(n-1))/39. - R. J. Mathar, Feb 27 2011
MAPLE
A049347 := proc(n) op( (n mod 3)+1, [1, -1, 0]) ; end proc:
A046631 := proc(n) 3^(n+1)/13+4/3-(22*A049347(n)-16*A049347(n-1))/39 ; end proc: # R. J. Mathar, Feb 27 2011
MATHEMATICA
LinearRecurrence[{3, 0, 1, -3}, {1, 3, 3, 7}, 27] (* Jean-François Alcover, Nov 22 2017 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved