A006521 Numbers n such that n divides 2^n + 1.
1, 3, 9, 27, 81, 171, 243, 513, 729, 1539, 2187, 3249, 4617, 6561, 9747, 13203, 13851, 19683, 29241, 39609, 41553, 59049, 61731, 87723, 97641, 118827, 124659, 177147, 185193, 250857, 263169, 292923, 354537, 356481, 373977, 531441, 555579, 752571
Offset: 1
Keywords
References
- J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 243, p. 68, Ellipses, Paris 2008.
- 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 #16.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- Robert G. Wilson v, Table of n, a(n) for n = 1..1064
- Toby Bailey and Chris Smyth, Primitive solutions of n|2^n+1.
- Alexander Kalmynin, On Novák numbers, arXiv:1611.00417 [math.NT], 2016.
- V. Meally, Letter to N. J. A. Sloane, May 1975
- C. Smyth, The terms in Lucas Sequences divisible by their indices, JIS 13 (2010) #10.2.4.
Crossrefs
Programs
-
Haskell
a006521 n = a006521_list !! (n-1) a006521_list = filter (\x -> a000051 x `mod` x == 0) [1..] -- Reinhard Zumkeller, Jul 17 2014
-
Magma
[n: n in [1..6*10^5] | (2^n+1) mod n eq 0 ]; // Vincenzo Librandi, Dec 14 2018
-
Maple
for n from 1 to 1000 do if 2^n +1 mod n = 0 then lprint(n); fi; od; S:=1,3,9,27,81:C:={171,243,13203,2354697,10970073,22032887841}: for c in C do for j from c to 10^8 by 2*c do if 2&^j+1 mod j = 0 then S:=S, j;fi;od;od; S:=op(sort([op({S})])); # Toby Bailey and Christopher J. Smyth, Jan 13 2008
-
Mathematica
Do[If[PowerMod[2, n, n] + 1 == n, Print[n]], {n, 1, 10^6}] k = 9; lst = {1, 3}; While[k < 1000000, a = PowerMod[2, k, k]; If[a + 1 == k, AppendTo[lst, k]]; k += 18]; lst (* Robert G. Wilson v, Jul 06 2009 *) Select[Range[10^5], Divisible[2^# + 1, #] &] (* Robert Price, Oct 11 2018 *)
-
PARI
for(n=1,10^6,if(Mod(2,n)^n==-1,print1(n,", "))); \\ Joerg Arndt, Nov 30 2014
-
Python
A006521_list = [n for n in range(1,10**6) if pow(2,n,n) == n-1] # Chai Wah Wu, Jul 25 2017
Extensions
More terms from David W. Wilson, Jul 06 2009
Comments