OFFSET
1,1
LINKS
Alois P. Heinz, Rows n = 1..141, flattened
EXAMPLE
Table starts with:
p = 2: 5, 9, 13, 17, 21, 25, 29, 33, ...
p = 3: 8, 10, 17, 19, 26, 28, 35, 37, ...
p = 5: 7, 18, 24, 26, 32, 43, 49, 51, ...
p = 7: 18, 19, 30, 31, 48, 50, 67, 68, ...
p = 11: 3, 9, 27, 40, 81, 94, 112, 118, ...
p = 13: 19, 22, 23, 70, 80, 89, 99, 146, ...
p = 17: 38, 40, 65, 75, 110, 131, 134, 155, ...
MAPLE
A:= proc(n, k) option remember; local p, b;
p:= ithprime(n);
for b from 1 +`if`(k=1, 1, A(n, k-1))
while b &^ (p-1) mod p^2<>1
do od; b
end:
seq(seq(A(n, 1+d-n), n=1..d), d=1..14); # Alois P. Heinz, Jul 02 2014
MATHEMATICA
A[n_, k_] := A[n, k] = Module[{p, b}, p = Prime[n]; For[b = 1 + If[k == 1, 1, A[n, k-1]], PowerMod[b, p-1, p^2] != 1, b++]; b]; Table[Table[A[n, 1+d-n], {n, 1, d}], {d, 1, 14}] // Flatten (* Jean-François Alcover, Mar 09 2015, after Alois P. Heinz *)
PROG
(PARI) forprime(p=2, 10^1, print1("p=", p, ": "); for(a=2, 10^2, if(Mod(a, p^2)^(p-1)==1, print1(a, ", "))); print(""))
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Felix Fröhlich, Jun 23 2014
STATUS
approved