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.

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

A269389 Numbers n for which prime(n+7)-prime(n+6) is not a multiple of three.

Original entry on oeis.org

1, 2, 4, 6, 7, 8, 11, 13, 14, 16, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 32, 35, 36, 37, 38, 39, 42, 43, 44, 46, 47, 51, 53, 54, 55, 56, 57, 58, 59, 60, 62, 63, 64, 66, 69, 71, 72, 73, 74, 75, 76, 77, 79, 81, 82, 83, 84, 86, 87, 88, 89, 92, 95, 98, 100, 103, 106, 107, 109, 110, 111, 114, 116, 118, 119, 120, 121, 122, 125
Offset: 1

Views

Author

Antti Karttunen, Mar 16 2016

Keywords

Crossrefs

Complement: A269399.
Left inverse: A269362.
Cf. A270189.
Cf. also A270199.

Programs

Formula

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

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.

A269399 Numbers n for which prime(n+7)-prime(n+6) is a multiple of three.

Original entry on oeis.org

3, 5, 9, 10, 12, 15, 17, 26, 30, 31, 33, 34, 40, 41, 45, 48, 49, 50, 52, 61, 65, 67, 68, 70, 78, 80, 85, 90, 91, 93, 94, 96, 97, 99, 101, 102, 104, 105, 108, 112, 113, 115, 117, 123, 124, 127, 133, 154, 155, 158, 159, 161, 162, 164, 168, 173, 174, 178, 179, 181, 182, 188, 189, 191, 193, 194, 196, 197, 199, 202, 204, 208, 210
Offset: 1

Views

Author

Antti Karttunen, Mar 16 2016

Keywords

Examples

			3 is present as the difference between A000040(3+7) = 29 and A000040(3+6) = 23 is 6, a multiple of three.
		

Crossrefs

Complement: A269389.
Cf. also A270199.

Programs

  • Mathematica
    Select[Range@ 210, Divisible[Prime[# + 7] - Prime[# + 6], 3] &] (* Michael De Vlieger, Mar 18 2016 *)
  • PARI
    isok(n) = ((prime(n+7) - prime(n+6)) % 3) == 0; \\ Michel Marcus, Mar 18 2016

Formula

a(n) = A270190(n) - 6.

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

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 10, 7, 9, 12, 11, 16, 20, 13, 14, 17, 18, 24, 22, 32, 40, 26, 28, 34, 21, 36, 48, 44, 15, 19, 64, 25, 23, 80, 52, 56, 68, 42, 33, 41, 72, 96, 88, 27, 30, 38, 29, 35, 37, 128, 49, 50, 46, 160, 104, 112, 136, 84, 66, 45, 82, 144, 192, 65, 176, 81, 53, 54, 57, 60, 76, 58, 70, 74, 256, 98, 69, 100, 43, 92
Offset: 1

Views

Author

Antti Karttunen, Mar 16 2016

Keywords

Crossrefs

Inverse: A270194.
Similar permutations: A270199, A270201 (compare the scatter plots).

Formula

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

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)).
Showing 1-6 of 6 results.