login
A391106
When constructing the sequence of the positive integers > 1 from prime factors, we reuse the prime factors of the smallest earlier constructed numbers where we can. The sequence is the numbers whose prime factors were first reused entirely in the process.
0
2, 3, 4, 6, 5, 8, 7, 9, 10, 12, 15, 14, 11, 16, 18, 20, 13, 21, 24, 22, 17, 25, 28, 27, 19, 26, 30, 32, 33, 35, 36, 23, 42, 40, 34, 39, 45, 44, 48, 38, 29, 50, 31, 49, 54, 52, 55, 51, 46, 56, 60, 64, 37, 57, 63, 66, 65, 72, 41, 70, 68, 75, 43, 58, 80, 81, 77, 78, 69, 62
OFFSET
1,1
COMMENTS
For the process, we source the prime factors from an infinite set of prime factors containing every prime, each with infinite multiplicity. However, whenever we can, we also recycle, so to speak, any needed prime factors from the earlier made numbers. When the prime factors of such numbers are fully depleted, then those numbers become terms. When more than one number is used up at once, they take place in the sequence in order of their magnitude.
With 1 prepended, the sequence is a permutation of the positive integers.
EXAMPLE
__________________________________________
| Infinite pool of prime factors |
| . . . . . . . |
| . . . . . . . |
| 2 3 5 7 11 13 17 ... |
|__________________________________________|
|
v
1st step: 2, -> prime factor 2 from pool
2nd step: 2, 3 -> prime factor 3 from pool
3rd step: - 3, 2*2 -> prime factors 2 and 2 from set of
previous numbers and from pool
a(1) = 2 as 2 is used up
4th step: - 3, 2*2, 5 -> prime factor 5 from pool
5th step: - - 2*-, 5, 2*3 -> prime factors 2 and 3 from set of
previous numbers
a(2) = 3 as 3 is used up
And so on.
.
The creation of 15 = 3*5 involves using up the remnant prime factors of 9 and 10.
Thus 9 and 10 become two consecutive terms at the same time as a(8) = 9 and a(9) = 10:
| | |
v v v
-, -, -*-, -, -*-. -, -*-*-, 3*-, -*5, 11, 2*2*3, 13, 2*7, (15 = 3*5)
MATHEMATICA
seq[len_] := Module[{s = {}, t = {}, n = 1, f, available, p, k, pos, target, newterms, primes, j}, primes[k_] := Flatten[Table[#[[1]], {#[[2]]}] & /@ FactorInteger[k]]; While[Length[s] < len, n++; f = primes[n]; available = Sort[t[[All, 1]]]; Do[p = f[[i]]; Do[k = available[[m]]; j = 1; While[j <= Length[t] && t[[j, 1]] != k, j++]; pos = j; target = t[[pos, 2]]; If[MemberQ[target, p], t[[pos, 2]] = DeleteCases[target, p, 1, 1]; Break[]], {m, Length[available]}], {i, Length[f]}]; newterms = Sort[First /@ Select[t, Last[#] === {} &]]; s = Join[s, newterms]; t = Select[t, ! MemberQ[newterms, First[#]] &]; t = Append[t, {n, f}]]; s]; seq[70] (* Amiram Eldar, Dec 05 2025 *)
CROSSREFS
Sequence in context: A104650 A397055 A083179 * A123503 A123717 A123718
KEYWORD
nonn
AUTHOR
Tamas Sandor Nagy, Nov 29 2025
STATUS
approved