OFFSET
1,2
COMMENTS
Primes larger than 7 appear in this sequence only after numbers composed solely of the digits 0 and 1 in their decimal representation. Some of these primes form twin pairs, such as 11 and 13 or 101 and 103, and they appear consecutively in the sequence (for example, 13 comes directly after 11, and 103 comes directly after 101). The next such pair appears when a(n) = A020449(k), and A020449(k) + 2 is also a prime.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
a(11) = 18 and its largest digit is 8. The least multiple of 8 that has not appeared in the sequence yet is 24, so a(12) = 24.
MATHEMATICA
s={1}; Do[i=1; Until[!MemberQ[s, i]&&Mod[i, Max[IntegerDigits[s[[-1]]]]]==0, i++]; AppendTo[s, i], {k, 69}]; s (* James C. McMahon, Nov 03 2025 *)
PROG
(Python)
from itertools import count, islice
def agen(): # generator of terms
an, aset, m = 1, {1}, {i:i for i in range(1, 10)}
while True:
yield an
big = int(max(str(an)))
an = next(k for k in count(m[big], big) if k not in aset)
m[big] = an
aset.add(an)
print(list(islice(agen(), 70)))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michael S. Branicky and Ali Sada, Oct 22 2025
STATUS
approved
