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

A267107 "Chebyshev's bat permutation": a(1) = 1, a(A080147(n)) = A080148(a(n)), a(A080148(n)) = A080147(a(n)).

Original entry on oeis.org

1, 3, 2, 7, 6, 5, 4, 16, 13, 14, 12, 11, 9, 10, 35, 8, 29, 31, 30, 26, 23, 25, 21, 27, 22, 20, 24, 74, 17, 19, 18, 62, 67, 66, 15, 65, 54, 57, 51, 58, 55, 56, 45, 48, 43, 59, 50, 44, 53, 47, 39, 152, 49, 37, 41, 42, 38, 40, 46, 144, 130, 32, 139, 137, 36, 34, 33, 118, 136, 129, 128, 113, 121, 28, 108, 122, 125
Offset: 1

Views

Author

Antti Karttunen, Feb 01 2016

Keywords

Comments

This is a self-inverse permutation of natural numbers.

Crossrefs

Cf. A268393 (record positions), A268394 (record values).
Cf. A267100, A267105, A267106 and also A270193, A270194, A270199, A270201, A270202 for other similarly constructed permutations based on prime distribution biases.

Programs

  • PARI
    allocatemem(2^30);
    default(primelimit,4294965247);
    uplim = 2^20;
    uplim2 = 366824; \\ Very ad hoc.
    v080147 = vector(uplim);
    v080148 = vector(uplim);
    v267097 = vector(uplim);
    v267107 = vector(uplim);
    v267097[1] = 0; c = 0; v47i = 0; v48i = 0; for(n=2, uplim, if((1 == (prime(n)%4)), c++; v47i++; v080147[v47i] = n, v48i++; v080148[v48i] = n); v267097[n] = c; if(!(n%32768),print1(" n=",n)));
    A080147(n) = v080147[n];
    A080148(n) = v080148[n];
    A267097(n) = v267097[n];
    A267098(n) = (n - A267097(n))-1;
    A267107(n) = v267107[n];
    v267107[1] = 1; for(n=2, uplim2, if((1 == (prime(n) % 4)), v267107[n] = A080148(A267107(A267097(n))), v267107[n] = A080147(A267107(A267098(n))));  if(!(n%32768),print1(" n=",n)));
    for(n=1, uplim2, write("b267107.txt", n, " ", A267107(n)));
    
  • Scheme
    ;; With memoization-macro definec
    (definec (A267107 n) (cond ((<= n 1) n) ((= 1 (modulo (A000040 n) 4)) (A080148 (A267107 (A267097 n)))) (else (A080147 (A267107 (A267098 n))))))

Formula

a(1) = 1; and for n > 1, if prime(n) modulo 4 = 1, a(n) = A080148(a(A267097(n))), otherwise a(n) = A080147(a(A267098(n))).

Extensions

Name changed, the old name was "Manta moth permutation" - Antti Karttunen, Dec 10 2019

A270199 Self-inverse permutation of natural numbers: a(1) = 1, a(A269389(1+n)) = A269399(a(n)), a(A269399(n)) = A269389(1+a(n)).

Original entry on oeis.org

1, 3, 2, 9, 6, 5, 30, 15, 4, 16, 12, 11, 93, 45, 8, 10, 46, 48, 34, 33, 266, 124, 26, 31, 127, 23, 154, 99, 97, 7, 24, 727, 20, 19, 352, 80, 94, 357, 68, 141, 69, 446, 278, 272, 14, 17, 70, 18, 71, 73, 1902, 54, 61, 52, 946, 232, 267, 957, 197, 408, 53, 199, 1174, 763, 407, 751, 186, 39, 41, 47, 49, 202, 50, 204, 210, 4724, 164, 192, 182, 36
Offset: 1

Views

Author

Antti Karttunen, Mar 16 2016

Keywords

Crossrefs

Related or similar permutations: A267107, A270193, A270194.

Formula

a(1) = 1, for n > 1, if A137264(6+n) = 0 [when n is in A269399], a(n) = A269389(1+a(n-A269362(n))), otherwise a(n) = A269399(a(A269362(n)-1)).

A269362 Least monotonic left inverse of A269389.

Original entry on oeis.org

1, 2, 2, 3, 3, 4, 5, 6, 6, 6, 7, 7, 8, 9, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21, 22, 22, 22, 23, 24, 25, 26, 27, 27, 27, 28, 29, 30, 30, 31, 32, 32, 32, 32, 33, 33, 34, 35, 36, 37, 38, 39, 40, 41, 41, 42, 43, 44, 44, 45, 45, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 53, 54, 54, 55, 56, 57
Offset: 1

Views

Author

Antti Karttunen, Mar 16 2016

Keywords

Comments

a(n) = number of terms of A269389 <= n.

Crossrefs

Cf. also A270193, A270199.

Formula

a(n) = A269849(6+n) - 6.
Other identities. For all n >= 1:
a(A269389(n)) = n.

A270194 Permutation of natural numbers: a(1) = 1, a(2n) = A269389(1+a(n)), a(2n+1) = A269399(a(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 9, 7, 10, 8, 12, 11, 15, 16, 30, 13, 17, 18, 31, 14, 26, 20, 34, 19, 33, 23, 45, 24, 48, 46, 93, 21, 40, 25, 49, 27, 50, 47, 94, 22, 41, 39, 80, 29, 61, 54, 99, 28, 52, 53, 97, 36, 68, 69, 124, 37, 70, 73, 154, 71, 127, 141, 266, 32, 65, 60, 112, 38, 78, 74, 155, 42, 85, 75, 158, 72, 133, 142, 267, 35, 67, 62, 113, 59
Offset: 1

Views

Author

Antti Karttunen, Mar 16 2016

Keywords

Comments

This sequence can be represented as a binary tree. Each left hand child is produced as A269389(1+n), and each right hand child as A269399(n), when the parent node contains n:
1
................../ \..................
2 3
4......../ \........5 6......../ \........9
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
7 10 8 12 11 15 16 30
13 17 18 31 14 26 20 34 19 33 23 45 24 48 46 93
etc.

Crossrefs

Inverse: A270193.
Similar permutations: A270199, A270202.

Formula

a(1) = 1, a(2n) = A269389(1+a(n)), a(2n+1) = A269399(a(n)).

A270201 Permutation of natural numbers: a(1) = 1, a(A270189(1+n)) = 2 * a(n), a(A270190(n)) = 1 + 2*a(n).

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 3, 256, 5, 6, 512, 10, 9, 17, 12, 33, 1024, 20, 65, 18, 129, 34, 24, 66, 2048, 40, 130, 36, 258, 257, 68, 48, 132, 7, 513, 4096, 11, 13, 80, 260, 72, 516, 514, 1025, 21, 136, 96, 264, 19, 14, 1026, 35, 25, 67, 8192, 2049, 22, 26, 160, 520, 144, 1032, 1028, 2050, 41, 42, 272, 192, 131, 528, 37, 259, 38, 69, 28
Offset: 1

Views

Author

Antti Karttunen, Mar 16 2016

Keywords

Crossrefs

Inverse: A270202.
Similar permutation: A270193.

Formula

a(1) = 1, for n > 1, if A137264(n) = 0 [when n is in A270190], a(n) = 1 + 2*a(A269850(n)), otherwise a(n) = 2 * a(A269849(n)-1).
Showing 1-5 of 5 results.