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.

A379776 a(n) = position of prime(n) in A379775, or a(n) = -1 if prime(n) is not in A379775.

This page as a plain text file.
%I A379776 #11 Jan 04 2025 12:54:15
%S A379776 1,2,3,6,5,7,4,12,25,11,20,13,40,33,43,45,27,21,44,42,14,48,71,26,8,
%T A379776 72,64,41,112,23,116,82,111,46,62,53,49,152,80,75,37,262,122,9,99,93,
%U A379776 38,115,52,343,28,286,22,162,104,274,36,87,47,70,171,79,18,140
%N A379776 a(n) = position of prime(n) in A379775, or a(n) = -1 if prime(n) is not in A379775.
%H A379776 Robert C. Lyons, <a href="/A379776/b379776.txt">Table of n, a(n) for n = 1..10000</a>
%o A379776 (Python)
%o A379776 from sympy import prime, primefactors, primepi
%o A379776 def get_a379776(a379775_indices):
%o A379776     a379776 = []
%o A379776     count = 1
%o A379776     while True:
%o A379776         p = prime(count)
%o A379776         if p not in a379775_indices:
%o A379776             break
%o A379776         a379776.append(a379775_indices[p])
%o A379776         count += 1
%o A379776     return a379776
%o A379776 a379775 = [2]
%o A379776 a379775_indices = dict()
%o A379776 a379775_indices[2] = 1
%o A379776 max_a379775_len=1000
%o A379776 while len(a379775) <= max_a379775_len:
%o A379776     candidate = a379775[-1]
%o A379776     done = False
%o A379776     while not done:
%o A379776         candidate = 2*candidate - 1
%o A379776         factors = primefactors(candidate)
%o A379776         for factor in factors:
%o A379776             if factor not in a379775_indices:
%o A379776                 a379775.append(factor)
%o A379776                 a379775_indices[factor] = len(a379775)
%o A379776                 done = True
%o A379776                 break
%o A379776 a379776 = get_a379776(a379775_indices)
%o A379776 print(a379776)
%Y A379776 Cf. A379775.
%K A379776 nonn,easy
%O A379776 1,2
%A A379776 _Robert C. Lyons_, Jan 02 2025