A354148 Index of prime(n) in A090252.
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, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 61, 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
Offset: 1
Keywords
Examples
A090252 begins 1, 2, 3, 5, 4, 7, 9, ..., so the indices of the primes are 2, 3, 4, 6, ...
Links
- N. J. A. Sloane, Table of n, a(n) for n = 1..9800
Programs
-
Python
from math import gcd, prod from sympy import isprime from itertools import count, islice def agen(): # generator of terms alst, aset, mink = [1], {1}, 2 for n in count(2): k, s = mink, n - n//2 prodall = prod(alst[n-n//2-1:n-1]) while k in aset or gcd(prodall, k) != 1: k += 1 alst.append(k); aset.add(k) if isprime(k): yield n while mink in aset: mink += 1 print(list(islice(agen(), 83))) # Michael S. Branicky, May 23 2022
Comments