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.

Showing 1-3 of 3 results.

A059661 Like A059459, but each term must be greater than the previous ones.

Original entry on oeis.org

2, 3, 7, 23, 31, 4127, 4159, 20543, 134238271, 134238527, 167792959, 1241534783, 3389018431, 72108495167, 72108503359, 72108765503, 2722258935367507707706996859526254457151, 2722258935367507707708149781030861304127, 13611294676837538538536137218847444070719
Offset: 1

Views

Author

Antti Karttunen, Feb 03 2001

Keywords

Crossrefs

Programs

  • Maple
    flip_primes_asc_search := proc(a,upto_bit,upto_length) local i,n,t; if(nops(a) >= upto_length) then RETURN(a); fi; t := a[nops(a)]; for i from 0 to upto_bit do n := XORnos(t,(2^i)); if(isprime(n) and (n > t)) then print([op(a), n]); RETURN(flip_primes_asc_search([op(a), n],upto_bit,upto_length)); fi; od; RETURN([op(a),`and no more`]); end;
    flip_primes_asc_search([2],512,21);
  • Mathematica
    uptobit = 512; uptolength = 17; Clear[f]; f[a_] := f[a] = Module[{n, i, t}, If[Length[a] >= uptolength, Return[a]]; t = a[[-1]]; For[i = 0, i <= uptobit, i++, n = BitXor[t, 2^i]; If[PrimeQ[n] && n > t, Return[f[Append[ a, n]]]]]]; A059661 = f[{2}] (* Jean-François Alcover, Mar 07 2016, adapted from Maple *)
  • Python
    from sympy import isprime
    from itertools import islice
    def agen():
        an, bit = 2, 1
        while True:
            yield an
            while an&bit or not isprime(an+bit): bit <<= 1
            an += bit; bit = 1
    print(list(islice(agen(), 17))) # Michael S. Branicky, Oct 01 2022

Formula

a(n) = 2 + Sum_{k=1..n-1} 2^A059662(k). - Pontus von Brömssen, Jan 07 2023

A139803 A033875(n) + 2^a(n) = A033875(n+1).

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 1, 2, 3, 4, 5, 2, 7, 4, 1, 2, 3, 4, 9, 2, 955, 468
Offset: 1

Views

Author

Johan Särnbratt, May 22 2008

Keywords

Comments

a(23) > 10^4. - Zak Seidov, Jan 24 2017
a(23) > 30000 (if it exists). - Pontus von Brömssen, Jan 08 2023

Examples

			a(10) = 4 because A033875(10) = 31, 31 + 2^4 = 47, which is prime.
		

Crossrefs

Skipping from prime to prime by least powers of 2: A033875.

Programs

  • Mathematica
    p = 2; n = 0; While[true, x = 0; While[ ! PrimeQ[p + 2^x], x++ ]; p = p + 2^x; Print[x]; n++ ]

Formula

a(n) = A067760((A033875(n)-1)/2) for n >= 2. - Pontus von Brömssen, Jan 08 2023

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
Showing 1-3 of 3 results.