login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A333386
Number of solutions to x^y == 0 (mod n) where 0 <= x < n and 1 <= y <= n.
4
1, 2, 3, 7, 5, 6, 7, 27, 25, 10, 11, 23, 13, 14, 15, 113, 17, 52, 19, 39, 21, 22, 23, 91, 121, 26, 229, 55, 29, 30, 31, 469, 33, 34, 35, 211, 37, 38, 39, 155, 41, 42, 43, 87, 133, 46, 47, 369, 337, 246, 51, 103, 53, 472, 55, 219, 57, 58, 59, 119, 61, 62, 187, 1945
OFFSET
1,2
LINKS
FORMULA
For prime p: a(p) = p, the solutions are 0^y for y = 1..p and a(p^k) = p^(2*k-1) + p^(k-1) - 1 - (p-1)*Sum_{j=0..k-2} p^j*ceiling(k/(k-j-1)).
a(n)>=n, with equality if and only if n is squarefree. - Robert Israel, Oct 08 2020
EXAMPLE
a(4) = 7, because there are 7 solutions to x^y == 0 (mod 4): 0^1 == 0, 0^2 == 0, 0^3 == 0, 0^4 == 0, 2^2 == 0, 2^3 == 0, 2^4 == 0.
MAPLE
f:= proc(n) local F, q, T, x, ymin;
F:= ifactors(n)[2];
T:= n;
q:= mul(t[1], t=F);
for x from q to n-1 by q do
ymin:= ceil(max(seq(t[2]/padic:-ordp(x, t[1]), t=F)));
T:= T + n-ymin+1;
od;
T
end proc:
map(f, [$1..100]); # Robert Israel, Oct 08 2020
MATHEMATICA
a[n_] := Sum[If[PowerMod[x, y, n] == 0, 1, 0], {x, 0, n-1}, {y, 1, n}];
Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Feb 06 2023 *)
PROG
(PARI) a(n) = sum(x=0, n-1, sum (y=1, n, Mod(x, n)^y == 0)); \\ Michel Marcus, Mar 20 2020
CROSSREFS
Sequence in context: A330423 A235801 A076986 * A357579 A334126 A341717
KEYWORD
nonn
AUTHOR
Franz Vrabec, Mar 18 2020
EXTENSIONS
More terms from Jinyuan Wang, Mar 20 2020
STATUS
approved