OFFSET
1,2
COMMENTS
All terms greater than 1 are even. If an odd term n>1 exists then n = m*2^k + 1 for some k>=1 and odd m. Then n divides 2^(m*2^k) + 1 and so does every prime factor p of n, implying that 2^(k+1) divides the multiplicative order of 2 modulo p and thus p-1. Therefore n = m*2^k + 1 is the product of prime factors of the form t*2^(k+1) + 1, implying that n-1 is divisible by 2^(k+1), a contradiction. - Max Alekseyev, Mar 16 2009
The sequence is infinite. In fact, its intersection with A055685 (given by A219037) is infinite (see Li et al. link). - Max Alekseyev, Oct 11 2012
All terms greater than 6 have at least three distinct prime factors. - Robert Israel, Aug 21 2014
REFERENCES
R. Honsberger, Mathematical Gems, M.A.A., 1973, p. 142.
W. SierpiĆski, 250 Problems in Elementary Number Theory. New York: American Elsevier, 1970. Problem #18
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..150
Kin Y. Li et al., Solution to Problem 323, Mathematical Excalibur 14(2), 2009, p. 3.
V. Meally, Letter to N. J. A. Sloane, May 1975
MATHEMATICA
Do[ If[ PowerMod[ 2, n, n ] + 2 == n, Print[n]], {n, 2, 1500000000, 4} ]
Join[{1}, Select[Range[28*10^7], PowerMod[2, #, #]==#-2&]] (* Harvey P. Dale, Aug 13 2018 *)
PROG
(PARI) is_A006517(n)=!(Mod(2, n)^n+2) \\ M. F. Hasler, Oct 08 2012
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
Corrected and extended by Joe K. Crump (joecr(AT)carolina.rr.com), Sep 12 2000 and Robert G. Wilson v, Sep 13 2000
STATUS
approved