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 (5,0,1,-5).
FORMULA
a(n) = A046530(5^n). Conjecture: a(n)= +5*a(n-1) +a(n-3) -5*a(n-4) with g.f. ( 1-4*x^2-5*x^3 ) / ( (x-1)*(5*x-1)*(1+x+x^2) ). - R. J. Mathar, Feb 27 2011
The conjecture is correct. - Charles R Greathouse IV, Jan 03 2013
31*a(n) = 5^(n+2)+2*b(n), where b(n)=3 if n==0 (mod 3), b(n)=15 if n==1 (mod 3) and b(n)=13 if b(n)==2 (mod 3). - R. J. Mathar, Oct 08 2017
MAPLE
A046633 := proc(n)
5^(n+2)+2*op(1+modp(n, 3), [3, 15, 13]) ;
%/31 ;
end proc:
seq(A046633(n), n=0..20) ; # R. J. Mathar, Oct 08 2017
MATHEMATICA
a[n_] := a[n] = Table[PowerMod[k, 3, 5^n], {k, 1, 5^n}] // Union // Length;
Table[Print["a(", n, ") = ", a[n]]; a[n], {n, 0, 10}]
(* or: *)
LinearRecurrence[{5, 0, 1, -5}, {1, 5, 21, 101}, 22] (* Jean-François Alcover, Nov 23 2017 *)
PROG
(PARI) a(n)=(5^(n+2)+30)\31 \\ Charles R Greathouse IV, Jan 03 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved