OFFSET
0,2
COMMENTS
a(n) is the minimal sequence for which the sequence generated by the indices of primes in this sequence is equal to itself, where indices start from 0.
So if f is a function on 0-indexed integer sequences with infinitely many primes where f returns the increasing sequence of indices of primes of the input sequence b(n), then a(n) is the lexicographically minimal fixed point of f.
a(n) has almost the same definition as A079254, except that a(n) starts indices from 0 instead of 1. But the resulting sequences do not seem to have any correlation.
EXAMPLE
a(0) cannot be 0, since then 0 should be prime, which it is not.
a(0) = 1 is valid hence a(1) must be the next prime, which is a(1) = 2.
Then a(2) should be the next prime, hence a(2) = 3.
a(3) should be prime, hence a(3) = 5.
Since 4 is not in the sequence so far, a(4) must be the next nonprime, which means a(4) = 6.
PROG
(Python)
# is_prime(n) is a Python function which returns True if n is prime, and returns False otherwise. In the form stated below runs with SageMath.
def a_list(length):
"""Returns the list [a(0), ..., a(length-1)]."""
num = 1
b = [1]
for i in range(1, length):
num += 1
if i in b:
while not is_prime(num):
num += 1
b.append(num)
else:
while is_prime(num):
num += 1
b.append(num)
return b
print(a_list(63))
CROSSREFS
KEYWORD
nonn
AUTHOR
Adnan Baysal, Apr 13 2020
STATUS
approved