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-4 of 4 results.

A257726 a(0)=0; a(2n) = unlucky(a(n)), a(2n+1) = lucky(a(n)+1), where lucky = A000959, unlucky = A050505.

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 5, 9, 6, 13, 11, 25, 8, 15, 14, 33, 10, 21, 19, 51, 17, 43, 35, 115, 12, 31, 22, 67, 20, 63, 45, 163, 16, 37, 29, 93, 27, 79, 66, 273, 24, 73, 57, 223, 47, 171, 146, 723, 18, 49, 42, 151, 30, 99, 88, 385, 28, 87, 83, 349, 59, 235, 203, 1093, 23, 69, 50, 193, 40, 135, 119, 559, 38, 129, 102, 475, 86, 367, 335, 1983, 34, 111
Offset: 0

Views

Author

Antti Karttunen, May 06 2015

Keywords

Comments

This sequence can be represented as a binary tree. Each left hand child is produced as A050505(n), and each right hand child as A000959(1+n), when a parent contains n >= 1:
0
|
...................1...................
2 3
4......../ \........7 5......../ \........9
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
6 13 11 25 8 15 14 33
10 21 19 51 17 43 35 115 12 31 22 67 20 63 45 163
etc.
Because all lucky numbers are odd, it means that even terms can only occur in even positions (together with odd unlucky numbers, for each one of which there is a separate infinite cycle), while terms in odd positions are all odd.

Crossrefs

Inverse: A257725.
Related or similar permutations: A237126, A246378, A257728, A257731, A257733, A257801.
Cf. also A183089 (another similar permutation, but with a slightly different definition, resulting the first differing term at n=9, where a(9) = 13, while A183089(9) = 21).
Cf. also A257735 - A257738.

Formula

a(0)=0; after which, a(2n) = A050505(a(n)), a(2n+1) = A000959(a(n)+1).
As a composition of other permutations. For all n >= 1:
a(n) = A257731(A246378(n)).
a(n) = A257733(A237126(n)).
a(n) = A257801(A257728(n)).

A257730 Permutation of natural numbers: a(1)=1; a(oddprime(n)) = prime(a(n)), a(not_an_oddprime(n)) = composite(a(n-1)).

Original entry on oeis.org

1, 4, 2, 9, 7, 6, 3, 16, 14, 12, 23, 8, 17, 26, 24, 21, 13, 35, 5, 15, 27, 39, 53, 36, 33, 22, 51, 10, 43, 25, 37, 40, 56, 75, 52, 49, 83, 34, 72, 18, 19, 62, 59, 38, 54, 57, 101, 78, 102, 74, 69, 114, 89, 50, 98, 28, 30, 86, 73, 82, 41, 55, 76, 80, 134, 106, 149, 135, 100, 94, 11, 150, 47, 120, 70, 130, 42, 45, 103, 117, 99, 112, 167, 58, 77
Offset: 1

Views

Author

Antti Karttunen, May 09 2015

Keywords

Comments

Here composite(n) = n-th composite = A002808(n), prime(n) = n-th prime = A000040(n), oddprime(n) = n-th odd prime = A065091(n) = A000040(n+1), not_an_oddprime(n) = n-th natural number which is not an odd prime = A065090(n).

Crossrefs

Inverse: A257729.
Related or similar permutations: A246378, A257727, A257732, A257801, A236854.

Formula

a(1) = 1; if A000035(n) = 1 and A010051(n) = 1 [i.e., when n is an odd prime], then a(n) = A000040(a(A000720(n)-1)), otherwise a(n) = A002808(a(A062298(n))). [Here A062298(n) gives the index of n among numbers larger than 1 which are not odd primes, 1 for 2, 2 for 4, 3 for 6, etc.]
As a composition of other permutations:
a(n) = A246378(A257727(n)).
a(n) = A257732(A257801(n)).

A257727 Permutation of natural numbers: a(1) = 1, a(oddprime(n)) = 1 + 2*a(n), a(not_an_oddprime(n)) = 2*a(n-1).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 9, 14, 11, 16, 20, 24, 13, 18, 15, 28, 22, 32, 17, 40, 48, 26, 36, 30, 21, 56, 25, 44, 64, 34, 80, 96, 19, 52, 72, 60, 29, 42, 23, 112, 50, 88, 33, 128, 68, 160, 192, 38, 41, 104, 144, 120, 58, 84, 49, 46, 27, 224, 100, 176, 66, 256, 37, 136, 320, 384, 31, 76, 57, 82, 208, 288, 240, 116, 45
Offset: 1

Views

Author

Antti Karttunen, May 09 2015

Keywords

Comments

Here oddprime(n) = n-th odd prime = A065091(n) = A000040(n+1), not_an_oddprime(n) = n-th natural number which is not an odd prime = A065090(n).

Examples

			For n=2, which is the second natural number >= 1 that is not an odd prime [2 = A065090(2)], we compute 2*a(1) = 2 = a(2).
For n=4, which is A065090(3), we compute 2*a(3-1) = 2*2 = 4.
For n=5, and 5 is the second odd prime [5 = A065091(2)], thus a(5) = 1 + 2*a(2) = 5.
For n=9, which is the sixth natural number >= 1 not an odd prime (9 = A065090(6)), we compute 2*a(6-1) = 2*5 = 10.
For n=11, which is the fourth odd prime [11 = A065091(4)], we compute 1 + 2*a(4) = 1 + 2*4 = 9, thus a(11) = 9.
		

Crossrefs

Inverse: A257728.
Related or similar permutations: A246377, A246378, A257725, A257730, A257801.

Formula

a(1) = 1; a(2) = 2; and for n > 2, if A010051(n) = 1 [i.e., when n is a prime], then a(n) = 1 + 2*a(A000720(n)-1), otherwise a(n) = 2*a(A062298(n)).
As a composition of other permutations:
a(n) = A246377(A257730(n)).
a(n) = A257725(A257801(n)).

A257802 Permutation of natural numbers: a(1) = 1, a(lucky(n)) = oddprime(a(n-1)), a(unlucky(n)) = not_an_oddprime(1+a(n)).

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 5, 10, 7, 14, 9, 16, 11, 12, 17, 22, 15, 25, 18, 20, 23, 26, 33, 24, 13, 36, 27, 30, 34, 38, 31, 48, 19, 35, 21, 51, 47, 39, 44, 49, 54, 45, 29, 66, 28, 50, 32, 70, 59, 65, 37, 55, 62, 68, 75, 63, 42, 90, 40, 69, 46, 94, 41, 81, 88, 52, 61, 76, 83, 85, 92, 100, 53, 86, 101, 58, 120, 56, 67, 93, 64
Offset: 1

Views

Author

Antti Karttunen, May 09 2015

Keywords

Comments

Here lucky(n) = n-th lucky number = A000959(n), unlucky(n) = n-th unlucky number = A050505(n), oddprime(n) = n-th odd prime = A065091(n), not_an_oddprime(n) = n-th natural number which is not an odd prime = A065090(n).

Crossrefs

Inverse: A257801.
Related or similar permutations: A257725, A257728, A257729, A257732.

Formula

a(1) = 1; if A145649(n) = 1 [i.e., when n is lucky] then a(n) = A065091(a(A109497(n)-1)), otherwise a(n) = A065090(1+a(n-A109497(n))).
As a composition of other permutations:
a(n) = A257728(A257725(n)).
a(n) = A257729(A257732(n)).
Showing 1-4 of 4 results.