%I #24 May 18 2022 13:24:08
%S 17,37,65,80,101,145,197,26,257,325,401,197,485,577,182,677,728,177,
%T 901,1025,485,1157,99,1297,1445,170,1601,1765,1937,82,2117,2305,1047,
%U 2501,577,529,2917,1451,3137,721,3365,3601,3845,244,4097,99,1945,4625,530
%N Let c be the n-th composite number. Then a(n) is the smallest base b > 1 such that b^(c-1) == 1 (mod c^2), i.e., such that c is a 'Wieferich pseudoprime'.
%H Chai Wah Wu, <a href="/A256517/b256517.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..3000 from Felix Fröhlich)
%F a(n) = A185103(A002808(n)-1). - _Bill McEachen_, Nov 27 2021
%t 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 *)
%o (PARI) forcomposite(c=1, 1e3, b=2; while(Mod(b, c^2)^(c-1)!=1, b++); print1(b, ", "))
%o (Python)
%o from sympy import composite
%o from sympy.ntheory.residue_ntheory import nthroot_mod
%o def A256517(n):
%o z = nthroot_mod(1,(c := composite(n))-1,c**2,True)
%o return int(z[0]+c**2 if len(z) == 1 else z[1]) # _Chai Wah Wu_, May 18 2022
%Y Cf. A039678, A242742, A244752, A255885.
%Y Cf. A185103, A002808.
%K nonn
%O 1,1
%A _Felix Fröhlich_, Apr 01 2015