A370499 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)), Omega(a(n)) does not equal Omega(a(n-1)), the string length of a(n) does not equal the string length of a(n-1), and a(n) has no digit in common with a(n-1), where sopfr(k) is the sum of the primes dividing k, with repetition.
1, 20, 7, 15, 208, 5, 12, 305, 17, 4, 11, 6, 13, 8, 19, 200, 3, 10, 223, 9, 23, 100, 27, 101, 22, 103, 24, 107, 25, 104, 29, 105, 2, 45, 109, 26, 113, 28, 111, 40, 117, 32, 147, 38, 127, 30, 149, 33, 112, 37, 102, 43, 106, 47, 108, 35, 124, 39, 116, 49, 125, 34, 151, 36, 157, 42, 131, 44, 115
Offset: 1
Examples
a(5) = 208 as a(4) = 15 and 208 is the smallest unused number that is coprime to 15, sopfr(208) = 21 is coprime to sopfr(15) = 8, Omega(208) = 5 does not equal Omega(15) = 2, the string length of "208" = 3 does not equal the string length of "15" = 2, and 208 has no digit in common with 15.
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 sWd(n): f = factorint(n) return (sum(p*e for p,e in f.items()), sum(f.values()), str(n)) def agen(): # generator of terms yield 1 aset, an, mink = {1, 20}, 20, 2 while True: yield an s, W, d = sWd(an) an = next(k for k, sk, Wk, dk in ((k,)+sWd(k) for k in count(mink)) if k not in aset and gcd(k, an)==1 and gcd(sk, s)==1 and Wk!=W and len(dk)!=len(d) and set(dk)&set(d)==set()) aset.add(an) while mink in aset: mink += 1 print(list(islice(agen(), 70))) # Michael S. Branicky, Feb 21 2024
Comments