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.
%I A379900 #8 Jan 06 2025 04:12:41 %S A379900 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, %T A379900 22,23,36,37,24,25,38,26,39,27,40,28,29,41,30,42,73,43,44,74,75,76,77, %U A379900 45,46,78,47,79,48,80,49,81,50,51,82,52,83,84,53,54,85 %N A379900 a(n) = position of prime(n) in A379899, or a(n) = -1 if prime(n) is not in A379899. %H A379900 Robert C. Lyons, <a href="/A379900/b379900.txt">Table of n, a(n) for n = 1..10000</a> %o A379900 (Python) %o A379900 from sympy import prime, primefactors, primepi %o A379900 def get_a379900(a379899_indices): %o A379900 a379900 = [] %o A379900 count = 1 %o A379900 while True: %o A379900 p = prime(count) %o A379900 if p not in a379899_indices: %o A379900 break %o A379900 a379900.append(a379899_indices[p]) %o A379900 count += 1 %o A379900 return a379900 %o A379900 a379899 = [2] %o A379900 a379899_indices = dict() %o A379900 a379899_indices[2] = 1 %o A379900 max_a379899_len=1000 %o A379900 while len(a379899) <= max_a379899_len: %o A379900 candidate = a379899[-1] %o A379900 done = False %o A379900 while not done: %o A379900 candidate = candidate + 4 %o A379900 factors = primefactors(candidate) %o A379900 for factor in factors: %o A379900 if factor not in a379899_indices: %o A379900 a379899.append(factor) %o A379900 a379899_indices[factor] = len(a379899) %o A379900 done = True %o A379900 break %o A379900 a379900 = get_a379900(a379899_indices) %o A379900 print(a379900) %Y A379900 Cf. A379899. %K A379900 nonn,easy %O A379900 1,2 %A A379900 _Robert C. Lyons_, Jan 05 2025