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.

A354148 Index of prime(n) in A090252.

This page as a plain text file.
%I A354148 #10 May 27 2022 12:58:55
%S A354148 2,3,4,6,8,9,10,12,13,16,17,18,19,20,21,22,24,25,26,27,28,30,33,34,35,
%T A354148 36,37,38,39,40,41,42,43,44,45,46,48,49,50,51,52,53,54,55,56,57,58,61,
%U A354148 62,64,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,97,98,99,100
%N A354148 Index of prime(n) in A090252.
%C A354148 All the primes appear in A090252 and in their correct order.
%H A354148 N. J. A. Sloane, <a href="/A354148/b354148.txt">Table of n, a(n) for n = 1..9800</a>
%e A354148 A090252 begins 1, 2, 3, 5, 4, 7, 9, ..., so the indices of the primes are 2, 3, 4, 6, ...
%o A354148 (Python)
%o A354148 from math import gcd, prod
%o A354148 from sympy import isprime
%o A354148 from itertools import count, islice
%o A354148 def agen(): # generator of terms
%o A354148     alst, aset, mink = [1], {1}, 2
%o A354148     for n in count(2):
%o A354148         k, s = mink, n - n//2
%o A354148         prodall = prod(alst[n-n//2-1:n-1])
%o A354148         while k in aset or gcd(prodall, k) != 1: k += 1
%o A354148         alst.append(k); aset.add(k)
%o A354148         if isprime(k): yield n
%o A354148         while mink in aset: mink += 1
%o A354148 print(list(islice(agen(), 83))) # _Michael S. Branicky_, May 23 2022
%Y A354148 Cf. A090252, A354146.
%K A354148 nonn
%O A354148 1,1
%A A354148 _N. J. A. Sloane_, May 22 2022