A370496 a(1) = 1; for n > 1, a(n) is smallest unused number such that a(n) is coprime to a(n-1) and sopfr(a(n)) is coprime to sopfr(a(n-1)), where sopfr(k) is the sum of the primes dividing k, with repetition.
1, 2, 3, 4, 5, 7, 6, 11, 8, 13, 9, 10, 17, 12, 19, 14, 15, 22, 21, 20, 23, 16, 27, 25, 24, 29, 18, 31, 26, 33, 28, 37, 30, 41, 32, 43, 34, 35, 46, 39, 38, 45, 44, 47, 36, 53, 40, 49, 48, 55, 52, 51, 56, 57, 58, 59, 42, 61, 50, 63, 62, 67, 54, 65, 71, 60, 73, 64, 75, 68, 69, 76, 77, 79, 66, 83, 70
Offset: 1
Keywords
Examples
a(9) = 8 as a(8) = 11 and 8 is the smallest unused number that is coprime to 11, while sopfr(8) = 6 is coprime to sopfr(11) = 11.
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 sopfr(n): return sum(p*e for p,e in factorint(n).items()) def agen(): # generator of terms yield 1 aset, an, mink = {1, 2}, 2, 3 while True: yield an s = sopfr(an) an = next(k for k in count(mink) if k not in aset and gcd(k, an)==1 and gcd(sopfr(k), s)==1) aset.add(an) while mink in aset: mink += 1 print(list(islice(agen(), 77))) # Michael S. Branicky, Feb 21 2024
Comments