cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-6 of 6 results.

A250246 Permutation of natural numbers: a(1) = 1, a(n) = A246278(A055396(n), a(A078898(n))).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 27, 22, 23, 24, 25, 26, 21, 28, 29, 30, 31, 32, 45, 34, 35, 36, 37, 38, 33, 40, 41, 54, 43, 44, 81, 46, 47, 48, 49, 50, 75, 52, 53, 42, 125, 56, 63, 58, 59, 60, 61, 62, 39, 64, 55, 90, 67, 68, 135, 70, 71, 72, 73, 74, 51, 76, 77, 66, 79, 80, 99, 82, 83
Offset: 1

Views

Author

Antti Karttunen, Nov 17 2014

Keywords

Crossrefs

Inverse: A250245.
Other similar permutations: A250243, A250248, A250250, A163511, A252756.
Differs from the "vanilla version" A249818 for the first time at n=42, where a(42) = 54, while A249818(42) = 42.
Differs from A250250 for the first time at n=73, where a(73) = 73, while A250250(73) = 103.

Programs

  • PARI
    up_to = 16384;
    ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };
    A020639(n) = if(n>1, if(n>n=factor(n, 0)[1, 1], n, factor(n)[1, 1]), 1); \\ From A020639
    A055396(n) = if(1==n,0,primepi(A020639(n)));
    v078898 = ordinal_transform(vector(up_to,n,A020639(n)));
    A078898(n) = v078898[n];
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961
    A250246(n) = if(1==n,n,my(k = 2*A250246(A078898(n)), r = A055396(n)); if(1==r, k, while(r>1, k = A003961(k); r--); (k))); \\ Antti Karttunen, Apr 01 2018
    (Scheme, with memoizing-macro definec from Antti Karttunen's IntSeq-library, three alternative definitions)
    (definec (A250246 n) (cond ((<= n 1) n) (else (A246278bi (A055396 n) (A250246 (A078898 n)))))) ;; Code for A246278bi given in A246278
    (definec (A250246 n) (cond ((<= n 1) n) ((even? n) (* 2 (A250246 (/ n 2)))) (else (A003961 (A250246 (A250470 n))))))
    (define (A250246 n) (A163511 (A252756 n)))

Formula

a(1) = 1, a(n) = A246278(A055396(n), a(A078898(n))).
a(1) = 1, a(2n) = 2*a(n), a(2n+1) = A003961(a(A250470(2n+1))). - Antti Karttunen, Jan 18 2015 - Instead of A250470, one may use A268674 in above formula. - Antti Karttunen, Apr 01 2018
As a composition of related permutations:
a(n) = A163511(A252756(n)).
Other identities. For all n >= 1:
a(n) = a(2n)/2. [The even bisection halved gives the sequence back.]
A020639(a(n)) = A020639(n) and A055396(a(n)) = A055396(n). [Preserves the smallest prime factor of n].
A001221(a(n)) = A302041(n).
A001222(a(n)) = A253557(n).
A008683(a(n)) = A302050(n).
A000005(a(n)) = A302051(n)
A010052(a(n)) = A302052(n), for n >= 1.
A056239(a(n)) = A302039(n).

A246684 "Caves of prime shift" permutation: a(1) = 1, a(n) = A242378(A007814(n), 2*a(A003602(n))) - 1.

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 7, 6, 9, 14, 15, 24, 13, 26, 11, 10, 17, 20, 27, 34, 29, 80, 47, 48, 25, 32, 51, 124, 21, 44, 19, 12, 33, 74, 39, 54, 53, 98, 67, 76, 57, 104, 159, 624, 93, 404, 95, 120, 49, 50, 63, 64, 101, 152, 247, 342, 41, 38, 87, 174, 37, 62, 23, 16, 65, 56, 147, 244, 77, 188, 107, 90, 105, 374, 195, 324, 133, 170, 151, 142, 113, 92
Offset: 1

Views

Author

Antti Karttunen, Sep 06 2014

Keywords

Comments

See the comments in A246676. This is otherwise similar permutation, except that after having reached an odd number 2m-1 when we have shifted the binary representation of n right k steps, here, in contrary to A246676, we don't shift the primes in the prime factorization of the even number 2m, but instead of an even number (2*a(m)), shifting it the same number (k) of positions towards larger primes, whose product is then decremented by one to get the final result.
From Antti Karttunen, Jan 18 2015: (Start)
This can be viewed as an entanglement or encoding permutation where the complementary pairs of sequences to be interwoven together are even and odd numbers (A005843/A005408) which are entangled with another complementary pair: even numbers in the order they appear in A253885 and odd numbers in their usual order: (A253885/A005408).
From the above follows also that this sequence can be represented as a binary tree. Each child to the left is obtained by doubling the parent and subtracting one, and each child to the right is obtained by applying A253885 to the parent:
1
|
...................2...................
3 4
5......../ \........8 7......../ \........6
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
9 14 15 24 13 26 11 10
17 20 27 34 29 80 47 48 25 32 51 124 21 44 19 12
(End)

Examples

			Consider n=30, "11110" in binary. It has to be shifted just one bit-position right that the result were an odd number 15, "1111" in binary. As 15 = 2*8-1, we use 2*a(8) = 2*6 = 12 = 2*2*3 = p_1 * p_1 * p_2 [where p_k denotes the k-th prime, A000040(k)], which we shift one step towards larger primes resulting p_2 * p_2 * p_3 = 3*3*5 = 45, thus a(30) = 45-1 = 44.
		

Crossrefs

Inverse: A246683.
Other versions: A246676, A246678.
Similar or related permutations: A005940, A163511, A241909, A245606, A246278, A246375, A249814, A250243.
Differs from A249814 for the first time at n=14, where a(14) = 26, while A249814(14) = 20.

Programs

  • PARI
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ Using code of Michel Marcus
    A246684(n) = { my(k=0); if(1==n, 1, while(!(n%2), n = n/2; k++); n = 2*A246684((n+1)/2); while(k>0, n = A003961(n); k--); n-1); };
    for(n=1, 8192, write("b246684.txt", n, " ", A246684(n)));
    (Scheme, with memoization-macro definec, two implementations)
    (definec (A246684 n) (cond ((<= n 1) n) (else (+ -1 (A242378bi (A007814 n) (* 2 (A246684 (A003602 n)))))))) ;; Code for A242378bi given in A242378.
    (definec (A246684 n) (cond ((<= n 1) n) ((even? n) (A253885 (A246684 (/ n 2)))) (else (+ -1 (* 2 (A246684 (/ (+ n 1) 2)))))))

Formula

a(1) = 1, a(n) = A242378(A007814(n), 2*a(A003602(n))) - 1. [Where the bivariate function A242378(k,n) changes each prime p(i) in the prime factorization of n to p(i+k), i.e., it's the result of A003961 iterated k times starting from n].
a(1) = 1, a(2n) = A253885(a(n)), a(2n+1) = (2*a(n+1))-1. - Antti Karttunen, Jan 18 2015
As a composition of other permutations:
a(n) = A250243(A249814(n)).
Other identities. For all n >= 1, the following holds:
a(n) = (1+a((2*n)-1))/2. [The odd bisection from a(1) onward with one added and then halved gives the sequence back].
For all n >= 0, the following holds: a(A000051(n)) = A000051(n). [Numbers of the form 2^n + 1 are among the fixed points].

A250244 Permutation of natural numbers: a(n) = A249741(A055396(n+1), a(A246277(n+1))).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 26, 21, 22, 23, 24, 25, 20, 27, 28, 29, 30, 31, 38, 33, 34, 35, 36, 37, 62, 51, 40, 41, 42, 43, 32, 45, 46, 47, 48, 49, 74, 39, 52, 53, 64, 55, 98, 57, 58, 59, 60, 61, 56, 75, 94, 65, 66, 67, 110, 69, 70, 71, 72, 73, 50, 123, 76, 101, 78, 79, 44, 81, 82, 83, 154, 85, 134, 63, 88, 89
Offset: 1

Views

Author

Antti Karttunen, Nov 16 2014

Keywords

Comments

This is a "more recursed" variant of A249815. Preserves the parity of n.

Crossrefs

Inverse: A250243.
Similar or related permutations: A246683, A249814, A250245.
Differs from A249816 and A250243 for the first time at n=32, where a(32) = 38, while A249816(32) = A250243(32) = 44.
Differs from the "shallow variant" A249815 for the first time at n=39, where a(39) = 51, while A249815(39) = 39

Formula

a(n) = A249741(A055396(n+1), a(A246277(n+1))).
As a composition of other permutations:
a(n) = A249814(A246683(n)).
Other identities. For all n >= 1, the following holds:
a(n) = (1+a((2*n)-1)) / 2. [The odd bisection from a(1) onward with one added and then halved gives the sequence back.]
a(A006093(n)) = A006093(n). [Primes minus one are among the fixed points].

A249813 Permutation of natural numbers: a(1) = 1, a(n) = A000079(A055396(n+1)-1) * ((2 * a(A078898(n+1))) - 1).

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 7, 6, 9, 16, 15, 32, 13, 10, 11, 64, 17, 128, 31, 14, 29, 256, 63, 12, 25, 18, 19, 512, 21, 1024, 127, 30, 33, 20, 255, 2048, 61, 26, 27, 4096, 57, 8192, 511, 22, 125, 16384, 23, 24, 49, 34, 35, 32768, 37, 28, 1023, 62, 41, 65536, 2047, 131072, 253, 58, 59, 36, 65, 262144, 39, 126, 509, 524288, 4095, 1048576, 121, 50, 51, 40, 53
Offset: 1

Views

Author

Antti Karttunen, Nov 06 2014

Keywords

Comments

This sequence is a "recursed variant" of A249812.
See also the comments at the inverse permutation A249814.

Crossrefs

Inverse: A249814.
Similar or related permutations: A246683, A249812, A250243.
Differs from A246683 for the first time at n=20, where a(20) = 14, while A246683(20) = 18.

Formula

a(1) = 1, a(n) = A000079(A055396(n+1)-1) * ((2 * a(A078898(n+1))) - 1).
As a composition of other permutations:
a(n) = A246683(A250243(n)).
Other identities. For all n >= 1, the following holds:
a(n) = (1+a((2*n)-1))/2. [The odd bisection from a(1) onward with one added and then halved gives the sequence back.]
a(A006093(n)) = A000079(n-1).

A249815 Permutation of natural numbers: a(n) = A249741(A055396(n+1), A246277(n+1)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 26, 21, 22, 23, 24, 25, 20, 27, 28, 29, 30, 31, 38, 33, 34, 35, 36, 37, 62, 39, 40, 41, 42, 43, 32, 45, 46, 47, 48, 49, 74, 51, 52, 53, 64, 55, 98, 57, 58, 59, 60, 61, 56, 63, 94, 65, 66, 67, 110, 69, 70, 71, 72, 73, 50, 75, 76, 77, 78, 79, 44, 81, 82, 83
Offset: 1

Views

Author

Antti Karttunen, Nov 06 2014

Keywords

Comments

a(n) tells which number in square array A249741 (the sieve of Eratosthenes minus 1) is at the same position where n is in 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. Also, as the leftmost column in both arrays is primes minus one (A006093), they are also among the fixed points.
Equally: a(n) tells which number in array A114881 is at the same position where n is in the array A246273, as they are the transposes of above two arrays.

Crossrefs

Inverse: A249816
Similar or related permutations: A250244 ("deep variant"), A246675, A249811, A249817, A246273, A246275, A114881, A249741.
Differs from A249816 and A250243 for the first time at n=32, where a(32) = 38, while A249816(32) = A250243(32) = 44.
Differs from A250244 for the first time at n=39, where a(39) = 39, while A250244(39) = 51.

Programs

Formula

a(n) = A249741(A055396(n+1), A246277(n+1)).
As a composition of other permutations:
a(n) = A249811(A246675(n)).
a(n) = A249817(n+1) - 1.
Other identities. For all n >= 1:
a(A005408(n-1)) = A005408(n-1) and a(A006093(n)) = A006093(n). [Fixes odd numbers and precedents of primes. Cf. comments above].

A249816 Permutation of natural numbers: a(n) = A246275(A055396(n+1), A078898(n+1)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 26, 21, 22, 23, 24, 25, 20, 27, 28, 29, 30, 31, 44, 33, 34, 35, 36, 37, 32, 39, 40, 41, 42, 43, 80, 45, 46, 47, 48, 49, 74, 51, 52, 53, 124, 55, 62, 57, 58, 59, 60, 61, 38, 63, 54, 65, 66, 67, 134, 69, 70, 71, 72, 73, 50, 75, 76, 77, 78, 79, 98, 81, 82, 83
Offset: 1

Views

Author

Antti Karttunen, Nov 06 2014

Keywords

Comments

a(n) tells which number in square array A246275 is at the same position where n is in array A249741, the sieve of Eratosthenes minus 1. As the topmost row in both arrays is A005408 (odd numbers), they are fixed, i.e. a(2n+1) = 2n+1 for all n. Also, as the leftmost column in both arrays is primes minus one (A006093), they are also among the fixed points.
Equally: a(n) tells which number in array A246273 is at the same position where n is in the array A114881, as they are the transposes of above two arrays.

Crossrefs

Inverse: A249815.
Similar or related permutations: A250243 ("deep variant"), A246676, A249812, A249818, A246273, A246275, A114881, A249741.
Differs from A249815 and A250244 for the first time at n=32, where a(32) = 44, while A249815(32) = A250244(32) = 38.
Differs from A250244 for the first time at n=39, where a(39) = 39, while A250243(39) = 51.

Programs

Formula

a(n) = A246275(A055396(n+1), A078898(n+1)).
As a composition of other permutations:
a(n) = A246676(A249812(n)).
a(n) = A249818(n+1) - 1.
Other identities. For all n >= 1:
a(A005408(n-1)) = A005408(n-1) and a(A006093(n)) = A006093(n). [Fixes odd numbers and precedents of primes. Cf. comments above].
Showing 1-6 of 6 results.