[go: up one dir, main page]

login
A376032
Least prime p that does not divide n such that 2^phi(n) == 1 (mod p), or 0 if no such prime exists.
1
0, 0, 0, 3, 3, 0, 3, 3, 7, 3, 3, 5, 3, 3, 17, 3, 3, 7, 3, 3, 5, 3, 3, 5, 3, 3, 7, 3, 3, 17, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 17, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 11, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3
OFFSET
1,4
COMMENTS
There is such a prime for all n except for n = 1, 2, 3, and 6.
LINKS
C. A. Nicol and J. L. Selfridge, Problem E 3452, Elementary Problems, The American Mathematical Monthly, Vol. 98, No. 7 (1991), p. 645; Extraneous Primes, Solution to Problem E 3452 by David Callan and Kenneth Rogers, ibid., Vol. 100, No. 4 (1993), p. 404; Comment by Gerry Myerson, ibid., Vol. 100, No. 10 (1993), p. 959.
MATHEMATICA
a[n_] := Module[{phi = EulerPhi[n], p = 2}, While[Divisible[n, p] || PowerMod[2, phi, p] != 1, p = NextPrime[p]]; p]; a[1] = a[2] = a[3] = a[6] = 0; Array[a, 100]
PROG
(PARI) a(n) = {my(phi = eulerphi(n), p = 2); if(6 % n == 0, 0, while(!(n%p) || Mod(2, p)^phi != 1, p = nextprime(p+1)); p); }
CROSSREFS
Cf. A000010 (phi).
Sequence in context: A036477 A330013 A128164 * A339702 A260636 A245256
KEYWORD
nonn,easy
AUTHOR
Amiram Eldar, Sep 07 2024
STATUS
approved