A370497 a(1) = 1; for n > 1, a(n) is smallest unused number such that a(n) is coprime to a(n-1), sopfr(a(n)) is coprime to sopfr(a(n-1)), and Omega(a(n)) does not equal Omega(a(n-1)), where sopfr(k) is the sum of the primes dividing k, with repetition.
1, 2, 27, 4, 3, 10, 11, 6, 7, 8, 5, 9, 13, 12, 17, 14, 19, 15, 23, 16, 29, 18, 31, 20, 21, 37, 22, 41, 24, 25, 28, 33, 40, 39, 43, 26, 45, 32, 47, 30, 53, 34, 59, 35, 48, 49, 44, 57, 52, 51, 56, 55, 54, 61, 36, 67, 38, 63, 46, 71, 42, 73, 50, 79, 58, 75, 62, 83, 60, 89, 64, 97, 65, 76, 69, 68
Offset: 1
Keywords
Examples
a(3) = 27 as a(2) = 2 and 27 is the smallest unused number that is coprime to 2, sopfr(27) = 9 is coprime to sopfr(2) = 2, and Omega(27) = 3 does not equal Omega(2) = 1.
Links
- Scott R. Shannon, Table of n, a(n) for n = 1..10000
Programs
-
Python
from math import gcd from sympy import factorint from functools import cache from itertools import count, islice @cache def sW(n): f = factorint(n) return (sum(p*e for p,e in f.items()), sum(f.values())) def agen(): # generator of terms yield 1 aset, an, mink = {1, 2}, 2, 3 while True: yield an s, W = sW(an) an = next(k for k, sk, Wk in ((k,)+sW(k) for k in count(mink)) if k not in aset and gcd(k, an)==1 and gcd(sk, s)==1 and Wk!=W) aset.add(an) while mink in aset: mink += 1 print(list(islice(agen(), 76))) # Michael S. Branicky, Feb 21 2024
Comments