OFFSET
1,2
COMMENTS
This is a sieve constructed on the baise of A007097 (the "primeth recurrence"). Delete the elements of A007097 in the list of the prime numbers and take the smallest remaining prime and call it a(2). Start a new primeth recurrence series with a(2) as starting element instead of 1. Take b(1) to be a(2), then b(2) is the b(1)-th prime, then b(3) is the b(2)-th prime and so on. Delete also the numbers b(i) of this new sequence from the primes. Again take the smallest remaining prime and callit a(3). Start a new primeth recurrence series with this number a(3) as starting element. Continue this process and retain all smallest elements 1, a(2), a(3), a(4), ... The resulting sequence is 1, 7, 13, 19, 23, 29, 37, 43, 47, 53, 61, 71, 73, 79, 89, 97, 101, 103, 107, 113, 131, 137, 139, 149, 151, 163, 167, 173, 181, 193, 197, 199, 223, 227, 229, 233, 239, 251, 257, 263, ...
EXAMPLE
First term a(1)=1.
For the 2nd term: take all primes and delete the primes from the sequence A007097 : 1,2,3,5,11,31,127, ..
This gives: 7,13,17,19, .. (1)
The smallest term is 7. Our a(2)=7.
Now construct an A007097 series with the starting term 7 instead of 1.
The 7th prime is 17. The 17th prime is 59. the 59th prime is 277. The numbers to delete from series (1) are 7,17,59,277 ..
This gives: 13,19,23,29,.. (2)
The smallest term now is 13. Our a(3)=13.
The next A007097 like series starting with 13 is the following.
13,41,179,.. which we delete from (2).
This gives: 19,23,29,.. (3)
The smallest term now is 19. Our a(4)=19.
And so on.
PROG
(Visual Basic)
' Array a(1229, 2) filled with the primes under 10000 in the first column.
' Second column for bookkeeping: 1 present, 0 deleted
' Array b receives dynamically the sequence A007097(sta)
n=1229
sta = 1
s = "1"
k = 0
For k = 1 To 40 ' find 40 terms of A309649
' calculate the A007097(sta) sequence
b(1) = sta
For i = 2 To 100
If b(i - 1) > n Then GoTo 99
b(i) = a(b(i - 1), 1)
Next i
99:
' delete the A007097(sta) sequence
m = i
For i = 1 To m - 1
For j = 1 To n
If a(j, 1) = b(i) Then a(j, 2) = 0
Next j
Next i
' find smallest left
For i = 1 To n
If a(i, 2) = 1 Then GoTo 98
Next i
98:
sta = a(i, 1)
s = s & ", " & sta
Next k
' This can be done certainly much more elegantly in Mathematica.
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Eduard Baumann, Aug 17 2019
STATUS
approved