



1, 2, 3, 4, 5, 8, 7, 6, 9, 16, 11, 32, 13, 10, 15, 64, 17, 128, 19, 18, 21, 256, 23, 12, 25, 14, 27, 512, 29, 1024, 31, 26, 33, 20, 35, 2048, 37, 42, 39, 4096, 41, 8192, 43, 22, 45, 16384, 47, 24, 49, 50, 51, 32768, 53, 36, 55, 66, 57, 65536, 59, 131072, 61, 38, 63, 52, 65, 262144, 67, 74, 69
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

Consider the square array A246278, and also A246275 which is obtained from the former when one is subtracted from each term.
In A246278 the even numbers occur at the top row, and all the rows below that contain only odd numbers, those subsequent terms in each column having been obtained by shifting all primes present in the prime factorization of number immediately above to one larger indices with A003961.
To compute a(n): we do the same process in reverse, by shifting primes in the prime factorization of n+1 step by step to smaller primes, until after k >= 0 such shifts with A064989, the result is even, with the smallest prime present being 2.
We subtract one from this even number and shift the binary expansion of the resulting odd number k positions left (i.e. multiply it with 2^k), which will be the result of a(n).
In the essence, a(n) tells which number in the array A135764 is at the same position where n is in the array A246275. As the topmost row in both arrays is A005408 (odd numbers), they are fixed, i.e., a(2n+1) = 2n+1 for all n.
A055396(n+1) tells on which row of A246275 n is, which is equal to the row of A246278 on which n+1 is.
A246277(n+1) tells in which column of A246275 n is, which is equal to the column of A246278 in which n+1 is.


LINKS

Antti Karttunen, Table of n, a(n) for n = 1..2048
Index entries for sequences that are permutations of the natural numbers


FORMULA

a(n) = A000079(A055396(n+1)1) * ((2*A246277(n+1))1).
As a composition of related permutations:
a(n) = A135764(A246276(n)).
a(n) = A054582(A246274(n)1).
Other identities. For all n >= 0:
a(A005408(n)) = A005408(n). [Fixes the odd numbers.]


EXAMPLE

Consider 54 = 551. To find 55's position in array A246278, we start shifting its prime factorization 55 = 5 * 11 = p_3 * p_5, step by step: p_2 * p_4 (= 3 * 7 = 21), until we get an even number: p_1 * p_3 = 2*5 = 10.
This tells us that 55 is on row 3 and column 5 (= 10/2) of array A246278, thus 54 occurs in the same position at array A246275. In array A135764 the same position contains number (2^(31)) * (101) = 4*9 = 36, thus a(54) = 36.


PROG

(PARI)
A064989(n) = {my(f); f = factor(n); if((n>1 && f[1, 1]==2), f[1, 2] = 0); for (i=1, #f~, f[i, 1] = precprime(f[i, 1]1)); factorback(f)};
A246675(n) = { my(k=0); n++; while((n%2), n = A064989(n); k++); n; while(k>0, n = 2*n; k); n; };
for(n=1, 2048, write("b246675.txt", n, " ", A246675(n)));
(Scheme) (define (A246675 n) (* (A000079 ( (A055396 (+ 1 n)) 1)) (1+ (* 2 (A246277 (+ 1 n))))))


CROSSREFS

Inverse: A246676.
More recursed variants: A246677, A246683.
Even bisection halved: A246679.
Other related permutations: A054582, A135764, A246274, A246275, A246276.
Cf. A000079, A003961, A005408, A055396, A064989, A246277, A246278.
a(n) differs from A156552(n+1) for the first time at n=13, where a(13) = 14, while A156552(14) = 17.
Sequence in context: A249814 A246684 A249812 * A269388 A252754 A246677
Adjacent sequences: A246672 A246673 A246674 * A246676 A246677 A246678


KEYWORD

nonn


AUTHOR

Antti Karttunen, Sep 01 2014


STATUS

approved



