OFFSET
1,2
COMMENTS
Is this a permutation of the positive integers ?
It seems that for a(n-1) = 2^m, a(n) = prime(m), since m < A000120(2^m) = 1, and since p = prime(m) is the smallest missing number for n > 1 as p > m. - Michael De Vlieger, Feb 03 2026
LINKS
Paul Tek, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^16, showing primes in red, proper prime powers in gold, squarefree composites in green, numbers neither squarefree nor powerful in blue, and powerful numbers that are not prime powers in purple.
Paul Tek, Perl program for this sequence.
EXAMPLE
From Michael De Vlieger, Feb 03 2026: (Start)
Let wt(k) = A000120(k), the number of 1's in the binary expansion of k.
Let u(k) be the smallest missing number in this sequence a(1..k).
a(1) = u(1) = 1 since it is the smallest nonzero positive number; u(2) = 2.
a(2) = u(2) = 2 since wt(a(1)) = 1, and 1 | 2.
a(3) = u(3) = 3 since wt(a(2)) = 1, and 1 | 3.
a(4) = u(4) = 4 since wt(a(3)) = 2, and 2 | 4.
a(5) = u(5) = 5 since wt(a(4)) = 1, and 1 | 5.
a(6) = u(6) = 6 since wt(a(5)) = 2, and 2 | 6.
a(7) = 8 since wt(a(6)) = 2, but 2 does not divide u(7) = 7, though 2 | 8, and u(8) remains 7.
a(8) = u(8) = 7 since wt(a(7)) = 1, and 1 | 7.
a(9) = u(9) = 9 since wt(a(8)) = 3, and 3 | 9.
a(10) = u(10) = 10 since wt(a(9)) = 2, and 2 | 10.
a(11) = 12, since wt(a(10)) = 2, but 2 does not divide u(11) = 11, though 2 | 12.
a(12) = 14, since wt(a(11)) = 2; 2 does not divide u(12) = 11, or 13, but 2 | 14, etc. (End)
MATHEMATICA
Block[{c, j, k, d, nn, u}, nn = 120; c[_] := False; j = d = 1; u = 2; {1}~Join~Reap[Do[k = u; While[Or[c[k], ! Divisible[k, d]], k++]; Sow[k]; Set[{c[k], j, d}, {True, k, DigitCount[k, 2, 1]}]; If[k == u, While[c[u], u++]], {n, 2, nn}] ][[-1, 1]] ] (* Michael De Vlieger, Feb 03 2026 *)
PROG
(Perl) # See Link section.
CROSSREFS
KEYWORD
AUTHOR
Paul Tek, May 21 2014
STATUS
approved
