OFFSET
1,2
COMMENTS
The prime tower factorization of a number is defined in A182318.
This sequence is a permutation of the positive integers with inverse A394859:
- we can always extend the sequence with some prime number larger than all prior terms,
- for any prime number p, the first term >= p is necessarily p,
- all prime numbers appear in the sequence, in natural order,
- each time we hit a prime number p, the least missing composite number c < p if any must follow immediately, so eventually every composite number will appear in the sequence.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Rémy Sigrist, PARI program
EXAMPLE
The first terms are:
n a(n) a(n)-th row of A336964
-- ---- ----------------------
1 1 [1]
2 2 [2]
3 3 [3]
4 4 [2]
5 5 [5]
6 6 [2, 3]
7 7 [7]
8 8 [2, 3]
9 11 [11]
10 9 [2, 3]
11 13 [13]
12 10 [2, 5]
13 17 [17]
14 12 [2, 3]
15 19 [19]
16 14 [2, 7]
17 15 [3, 5]
18 16 [2]
19 21 [3, 7]
20 20 [2, 5]
PROG
(PARI) \\ See Links section.
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Apr 04 2026
STATUS
approved
