OFFSET
1,2
COMMENTS
If this sequence is infinite then so is A124401.
Equals A127965(n)/2.
The sum has the simple closed form 1 + 2/3*(4^n-1). - Stefan Steinerberger, Nov 24 2007
Terms beyond a(30) correspond to probable primes, cf. A000978. - M. F. Hasler, Aug 29 2008
FORMULA
a(n) = floor(A000978(n)/2) = ceiling(log(4)(A000979(n))); A000978(n) = 2 a(n) + 1; A000979(n) = (2*4^a(n)+1)/3. - M. F. Hasler, Aug 29 2008
EXAMPLE
a(1)=1 because 1 + 2 = 3 is prime;
a(2)=2 because 1 + 2 + 2^3 = 11 is prime;
a(3)=3 because 1 + 2 + 2^3 + 2^5 = 43 is prime;
a(4)=5 because 1 + 2 + 2^3 + 2^5 + 2^7 + 2^9 = 683 is prime;
...
MATHEMATICA
a = {}; Do[If[PrimeQ[1 + Sum[2^(2n - 1), {n, 1, x}]], AppendTo[a, x]], {x, 1, 1000}]; a
b = {}; Do[c = 1 + Sum[2^(2n - 1), {n, 1, x}]; If[PrimeQ[c], AppendTo[b, c]], {x, 0, 1000}]; a = {}; Do[AppendTo[a, FromDigits[IntegerDigits[b[[x]], 2]]], {x, 1, Length[b]}]; d = {}; Do[AppendTo[d, (1/2)(DigitCount[a[[x]], 10, 0]+DigitCount[a[[x]], 10, 1]]), {x, 1, Length[a]}]; d
Position[Accumulate[2^(2*Range[1000]-1)], _?(PrimeQ[#+1]&)]//Flatten (* The program generates the first 21 terms of the sequence. To generate more, increase the Range constant. *) (* Harvey P. Dale, Mar 23 2022 *)
PROG
(PARI) for(n=1, 999, ispseudoprime(2^(2*n+1)\3+1) & print1(n", ")) \\ M. F. Hasler, Aug 29 2008
(Haskell)
import Data.List (findIndices)
a127936 n = a127936_list !! (n-1)
a127936_list = findIndices ((== 1) . a010051'') a007583_list
-- Reinhard Zumkeller, Mar 24 2013
(Python)
from sympy import isprime
A127936 = [i for i in range(1, 10**3) if isprime(int('01'*i+'1', 2))]
# Chai Wah Wu, Sep 05 2014
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Artur Jasinski, Feb 08 2007, Feb 09 2007
EXTENSIONS
Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, Jun 11 2007
2 more terms from Stefan Steinerberger, Nov 24 2007
6 more terms from Dmitry Kamenetsky, Jul 12 2008
a(30)-a(40) calculated from A000978 by M. F. Hasler, Aug 29 2008
STATUS
approved