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.

This page as a plain text file.
%I A259630 #83 Jul 01 2019 04:03:46
%S A259630 1,0,2,4,3,12,5,14,27,8,25,30,31,36,13,18,131,60,133,458,247,1040,21,
%T A259630 618,283,300,209,6282,19107,11792,3401,30214,1211,3044,15989,30194
%N A259630 a(n) is the smallest integer not occurring earlier such that 2^a(1) + 2^a(2) + ... + 2^a(n) is a prime.
%C A259630 Is this sequence infinite?
%C A259630 Associated primes: A059661.
%C A259630 Essentially the same as A059662: 1 followed by A059662. - _R. J. Mathar_, Oct 09 2015
%C A259630 a(37) > 145000. - _Giovanni Resta_, Jul 01 2019
%e A259630 a(1) = 1 since 2^0 = 1 is not prime, but 2^1 = 2 is prime.
%e A259630 a(2) = 0 since 2^1 + 2^0 = 2 + 1 = 3 is prime.
%e A259630 a(3) = 2 since 2^1 + 2^0 + 2^2 = 2 + 1 + 4 = 7 is prime.
%o A259630 (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;}
%o A259630 lista(nn) = {va = []; for (n=1, nn, m = findsm(va, n); va = concat(va, m); print1(m, ", "););} \\ _Michel Marcus_, Sep 26 2015
%o A259630 (Python)
%o A259630 from sympy import isprime
%o A259630 A259630_list, A259630_set, k = [], set(), 0
%o A259630 while len(A259630_list) < 50:
%o A259630     n, m = 0,1
%o A259630     k += m
%o A259630     while n in A259630_set or not isprime(k):
%o A259630         n += 1
%o A259630         k += m
%o A259630         m *= 2
%o A259630     A259630_list.append(n)
%o A259630     A259630_set.add(n) # _Chai Wah Wu_, Jun 27 2019
%Y A259630 Cf. A059662, A113878.
%K A259630 nonn,more
%O A259630 1,3
%A A259630 _Thomas Ordowski_, Sep 24 2015
%E A259630 a(18)-a(25) from _Michel Marcus_, Sep 26 2015
%E A259630 a(26)-a(28) from _Joerg Arndt_ (with ispseudoprime() in Pari), Sep 28 2015
%E A259630 a(29)-a(34) from _Chai Wah Wu_, Jun 27 2019
%E A259630 a(35)-a(36) from _Giovanni Resta_, Jun 30 2019