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

A268393 Positions of records in permutation A267107.

Original entry on oeis.org

1, 2, 4, 8, 15, 28, 52, 99, 193, 377, 739, 1459, 2908, 5799, 11537, 23021, 45971, 91857, 183513
Offset: 1

Views

Author

Antti Karttunen, Feb 06 2016

Keywords

Comments

These are horizontal positions of the tip of the "left wing" of each successive flying/swimming creature seen in the scatter plot of A267107.

Crossrefs

Cf. A267107.
Cf. A268394 (gives the corresponding values).

Formula

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

A268394 Record values in permutation A267107.

Original entry on oeis.org

1, 3, 7, 16, 35, 74, 152, 313, 638, 1287, 2597, 5233, 10512, 21077, 42237, 84565, 169285, 338636, 677457
Offset: 1

Views

Author

Antti Karttunen, Feb 06 2016

Keywords

Crossrefs

Programs

Formula

a(n) = A267107(A268393(n)).

A038698 Excess of 4k-1 primes over 4k+1 primes, beginning with prime 2.

Original entry on oeis.org

0, 1, 0, 1, 2, 1, 0, 1, 2, 1, 2, 1, 0, 1, 2, 1, 2, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 2, 3, 2, 3, 4, 3, 4, 3, 4, 3, 2, 3, 4, 5, 6, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 3, 4, 3, 4, 5, 4, 3, 4, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 3, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 6, 5, 6, 5, 6, 5, 6
Offset: 1

Views

Author

Keywords

Comments

a(n) < 0 for infinitely many values of n. - Benoit Cloitre, Jun 24 2002
First negative value is a(2946) = -1, which is for prime 26861. - David W. Wilson, Sep 27 2002

References

  • Stan Wagon, The Power of Visualization, Front Range Press, 1994, p. 2.

Crossrefs

Cf. A112632 (race of 3k-1 and 3k+1 primes), A216057, A269364.
Cf. A156749 (sequence showing Chebyshev bias in prime races (mod 4)), A199547, A267097, A267098, A267107, A292378.
List of primes p such that a(p) = 0 is A007351. List of primes p such that a(p) < 0 is A199547. List of primes p such that a(p) = -1 is A051025. List of integers k such that a(prime(k)) = -1 is A051024. - Ya-Ping Lu, Jan 18 2025

Programs

  • Maple
    ans:=[0]; ct:=0; for n from 2 to 2000 do
    p:=ithprime(n); if (p mod 4) = 3 then ct:=ct+1; else ct:=ct-1; fi;
    ans:=[op(ans),ct]; od: ans; # N. J. A. Sloane, Jun 24 2016
  • Mathematica
    FoldList[Plus, 0, Mod[Prime[Range[2,110]], 4] - 2]
    Join[{0},Accumulate[If[Mod[#,4]==3,1,-1]&/@Prime[Range[2,110]]]] (* Harvey P. Dale, Apr 27 2013 *)
  • PARI
    for(n=2,100,print1(sum(i=2,n,(-1)^((prime(i)+1)/2)),","))
    
  • Python
    from sympy import nextprime; a, p = 0, 2; R = [a]
    for _ in range(2,88): p=nextprime(p); a += p%4-2; R.append(a)
    print(*R, sep = ', ')  # Ya-Ping Lu, Jan 18 2025

Formula

a(n) = Sum_{k=2..n} (-1)^((prime(k)+1)/2). - Benoit Cloitre, Jun 24 2002
a(n) = (Sum_{k=1..n} prime(k) mod 4) - 2*n (assuming that x mod 4 > 0). - Thomas Ordowski, Sep 21 2012
From Antti Karttunen, Oct 01 2017: (Start)
a(n) = A267098(n) - A267097(n).
a(n) = A292378(A000040(n)).
(End)
From Ridouane Oudra, Nov 04 2024: (Start)
a(n) = Sum_{k=2..n} i^(prime(k)+1), where i is the imaginary unit.
a(n) = Sum_{k=2..n} sin(3*prime(k)*Pi/2).
a(n) = Sum_{k=2..n} A163805(prime(k)).
a(n) = Sum_{k=2..n} A212159(k). (End)
a(n) = a(n-1) + prime(n) (mod 4) - 2, n >= 2. - Ya-Ping Lu, Jan 18 2025

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

A267100 Self-inverse permutation of natural numbers: a(1) = 1, a(A080147(n)) = A080148(n), a(A080148(n)) = A080147(n).

Original entry on oeis.org

1, 3, 2, 6, 7, 4, 5, 10, 12, 8, 13, 9, 11, 16, 18, 14, 21, 15, 24, 25, 17, 26, 29, 19, 20, 22, 30, 33, 23, 27, 35, 37, 28, 40, 31, 42, 32, 44, 45, 34, 50, 36, 51, 38, 39, 53, 55, 57, 59, 41, 43, 60, 46, 62, 47, 65, 48, 66, 49, 52, 68, 54, 70, 71, 56, 58, 74, 61, 77, 63, 64, 78, 79, 67, 80, 82, 69, 72, 73, 75, 84, 76, 87, 81
Offset: 1

Views

Author

Antti Karttunen, Feb 01 2016

Keywords

Crossrefs

Cf. also A267107 (a more recursed variant).

Formula

a(1) = 1; for n > 1, if prime(n) mod 4 = 1, then a(n) = A080148(A267097(n)), otherwise a(n) = A080147(A267098(n)).
Other identities. For all n >= 1:
a(n) = A000720(A267101(n)).

A267105 Permutation of natural numbers: a(1) = 1, a(A080147(n)) = 1+(2*a(n)), a(A080148(n)) = 2*a(n).

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 7, 8, 12, 9, 10, 13, 11, 14, 16, 15, 24, 17, 18, 20, 25, 26, 22, 19, 21, 27, 28, 32, 23, 29, 30, 48, 33, 34, 31, 36, 49, 40, 50, 35, 52, 37, 44, 41, 51, 38, 42, 54, 56, 53, 45, 64, 39, 46, 43, 58, 55, 60, 57, 65, 96, 47, 66, 68, 59, 61, 62, 97, 72, 67, 69, 98, 80, 63, 100, 70, 73, 99, 81, 101, 104, 71, 74
Offset: 1

Views

Author

Antti Karttunen, Feb 01 2016

Keywords

Crossrefs

Formula

a(1) = 1; and for n > 1, if prime(n) mod 4 = 1, then a(n) = 1 + 2*a(A267097(n)), otherwise a(n) = 2*a(A267098(n)).

A267106 Permutation of natural numbers: a(1) = 1, a(2n) = A080148(a(n)), a(2n+1) = A080147(a(n)).

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 7, 8, 10, 11, 13, 9, 12, 14, 16, 15, 18, 19, 24, 20, 25, 23, 29, 17, 21, 22, 26, 27, 30, 31, 35, 28, 33, 34, 40, 36, 42, 46, 53, 38, 44, 47, 55, 43, 51, 54, 62, 32, 37, 39, 45, 41, 50, 48, 57, 49, 59, 56, 65, 58, 66, 67, 74, 52, 60, 63, 70, 64, 71, 76, 82, 69, 77, 83, 87, 91, 98, 101, 112, 73, 79
Offset: 1

Views

Author

Antti Karttunen, Feb 01 2016

Keywords

Comments

This sequence can be represented as a binary tree. Each left hand child is produced as A080148(n), and each right hand child as A080147(n), when the parent node contains n:
|
...................1...................
2 3
4......../ \........6 5......../ \........7
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
8 10 11 13 9 12 14 16
15 18 19 24 20 25 23 29 17 21 22 26 27 30 31 35
etc.

Crossrefs

Inverse: A267105.
Cf. also A267107.

Formula

a(1) = 1, after which, a(2n) = A080148(a(n)), a(2n+1) = A080147(a(n)).
Showing 1-7 of 7 results.