A072995 Least k > 0 such that the number of solutions to x^k == 1 (mod k) 1 <= x <= k is equal to n, or 0 if no such k exists.
1, 4, 9, 8, 25, 18, 49, 16, 27, 50, 121, 36, 169, 98, 225, 32, 289, 54, 361, 110, 147, 242, 529, 72, 125, 338, 81, 196, 841, 0, 961, 64, 1089, 578, 1225, 108, 1369, 722, 507, 100, 1681, 0, 1849, 484, 675, 1058, 2209, 144, 343, 250, 2601, 1378, 2809
Offset: 1
Keywords
Links
- Robert G. Wilson v, Table of n, a(n) for n = 1..1013 (first 200 terms from Don Reble)
- Robert G. Wilson v, Graph of n, a(n) for n = 1..1000
Crossrefs
Cf. A072994.
Programs
-
Mathematica
t = Table[0, {1000}]; f[n_] := (d = If[EvenQ@ n, 2, 1]; d*Length@ Select[ Range[ n/d], PowerMod[#, n, n] == 1 &]); f[1] = 1; k = 1; While[k < 520001, If[ PrimeQ@ k, k++]; a = f@ k; If[a < 1001 && t[[a]] == 0, t[[a]] = k; Print[{a, k}]]; k++]; t (* Robert G. Wilson v, Dec 12 2014 *)
-
PARI
A072995(n)=(n%2||n%2^(omega(n)-1)==0)&&for(k=1,9e9,A072994(k)==n&&return(k)) \\ M. F. Hasler, Feb 23 2014
Formula
First occurrence of n in A072994.
Extensions
More terms from Don Reble, Feb 23 2014
Edited, at the suggestion of Don Reble, by M. F. Hasler, Feb 23 2014
Comments