cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A259630 a(n) is the smallest integer not occurring earlier such that 2^a(1) + 2^a(2) + ... + 2^a(n) is a prime.

Original entry on oeis.org

1, 0, 2, 4, 3, 12, 5, 14, 27, 8, 25, 30, 31, 36, 13, 18, 131, 60, 133, 458, 247, 1040, 21, 618, 283, 300, 209, 6282, 19107, 11792, 3401, 30214, 1211, 3044, 15989, 30194
Offset: 1

Views

Author

Thomas Ordowski, Sep 24 2015

Keywords

Comments

Is this sequence infinite?
Associated primes: A059661.
Essentially the same as A059662: 1 followed by A059662. - R. J. Mathar, Oct 09 2015
a(37) > 145000. - Giovanni Resta, Jul 01 2019

Examples

			a(1) = 1 since 2^0 = 1 is not prime, but 2^1 = 2 is prime.
a(2) = 0 since 2^1 + 2^0 = 2 + 1 = 3 is prime.
a(3) = 2 since 2^1 + 2^0 + 2^2 = 2 + 1 + 4 = 7 is prime.
		

Crossrefs

Programs

  • PARI
    findsm(va, n) = {m = 0; ok = 0; vs = vecsort(va); sa = sum(k=1, #va, 2^va[k]); while (!ok, if (! vecsearch(vs, m), ns = sa + 2^m; if (isprime(ns), ok = 1; break);); m++;); m;}
    lista(nn) = {va = []; for (n=1, nn, m = findsm(va, n); va = concat(va, m); print1(m, ", "););} \\ Michel Marcus, Sep 26 2015
    
  • Python
    from sympy import isprime
    A259630_list, A259630_set, k = [], set(), 0
    while len(A259630_list) < 50:
        n, m = 0,1
        k += m
        while n in A259630_set or not isprime(k):
            n += 1
            k += m
            m *= 2
        A259630_list.append(n)
        A259630_set.add(n) # Chai Wah Wu, Jun 27 2019

Extensions

a(18)-a(25) from Michel Marcus, Sep 26 2015
a(26)-a(28) from Joerg Arndt (with ispseudoprime() in Pari), Sep 28 2015
a(29)-a(34) from Chai Wah Wu, Jun 27 2019
a(35)-a(36) from Giovanni Resta, Jun 30 2019