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.

A373803 Indices of primes in A373801.

Original entry on oeis.org

1, 3, 6, 10, 19, 23, 25, 29, 31, 33, 36, 45, 48, 60, 91, 95, 101, 105, 108, 112, 116, 121, 124, 129, 142, 149, 155, 157, 161, 163, 173, 176, 185, 227, 229, 231, 238, 240, 386, 391, 393, 398, 411, 415, 435, 439, 466, 537, 543, 565, 570, 575, 577, 588, 592, 687, 694, 696, 700, 733, 738, 759
Offset: 1

Views

Author

N. J. A. Sloane, Aug 05 2024

Keywords

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