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.

A373802 Primes in A373801 in order of their appearance.

Original entry on oeis.org

2, 7, 29, 137, 7937, 569, 179, 809, 227, 263, 557, 40193, 797, 464897, 303868936193, 3833, 16097, 4457, 2309, 4793, 4937, 10289, 2693, 11057, 3002369, 52673, 27617, 1823, 7433, 1907, 497153, 4133, 269057, 2438716790407169, 2879, 2903, 93377, 2999
Offset: 1

Views

Author

N. J. A. Sloane, Aug 05 2024

Keywords

Comments

a(239) has 3137 decimal digits and is too long for inclusion in the b-file. - Alois P. Heinz, Aug 05 2024

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; (m->
         `if`(isprime(m), ithprime(n)+1, 2*m-1))(b(n-1))
        end: b(1):=2:
    g:= proc(n) option remember; local k; for k from 1+g(n-1)
          while not isprime(b(k)) do od; k
        end: g(0):=0:
    a:= n-> b(g(n)):
    seq(a(n), n=1..38);  # Alois P. Heinz, Aug 05 2024
  • Mathematica
    Reap[Module[{n = 1}, Nest[If[n++; PrimeQ[#], Sow[#];Prime[n] + 1, 2*# - 1] &, 2, 500]]][[2, 1]] (* Paolo Xausa, Aug 07 2024 *)
  • Python
    from itertools import count
    from sympy import isprime, nextprime
    def A373802_gen(): # generator of terms
        a, p = 2, 3
        for i in count(1):
            if isprime(a):
                yield a
                a = p+1
            else:
                a = (a<<1)-1
            p = nextprime(p)
    A373802_list = list(islice(A373802_gen(),20)) # Chai Wah Wu, Aug 05 2024