OFFSET
1,1
COMMENTS
The binary representation of 2^(m+1) - 2^k - 1 has m 1-bits and one 0-bit. Note that prime m are very rare: 577 is the first and 5569 is the second.
A208083(a(n)+1) = 0 (cf. A081118). - Reinhard Zumkeller, Feb 23 2012 [Corrected by Thomas Ordowski, Feb 19 2024]
Conjecture: 2^j - 2 are terms for j > 2. - Chai Wah Wu, Sep 07 2021
The proof of this conjecture is in A369375. - Thomas Ordowski, Mar 20 2024
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..996 (terms 1..275 from T. D. Noe)
FORMULA
For n > 0, a(n) = A369375(n+1) - 1. - Thomas Ordowski, Mar 20 2024
EXAMPLE
6 is here because 95, 111, 119, 123, 125 and 126 are all composite.
MATHEMATICA
t={}; Do[num=2^(n+1)-1; k=0; While[k<n && !PrimeQ[num-2^k], k++ ]; If[k==n, AppendTo[t, n]], {n, 100}]; t
Select[Range[500], AllTrue[2^(#+1)-1-2^Range[0, #-1], CompositeQ]&] (* Harvey P. Dale, Apr 09 2022 *)
PROG
(Haskell)
import Data.List (elemIndices)
a138290 n = a138290_list !! (n-1)
a138290_list = map (+ 1) $ tail $ elemIndices 0 a208083_list
-- Reinhard Zumkeller, Feb 23 2012
(Python)
from sympy import isprime
A138290_list = []
for n in range(1, 10**3):
k2, n2 = 1, 2**(n+1)
for k in range(n):
if isprime(n2-k2-1):
break
k2 *= 2
else:
A138290_list.append(n) # Chai Wah Wu, Sep 07 2021
(PARI) isok(m) = my(nb=0); for (k=0, m-1, if (!ispseudoprime(2^(m+1) - 2^k - 1), nb++, break)); nb==m; \\ Michel Marcus, Sep 13 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Mar 13 2008
STATUS
approved