A376903 Lexicographically earliest sequence of distinct positive integers with a(1) multiples of 1 followed by a(2) multiples of 2 etc.
1, 2, 4, 3, 6, 9, 12, 8, 16, 20, 5, 10, 15, 25, 30, 35, 18, 24, 36, 42, 48, 54, 60, 66, 72, 7, 14, 21, 28, 49, 56, 63, 70, 77, 84, 91, 98, 32, 40, 64, 80, 88, 96, 104, 112, 27, 45, 81, 90, 99, 108, 117, 126, 135, 144, 153, 162, 171, 180, 189, 198, 50, 100, 110, 120
Offset: 1
Examples
The first terms/rows are: n a(n) n-th row - ---- --------------------------------------------- 1 1 1 2 2 2, 4 3 4 3, 6, 9, 12 4 3 8, 16, 20 5 6 5, 10, 15, 25, 30, 35 6 9 18, 24, 36, 42, 48, 54, 60, 66, 72 7 12 7, 14, 21, 28, 49, 56, 63, 70, 77, 84, 91, 98
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10021
- Rémy Sigrist, PARI program
- Index entries for sequences that are permutations of the natural numbers
Programs
-
PARI
\\ See Links section.
-
Python
from itertools import count, islice def A376903gen(): # generator of terms aset, alst = {1, 2, 4}, [1, 2, 4] yield from [1, 2, 4] for n in count(3): nlst = [] for k in count(n, n): if k not in aset: nlst.append(k) if len(nlst) == alst[n-1]: break yield from nlst alst.extend(nlst) aset.update(nlst) print(list(islice(A376903gen(), 100))) # Michael S. Branicky, Oct 16 2024
Comments