A353904 a(1) = 1; for n > 1, a(n) is the smallest positive number that has not yet appeared that is coprime to a(n-1), does not equal a(n-1)+1, and differs from a(n-1) at every digit.
1, 3, 2, 5, 4, 7, 6, 11, 8, 13, 9, 14, 23, 10, 21, 16, 25, 12, 29, 15, 22, 17, 20, 19, 24, 31, 18, 35, 26, 33, 28, 37, 40, 27, 32, 41, 30, 43, 34, 45, 38, 47, 36, 49, 51, 44, 39, 46, 53, 42, 55, 48, 59, 61, 50, 63, 52, 67, 54, 65, 56, 69, 58, 71, 57, 62, 73, 60, 77, 64, 75, 68, 79, 66, 83, 70, 81
Offset: 1
Examples
a(13) = 23 as a(12) = 14, and 23 has not yet appeared, is coprime to 14, is not 1 more than 14, and differs at every digit from 14. Note that 17 satisfies all of these conditions except the last. This is the first term to differ from A093714.
Links
- Scott R. Shannon, Image of the first 100000 terms. The green line is y = n.
Programs
-
Python
from math import gcd from itertools import islice def c(san, k): sk = str(k) return all(sk[-1-i]!=san[-1-i] for i in range(min(len(san), len(sk)))) def agen(): # generator of terms an, aset, mink = 1, {1}, 2 while True: yield an k, san = mink, str(an) while k in aset or gcd(an, k) != 1 or k-an == 1 or not c(san, k): k += 1 an = k aset.add(an) while mink in aset: mink += 1 print(list(islice(agen(), 77))) # Michael S. Branicky, May 23 2022
Comments