OFFSET
1,2
COMMENTS
FORMULA
a(2^k) = 2^k for all k >= 0.
a(2^k + 1) = m, the least unused term up to a(2^k), where multiples (other than 1) of m have been used to generate terms between a(2^(k-1)) and a(2^k) except for those which have occurred earlier; see Example.
EXAMPLE
a(3) = 3 since k = 1, a(1) = 1, and 3 is the smallest number which has not already occurred.
a(7) = 18, since k = 3, a(3) = 3, m = 6 is the least unused number and 18 has not already occurred.
For n = 18, k = 2, a(2) = 2, m = 9 is the least unused number, so we should expect a(18) = 2*9 = 18, but 18 has already occurred at a(7). Therefore we increment to m = 10, the next smallest unused number, and find a(18) = 20 (which has not occurred previously).
PROG
(PARI) lista(nn) = my(va=vector(nn)); for (n=1, nn, my(p=2^logint(n, 2)); if (p == n, va[n] = n, my(k=n-p, m=1); while (#select(x->(x==m), va) || #select(x->(x==m*va[k]), va), m++); va[n] = m*va[k]; ); ); va; \\ Michel Marcus, Dec 17 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Nov 17 2023
STATUS
approved