OFFSET
0,2
COMMENTS
It appears that for a prime p>2 the number of distinct residues x^p (mod p^n) is a(n) = (p-1)*p^(n-2) + a(n-p), with a(n<1)=1, a(1)=p.
LINKS
Index entries for linear recurrences with constant coefficients, signature (5,0,0,0,1,-5).
FORMULA
For n >= 6, a(n) = 4*5^(n-2) + a(n-5) = 5*a(n-1) + a(n-5) - 5*a(n-6). O.g.f: (-5*x^5 - 4*x^4 - 4*x^3 - 20*x^2 + 1)/(5*x^6 - x^5 - 5*x + 1). - Max Alekseyev, Feb 19 2024
MATHEMATICA
a[n_]:=CountDistinct[Table[PowerMod[x-1, 5, 5^(n-1)], {x, 1, 5^(n-1)}]]; Array[a, 13]
PROG
(Python)
def A365104(n): return len({pow(x, 5, 5**n) for x in range(5**n)}) # Chai Wah Wu, Sep 17 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Albert Mukovskiy, Aug 24 2023
EXTENSIONS
Terms a(16) onward from Max Alekseyev, Feb 19 2024
STATUS
approved