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.

Previous Showing 11-16 of 16 results.

A237739 a(0) = 1, a(2n) = nthcomposite(a(n)-1), a(2n+1) = nthprime(a(n)), where nthcomposite = A002808, nthprime = A000040.

Original entry on oeis.org

1, 2, 4, 3, 8, 7, 6, 5, 14, 19, 12, 17, 10, 13, 9, 11, 22, 43, 28, 67, 20, 37, 26, 59, 16, 29, 21, 41, 15, 23, 18, 31, 33, 79, 60, 191, 40, 107, 91, 331, 30, 71, 52, 157, 38, 101, 81, 277, 25, 53, 42, 109, 32, 73, 57, 179, 24, 47, 34, 83, 27, 61, 45, 127, 48
Offset: 0

Views

Author

Reinhard Zumkeller, Apr 30 2014

Keywords

Comments

A071574(a(n)) = n; a(A071574(n)) = n for n > 0.

Crossrefs

Inverse: A071574.
Compare also to the permutation A246378.

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a237739 = fromIntegral . (+ 1) . fromJust . (`elemIndex` a071574_list)
    
  • PARI
    default(primelimit,(2^31)+(2^30));
    A002808(n) = { my(k=-1); while( -n + n += -k + k=primepi(n), ); n }; \\ This function from M. F. Hasler
    A237739(n) = if(0==n, 1, if(!(n%2), A002808(A237739(n/2)-1), prime(A237739((n-1)/2))));
    for(n=0, 4095, write("b237739.txt", n, " ", A237739(n)));
    \\ Antti Karttunen, Apr 04 2015
    
  • Scheme
    ;; With memoizing definec-macro.
    (definec (A237739 n) (cond ((zero? n) 1) ((odd? n) (A000040 (A237739 (/ (- n 1) 2)))) (else (A002808 (+ -1 (A237739 (/ n 2)))))))
    ;; Antti Karttunen, Apr 04 2015

Formula

a(0) = 1, a(2n) = nthcomposite(a(n)-1), a(2n+1) = nthprime(a(n)), where nthcomposite = A002808, nthprime = A000040. - Antti Karttunen, Apr 04 2015

Extensions

Name replaced by an explicit recurrence. - Antti Karttunen, Apr 04 2015

A257728 Permutation of natural numbers: a(1)=1; a(2n) = not_an_oddprime(1+a(n)), a(2n+1) = oddprime(a(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 11, 9, 13, 10, 17, 12, 19, 14, 23, 18, 37, 15, 29, 21, 43, 16, 31, 26, 61, 20, 41, 28, 71, 22, 47, 34, 89, 27, 67, 52, 163, 24, 53, 42, 113, 32, 79, 60, 193, 25, 59, 45, 131, 38, 103, 84, 293, 30, 73, 57, 181, 40, 109, 95, 359, 33, 83, 65, 223, 49, 149, 119, 463, 39, 107, 91, 337, 72, 241, 209, 971, 35, 97, 74, 251, 58
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).
This sequence can be represented as a binary tree. Each left hand child is produced as A065090(1+n), and each right hand child as A065091(n), when a parent contains n >= 1:
|
...................1...................
2 3
4......../ \........5 6......../ \........7
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
8 11 9 13 10 17 12 19
14 23 18 37 15 29 21 43 16 31 26 61 20 41 28 71
etc.
Because all odd primes are odd, it means that even terms can only occur in even positions (together with odd composites, A071904, for each one of which there is a separate infinite cycle), while terms in odd positions are all odd.

Crossrefs

Inverse: A257727.
Related or similar permutations: A246377, A246378, A257726, A257729, A257802.
Differs from A255004 for the first time at n=17, where a(17) = 23, while A255004(17) = 15.

Programs

Formula

a(1) = 1; a(2n) = A065090(1+a(n)), a(2n+1) = A065091(a(n)).
As a composition of other permutations:
a(n) = A257729(A246378(n)).
a(n) = A257802(A257726(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)).

A260422 a(1) = 1, a(2n) = A205783(1+a(n)), a(2n+1) = A206074(a(n)), where A206074 and A205783 give binary codes for polynomials with coefficients 0 or 1 that are irreducible [resp. reducible] over Q.

Original entry on oeis.org

1, 4, 2, 9, 7, 6, 3, 16, 23, 14, 17, 12, 13, 8, 5, 27, 47, 36, 71, 24, 41, 28, 53, 21, 31, 22, 37, 15, 19, 10, 11, 42, 81, 70, 149, 54, 109, 106, 239, 38, 73, 62, 127, 44, 83, 80, 171, 34, 67, 48, 91, 35, 69, 56, 113, 26, 43, 32, 59, 18, 25, 20, 29, 63, 131, 122, 271, 105, 233, 216, 477, 82, 173, 159, 353, 155, 347, 345, 787, 57
Offset: 1

Views

Author

Antti Karttunen, Jul 25 2015

Keywords

Comments

This sequence can be represented as a binary tree. Each left hand child is produced as A205783(1+n), and each right hand child as A206074(n), when the parent contains n:
|
...................1...................
4 2
9......../ \........7 6......../ \........3
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
16 23 14 17 12 13 8 5
27 47 36 71 24 41 28 53 21 31 22 37 15 19 10 11
etc.

Crossrefs

Inverse: A260421.
Related permutations: A246202, A246378, A260423, A260425.
Differs from A246378 for the first time at n=16, where a(16)=27, while A246378(16)=26.

Programs

  • PARI
    uplim = (2^21) + (2^20);
    v206074 = vector(uplim);
    v205783 = vector(uplim); v205783[1] = 1;
    isA206074(n) = polisirreducible(Pol(binary(n)));
    i=0; j=1; n=2; while((n < uplim), if(!(n%65536),print1(n,", "));  if(isA206074(n), i++; v206074[i] = n, j++; v205783[j] = n); n++); print(n);
    A260422(n) = if(1==n, 1, if(0==(n%2), v205783[1+A260422(n/2)], v206074[A260422((n-1)/2)]));
    for(n=1, 8192, write("b260422.txt", n, " ", A260422(n)));

Formula

a(1) = 1, a(2n) = A205783(1+a(n)), a(2n+1) = A206074(a(n)).
As a composition of related permutations:
a(n) = A260423(A246378(n)).
a(n) = A260425(A246202(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)).

A260424 a(1) = 1, a(A206074(n)) = prime(a(n)), a(A205783(1+n)) = composite(a(n)), where A206074 and A205783 give binary codes for polynomials with coefficients 0 or 1 that are irreducible [resp. reducible] over Q.

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, 21, 22, 23, 24, 29, 25, 26, 27, 31, 28, 37, 30, 32, 33, 34, 35, 41, 36, 44, 38, 43, 39, 47, 40, 46, 42, 53, 54, 45, 48, 49, 50, 59, 51, 61, 58, 52, 63, 67, 55, 71, 62, 56, 66, 57, 65, 73, 60, 79, 75, 83, 76, 89, 64, 68, 69, 109, 70, 97, 82, 101, 72, 103, 85, 81, 74, 127
Offset: 1

Views

Author

Antti Karttunen, Jul 25 2015

Keywords

Comments

After 1, each term of A206075 resides in a separate infinite cycle. This follows because primes (A000040) is a subsequence of A206074 [see Thomas Ordowski's Feb 19 2014 comment in A206074] and thus each composite in A206074 is trapped into a trajectory containing only primes.

Crossrefs

Programs

  • PARI
    allocatemem(123456789);
    default(primelimit,4294965247);
    uplim = 2^20;
    v255574 = vector(uplim); A255574 = n -> v255574[n];
    A255572 = n -> (n - A255574(n) - 1);
    A257000(n) = polisirreducible(Pol(binary(n)));
    v255574[1] = 0; i=0; j=0; n=2; while((n < uplim), v255574[n] = v255574[n-1]+A257000(n); n++);
    A002808(n)={ my(k=-1); while( -n + n += -k + k=primepi(n), ); n}; \\ This function from M. F. Hasler
    A260424(n) = if(1==n, 1, if(A257000(n), prime(A260424(A255574(n))), A002808(A260424(A255572(n)))));
    for(n=1, 8192, write("b260424.txt", n, " ", A260424(n)));

Formula

a(1) = 1; for n > 1, if A257000(n) = 1 [when n is in A206074], then a(n) = A000040(a(A255574(n))), otherwise [when n is in A205783], a(n) = A002808(a(A255572(n))).
As a composition of related permutations:
a(n) = A246378(A260421(n)).
a(n) = A245704(A260426(n)).
Previous Showing 11-16 of 16 results.