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

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).

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

Original entry on oeis.org

1, 2, 9, 3, 11, 12, 36, 4, 15, 14, 39, 17, 40, 52, 108, 5, 16, 22, 51, 20, 47, 59, 114, 25, 55, 60, 118, 77, 167, 156, 312, 6, 18, 24, 54, 30, 73, 75, 165, 28, 67, 68, 139, 85, 185, 166, 339, 34, 84, 80, 174, 87, 187, 173, 347, 117, 227, 254, 496, 236, 461, 475, 852, 7, 21, 26, 56, 33, 76, 79, 170, 43, 99, 112, 216, 115, 219, 251, 490, 41
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 A270189(1+n), and each right hand child as A270190(n), when the parent node contains n:
1
................../ \..................
2 9
3......../ \........11 12......../ \........36
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
4 15 14 39 17 40 52 108
5 16 22 51 20 47 59 114 25 55 60 118 77 167 156 312
etc.

Crossrefs

Inverse: A270201.
Similar permutation: A270194.

Formula

a(1) = 1, a(2n) = A270189(1+a(n)), a(2n+1) = A270190(a(n)).

A270190 Numbers n for which prime(n+1)-prime(n) is a multiple of three.

Original entry on oeis.org

9, 11, 15, 16, 18, 21, 23, 32, 36, 37, 39, 40, 46, 47, 51, 54, 55, 56, 58, 67, 71, 73, 74, 76, 84, 86, 91, 96, 97, 99, 100, 102, 103, 105, 107, 108, 110, 111, 114, 118, 119, 121, 123, 129, 130, 133, 139, 160, 161, 164, 165, 167, 168, 170, 174, 179, 180, 184, 185, 187, 188, 194, 195, 197, 199, 200, 202, 203, 205, 208, 210
Offset: 1

Views

Author

Antti Karttunen, Mar 16 2016

Keywords

Comments

Numbers n for which A001223(n) = 0 modulo 3.
See comments in A270189 and A269364.
Equivalently, numbers n for which prime(n+1)-prime(n) is a multiple of six. See A276414 for runs of increasing length of consecutive integers. - M. F. Hasler, Sep 03 2016

Examples

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

Crossrefs

Complement: A270189.
Positions of zeros in A137264.
Left inverse: A269850.

Programs

  • Mathematica
    Select[Range@ 210, Divisible[Prime[# + 1] - Prime@ #, 3] &] (* Michael De Vlieger, Mar 17 2016 *)
    PrimePi/@Select[Partition[Prime[Range[350]],2,1],Divisible[#[[2]]-#[[1]], 3]&][[All,1]] (* Harvey P. Dale, Jul 11 2017 *)
  • PARI
    isok(n) = ((prime(n+1) - prime(n)) % 3) == 0; \\ Michel Marcus, Mar 17 2016

Formula

Other identities. For all n >= 1:
a(n) = A269399(n) + 6.
A269850(a(n)) = n.

A137264 Prime number gaps read modulo 3.

Original entry on oeis.org

1, 2, 2, 1, 2, 1, 2, 1, 0, 2, 0, 1, 2, 1, 0, 0, 2, 0, 1, 2, 0, 1, 0, 2, 1, 2, 1, 2, 1, 2, 1, 0, 2, 1, 2, 0, 0, 1, 0, 0, 2, 1, 2, 1, 2, 0, 0, 1, 2, 1, 0, 2, 1, 0, 0, 0, 2, 0, 1, 2, 1, 2, 1, 2, 1, 2, 0, 1, 2, 1, 0, 2, 0, 0, 1, 0, 2, 1, 2, 1, 2, 1, 2, 0, 1, 0, 2, 1, 2, 1, 0, 2, 1, 2, 1, 0, 0, 2, 0, 0, 1, 0
Offset: 1

Views

Author

Noel H. Patson (n.patson(AT)cqu.edu.au), Mar 12 2008

Keywords

Comments

Conjecture: The only digit that is repeated in the sequence is 0 except for n=2 and n=3 where 2 repeats. So 1 may be followed by 2 or 0; 2 may be followed by 1 or 0; 0 may be followed by 0 or 1 or 2. this has been confirmed for the first million prime gaps.
The conjecture is true, because any three numbers whose differences are (1, 1) or (2, 2) will form a complete residue system modulo 3, and hence one of them will be a multiple of 3. - Karl W. Heuer, Mar 16 2016
See comments at A269364. - Antti Karttunen, Mar 17 2016

Crossrefs

Programs

  • Mathematica
    n=1000;(*The length of the list*) Mod[Differences[Table[Prime[i], {i, n}]], 3]
  • Scheme
    (define (A137264 n) (modulo (A001223 n) 3)) ;; Antti Karttunen, Mar 16 2016

A269364 Difference between the number of occurrences of prime gaps not divisible by 3, versus number of prime gaps that are multiples of 3, up to n-th prime gap: a(n) = A269849(n) - A269850(n).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 7, 8, 7, 8, 9, 10, 9, 8, 9, 8, 9, 10, 9, 10, 9, 10, 11, 12, 13, 14, 15, 16, 17, 16, 17, 18, 19, 18, 17, 18, 17, 16, 17, 18, 19, 20, 21, 20, 19, 20, 21, 22, 21, 22, 23, 22, 21, 20, 21, 20, 21, 22, 23, 24, 25, 26, 27, 28, 27, 28, 29, 30, 29, 30, 29, 28, 29, 28, 29, 30, 31, 32, 33, 34, 35, 34
Offset: 1

Views

Author

Antti Karttunen, Mar 17 2016

Keywords

Comments

This is related to "Lemke Oliver-Soundararajan bias", term first used by Terence Tao March 14, 2016 in his blog.

Crossrefs

Programs

  • PARI
    a(n) = sum(k=1, n, ((prime(k+1) - prime(k)) % 3) != 0) - sum(k=1, n, ((prime(k+1) - prime(k)) % 3) == 0); \\ Michel Marcus, Mar 18 2016
  • Scheme
    (define (A269364 n) (- (A269849 n) (A269850 n)))
    

Formula

a(n) = A269849(n) - A269850(n).

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.

A269849 a(n) = number of integers k <= n for which prime(k+1)-prime(k) is not a multiple of three.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 16 2016

Keywords

Comments

a(n) = number of terms of A270189 <= n, the least monotonic left inverse of A270189.
See comments at A269364.

Crossrefs

Programs

  • Mathematica
    Table[Count[Select[Range@ 125, Mod[Prime[# + 1] - Prime@ #, 3] != 0 &], k_ /; k <= n], {n, 85}] (* Michael De Vlieger, Mar 17 2016 *)
    Accumulate[If[Mod[#,3]==0,0,1]&/@Differences[Prime[Range[90]]]] (* Harvey P. Dale, Apr 15 2024 *)
  • PARI
    a(n) = sum(k=1, n, ((prime(k+1) - prime(k)) % 3) != 0); \\ Michel Marcus, Mar 18 2016

Formula

Other identities. For all n >= 1:
a(A270189(n)) = n.

A270191 Numbers n for which (prime(n+1)-prime(n)) mod 3 = 1.

Original entry on oeis.org

1, 4, 6, 8, 12, 14, 19, 22, 25, 27, 29, 31, 34, 38, 42, 44, 48, 50, 53, 59, 61, 63, 65, 68, 70, 75, 78, 80, 82, 85, 88, 90, 93, 95, 101, 106, 112, 115, 117, 122, 125, 127, 131, 134, 136, 138, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 163, 169, 172, 175, 177, 181, 183, 189, 191, 193, 198, 204, 207, 211, 213, 217, 222
Offset: 1

Views

Author

Antti Karttunen, Mar 16 2016

Keywords

Examples

			1 is present as prime(2)-prime(1) = 3-2 = 1 = 1 mod 3.
4 is present as prime(5)-prime(4) = 11-7 = 4 = 1 mod 3.
		

Crossrefs

Subsequence of A270189.
Positions of ones in A137264.

Programs

  • Mathematica
    Select[Range@ 222, Mod[Prime[# + 1] - Prime@ #, 3] == 1 &] (* Michael De Vlieger, Mar 17 2016 *)
  • PARI
    isok(n) = ((prime(n+1) - prime(n)) % 3) == 1; \\ Michel Marcus, Mar 17 2016

A270192 Numbers n for which (prime(n+1)-prime(n)) mod 3 = 2.

Original entry on oeis.org

2, 3, 5, 7, 10, 13, 17, 20, 24, 26, 28, 30, 33, 35, 41, 43, 45, 49, 52, 57, 60, 62, 64, 66, 69, 72, 77, 79, 81, 83, 87, 89, 92, 94, 98, 104, 109, 113, 116, 120, 124, 126, 128, 132, 135, 137, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 162, 166, 171, 173, 176, 178, 182, 186, 190, 192, 196, 201, 206, 209, 212, 215, 220, 223, 225
Offset: 1

Views

Author

Antti Karttunen, Mar 16 2016

Keywords

Examples

			2 is present as prime(3) - prime(2) = 5 - 3 = 2 = 2 modulo 3.
24 is present as prime(24) = 89, prime(25) = 97 and 97-89 = 8 = 2 modulo 3.
		

Crossrefs

Subsequence of A270189.
Positions of 2's in A137264.
Differs from its subsequence A029707 for the first time at n=9.

Programs

Showing 1-9 of 9 results.