login
A046631
Number of cubic residues mod 3^n.
10
1, 3, 3, 7, 21, 57, 169, 507, 1515, 4543, 13629, 40881, 122641, 367923, 1103763, 3311287, 9933861, 29801577, 89404729, 268214187, 804642555, 2413927663, 7241782989, 21725348961, 65176046881, 195528140643, 586584421923
OFFSET
0,2
LINKS
S. R. Finch and Pascal Sebah, Squares and Cubes Modulo n, arXiv:math/0604465 [math.NT], 2006-2016.
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
Sequence in context: A081486 A097334 A214496 * A100666 A262375 A232368
KEYWORD
nonn,easy
STATUS
approved