Alois P. Heinz, <a href="/A259234/b259234_2.txt">Table of n, a(n) for n = 1..10000</a>
Alois P. Heinz, <a href="/A259234/b259234_2.txt">Table of n, a(n) for n = 1..10000</a>
editing
approved
Alois P. Heinz, <a href="/A259234/b259234_2.txt">Table of n, a(n) for n = 1..10000</a>
g:= proc() false end:
a:= proc(n) option remember; local b, p, pm, pp;
if n>0 then a(n-1); p:= ithprime(n); pm:=p-1; pp:= p^2;
for b from 2 while g(b) or b &^ pm mod pp <> 1 do od;
g(b):= true; b fi
end:
seq(a(n), n=1..100); # Alois P. Heinz, Jul 20 2015
approved
editing
editing
approved
Felix Fröhlich, <a href="/A259234/b259234.txt">Table of n, a(n) for n = 1..10000</a>
approved
editing
proposed
approved
editing
proposed
(PARI) v=vector(1); forprime(p=1, 50, b=2; while(Mod(b, p^2)^(p-1)!=1, b++; if(Mod(b, p^2)^(p-1)==1, for(k=1, #v, if(b==v[k], b++)))); w=[b]; v=concat(v, wb); print1(v[#v], ", "))
(PARI) A259234=[]List(); for(n=1, 500, my(p=prime(n), b=1, S=Set(A259234)); until(!setsearch(S, b++) && Mod(b, ++, p^2)^(p-1)==1, ); && !setsearch(Set(A259234=concat), b), ); listput(A259234, b); /*print1(b", ")*/) \\ M. F. Hasler, Jul 20 2015
proposed
editing
editing
proposed
(PARI) A259234=[]; for(n=1, 500, my(p=prime(n), b=1, S=Set(A259234)); until(!setsearch(S, b++) && Mod(b, p^2)^(p-1)==1, ); A259234=concat(A259234, b); /*print1(b", ")*/) \\ M. F. Hasler, Jul 20 2015
approved
editing