login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A379900
a(n) = position of prime(n) in A379899, or a(n) = -1 if prime(n) is not in A379899.
2
1, 2, 5, 3, 4, 6, 7, 12, 13, 8, 14, 9, 10, 15, 16, 11, 17, 31, 18, 19, 32, 20, 21, 33, 34, 35, 22, 23, 36, 37, 24, 25, 38, 26, 39, 27, 40, 28, 29, 41, 30, 42, 73, 43, 44, 74, 75, 76, 77, 45, 46, 78, 47, 79, 48, 80, 49, 81, 50, 51, 82, 52, 83, 84, 53, 54, 85
OFFSET
1,2
LINKS
PROG
(Python)
from sympy import prime, primefactors, primepi
def get_a379900(a379899_indices):
a379900 = []
count = 1
while True:
p = prime(count)
if p not in a379899_indices:
break
a379900.append(a379899_indices[p])
count += 1
return a379900
a379899 = [2]
a379899_indices = dict()
a379899_indices[2] = 1
max_a379899_len=1000
while len(a379899) <= max_a379899_len:
candidate = a379899[-1]
done = False
while not done:
candidate = candidate + 4
factors = primefactors(candidate)
for factor in factors:
if factor not in a379899_indices:
a379899.append(factor)
a379899_indices[factor] = len(a379899)
done = True
break
a379900 = get_a379900(a379899_indices)
print(a379900)
CROSSREFS
Cf. A379899.
Sequence in context: A011310 A075250 A216248 * A060127 A065184 A065181
KEYWORD
nonn,easy
AUTHOR
Robert C. Lyons, Jan 05 2025
STATUS
approved