login
A339853
Read one digit d at the time, starting from the first one; extend S with the smallest multiple of d not yet present in the sequence. Zeros are not read.
2
1, 2, 4, 8, 16, 3, 6, 9, 12, 18, 5, 10, 7, 24, 15, 11, 14, 20, 28, 13, 25, 17, 19, 21, 32, 22, 26, 40, 23, 27, 30, 35, 29, 42, 31, 36, 34, 33, 39, 38, 44, 46, 48, 54, 52, 50, 45, 56, 49, 51, 57, 55, 58, 63, 60, 62, 66, 37, 69, 72, 75, 64, 78, 81, 84, 90, 87, 80, 68, 76, 88, 96, 92, 104, 65, 100, 70, 74, 85, 108
OFFSET
1,2
COMMENTS
This is a permutation of the integers > 0 (as the prime numbers are multiples of 1).
EXAMPLE
The first d is 1; as 1 is already in the sequence, we extend it with 2;
the next d is now 2; as 2 is already in the sequence, we extend it with 4 (smallest multiple of 2 not in the sequence);
the next d is 4; as 4 is already in the sequence, we extend it with 8 (smallest multiple);
the next d is 8; as 8 is already in the sequence, we extend it with 16 (smallest multiple);
the next d is 1; we extend the sequence with 3 as 3 is the smallest multiple of 1 not yet present in the sequence;
the next d is 6; as 6 is not yet present, we extend the sequence with 6;
the next d is 3; we extend the sequence with 9 as 9 is the smallest multiple of 3 not yet present;
the next d is 6; we extend the sequence with 12 as 12 is the smallest multiple of 6 not yet present; etc.
As the zero of 10 will not be read, we will extend the sequence at that point with the smallest multiple of 7 not yet present -- which is 14.
PROG
(Python)
def aupto(n):
alst, astr, used, strind = [1], "1", {1}, 0
for k in range(1, n):
while astr[strind] == "0": strind += 1
ak = digit = int(astr[strind])
while ak in used: ak += digit
alst.append(ak); astr += str(ak); used.add(ak); strind += 1
return alst # use alst[n-1] for a(n)
print(aupto(71)) # Michael S. Branicky, Dec 19 2020
CROSSREFS
Cf. A316749.
Sequence in context: A247292 A069783 A102251 * A373944 A218338 A218468
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Dec 19 2020
STATUS
approved