OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000 (terms 1..3000 from Felix Fröhlich)
FORMULA
MATHEMATICA
c = Select[Range@ 69, CompositeQ]; f[c_] := Block[{b = 2}, While[Mod[b^(c - 1), c^2] != 1, b++]; b]; f /@ c (* Michael De Vlieger, Apr 03 2015 *)
PROG
(PARI) forcomposite(c=1, 1e3, b=2; while(Mod(b, c^2)^(c-1)!=1, b++); print1(b, ", "))
(Python)
from sympy import composite
from sympy.ntheory.residue_ntheory import nthroot_mod
def A256517(n):
z = nthroot_mod(1, (c := composite(n))-1, c**2, True)
return int(z[0]+c**2 if len(z) == 1 else z[1]) # Chai Wah Wu, May 18 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Felix Fröhlich, Apr 01 2015
STATUS
approved