A351177 Number of distinct residues of k^(n^2) (mod n^2+1), k=0..n^2.
2, 2, 10, 2, 26, 2, 42, 8, 82, 2, 122, 16, 170, 2, 226, 2, 290, 12, 362, 2, 170, 50, 530, 2, 626, 2, 90, 80, 842, 70, 962, 36, 130, 92, 1226, 2, 1370, 138, 1522, 2, 1626, 178, 1554, 152, 2026, 152, 2210, 232, 2402, 12, 2602, 272, 2810, 2, 306, 2, 1010, 338, 3482
Offset: 1
Keywords
Examples
a(2) = 2 because k^(2^2) == 0, 1 (mod 5) implies 2 distinct residues. The table of k^(n^2) (mod n^2+1) of residues starts in row n=1 with columns k>=2 as: 0,1; 0,1,1,1,1; 0,1,2,3,4,5,6,7,8,9; 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1; 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25; Its row sums are 1, 4, 45, 16, 325, ...
Programs
-
Maple
a:= n-> nops ({seq (k&^(n^2) mod (n^2+1), k=0..n^2)}): seq (a(n), n=1..100);
-
Mathematica
Table[Length[Union[PowerMod[Range[0,n^2],n^2,n^2+1]]],{n,100}]
-
PARI
a(n) = #Set(vector(n^2+1, k, k--; Mod(k, n^2+1)^n^2)); \\ Michel Marcus, Mar 18 2022
Comments