login
A prime-factor-based permutation of the positive integers, based on a recursive definition (see Comments for the algorithm).
1

%I #50 Sep 18 2023 02:09:45

%S 1,2,3,4,6,9,5,10,15,25,8,12,18,27,20,30,45,50,75,125,7,14,21,35,49,

%T 28,42,63,70,105,175,98,147,245,343,16,24,36,54,81,40,60,90,135,100,

%U 150,225,250,375,625,56,84,126,189,140,210,315,350,525,875,196,294,441

%N A prime-factor-based permutation of the positive integers, based on a recursive definition (see Comments for the algorithm).

%C Algorithm:

%C Definitions:

%C K = the index of the largest prime that has appeared.

%C L = the index of the smallest prime factor of a(n-1).

%C M = the multiplicity of prime(L) within a(n-1).

%C Rules:

%C 1. a(1) = 1. (K is considered to be 0.)

%C 2. If a(n-1) = prime(K)^K, then a(n) = prime(K+1).

%C 3. If a(n-1) = prime(K)^(K-1), then a(n) = 2^K.

%C 4. If a(n-1) = prime(K)^i, such that I < (K-1), then a(n) = prime(K)*2^i.

%C 5. If a(n-1) is not a power of prime(K), then a(n) = a(n-1)*2^(M-1)*prime(L+1)/prime(L)^M.

%C Explanation:

%C This sequence gives priority to smaller primes and smaller powers of primes, while also containing every positive integer exactly once.

%C The order in which the numbers appear is according to the multiplicity of each of their distinct prime factors. Numbers with smaller prime factors and a smaller number of prime factors, counted with multiplicity, appear earlier in the sequence.

%C In the traditional counting of the positive integers, 1 is added each time. This allows for additive simplicity, but not multiplicative simplicity. In this sequence, the combinations of prime factors "climb up" by taking one from the exponent of the smallest prime factor and giving it to the exponent of the next larger prime.

%C This sequence, when plotted, produces a fractal of increasing detail, which recurs at each new prime.

%C If you count the successive terms of this sequence which vary neither in their largest prime factor "h" nor their number of prime factors (counted with multiplicity) "f", and write out each number in an f X h table, it will construct Pascal's Triangle along an L-shaped serpentine path, identical to the path of A108644 tabled as a square array.

%H Hugo Pfoertner, <a href="/A344844/b344844.txt">Table of n, a(n) for n = 1..10000</a>

%H Hugo Pfoertner, <a href="/A344844/a344844.png">Illustration of first 2500 terms</a>, (2021).

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%e a(2)=2:

%e 2 is the most recent prime in the sequence.

%e The prime index of 2 is 1.

%e a(2) is the most recent prime in the sequence to the power of its own prime index. Thus, apply Rule 1. a(3) will be the next prime.

%e ;a(3)=3.

%e a(3)=3:

%e 3 is the most recent prime in the sequence.

%e The prime index of 3 is 2.

%e a(3) is the most recent prime in the sequence (3) to a power that is 1 less than its prime index (2). Thus, apply Rule 2. a(4) will be 2 to the power of the prime index of 3, or 4.

%e ;a(4)=4.

%e a(4)=4:

%e 4 is not a power of the most recent prime in the sequence (3). Thus, apply Rule 4. The non-unique prime factors of 4 are 2 with a multiplicity of 2. Subtract 1 from that multiplicity and make it the new multiplicity of 2, and then add 1 to the multiplicity of the next prime up. So the multiplicity of 2 goes down to 1 and the multiplicity of 3 goes up to 1.

%e ;a(5)=6.

%e a(6)=9:

%e 9 is the most recent prime in the sequence (3) to the power of its own prime index (2). Thus, apply Rule 1. a(7) will be the next prime.

%e ;a(7)=5.

%e a(7)=5:

%e 5 is the most recent prime in the sequence to the power of 1, which is 2 less than its prime index (3). Thus, apply Rule 3. a(8) will thus be 5 times 2 to the power of 1.

%e ;a(8)=10.

%o (PARI) first(n) = { n = max(n, 2); res = vector(n); res[1] = 1; res[2] = 2; mrprime = 2; mrprimeind = 1; for(i = 3, n, e = logint(res[i-1], mrprime); if(mrprime ^ e == res[i-1], if(e == mrprimeind, res[i] = nextprime(mrprime + 1); mrprime = res[i]; mrprimeind++; next(1); ); if(e == mrprimeind - 1, res[i] = 1<<mrprimeind; next(1) ); res[i] = mrprime*2^e , f = factor(res[i-1]); e = f[1, 2]; c = 1<<(e-1) * nextprime(f[1, 1] + 1); f[1, 2] = 0; res[i] = factorback(f)*c; ) ); res } \\ _David A. Corneth_, Jan 01 2021

%Y Cf. A108644.

%K nonn

%O 1,2

%A _Elliott Sanders_, May 29 2021