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

A112632 Excess of 3k - 1 primes over 3k + 1 primes, beginning with 2.

Original entry on oeis.org

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

Views

Author

Roger Hui, Dec 22 2005

Keywords

Comments

Cumulative sums of A134323, negated. The first negative term is a(23338590792) = -1 for the prime 608981813029. See page 4 of the paper by Granville and Martin. - T. D. Noe, Jan 23 2008 [Corrected by Jianing Song, Nov 24 2018]
See the comment about "Chebyshev's bias" in A321856. - Jianing Song, Nov 24 2018

Examples

			a(1) = 1 because 2 == -1 (mod 3).
a(2) = 1 because 3 == 0 (mod 3) and does not change the counting.
a(3) = 2 because 5 == -1 (mod 3).
a(4) = 1 because 7 == 1 (mod 3).
		

Crossrefs

Let d be a fundamental discriminant.
Sequences of the form "a(n) = -Sum_{primes p<=n} Kronecker(d,p)" with |d| <= 12: A321860 (d=-11), A320857 (d=-8), A321859 (d=-7), A066520 (d=-4), A321856 (d=-3), A321857 (d=5), A071838 (d=8), A321858 (d=12).
Sequences of the form "a(n) = -Sum_{i=1..n} Kronecker(d,prime(i))" with |d| <= 12: A321865 (d=-11), A320858 (d=-8), A321864 (d=-7), A038698 (d=-4), this sequence (d=-3), A321862 (d=5), A321861 (d=8), A321863 (d=12).

Programs

  • Haskell
    a112632 n = a112632_list !! (n-1)
    a112632_list = scanl1 (+) $ map negate a134323_list
    -- Reinhard Zumkeller, Sep 16 2014
    
  • Mathematica
    a[n_] := a[n] = a[n-1] + If[Mod[Prime[n], 6] == 1, -1, 1]; a[1] = a[2] = 1; Table[a[n], {n, 1, 100}]  (* Jean-François Alcover, Jul 24 2012 *)
    Accumulate[Which[IntegerQ[(#+1)/3],1,IntegerQ[(#-1)/3],-1,True,0]& /@ Prime[ Range[100]]] (* Harvey P. Dale, Jun 06 2013 *)
  • PARI
    a(n) = -sum(i=1, n, kronecker(-3, prime(i))) \\ Jianing Song, Nov 24 2018

Formula

a(n) = -Sum_{primes p<=n} Legendre(prime(i),3) = -Sum_{primes p<=n} Kronecker(-3,prime(i)) = -Sum_{i=1..n} A102283(prime(i)). - Jianing Song, Nov 24 2018

A007352 Where the prime race 3k-1 vs. 3k+1 changes leader.

Original entry on oeis.org

2, 608981813029, 608981813507, 608981813683, 608981813819, 608981814127, 608981814143, 608981818999, 608981820977, 608981826877, 608981826977, 608981827873, 608981828201, 608981836363, 608981836493, 608981836681, 608981836973, 608981836993, 608981837063
Offset: 1

Views

Author

Keywords

Comments

Terms a(2n+1) form a subsequence of A098044.

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence, although the terms are incorrect - see A185703).

Crossrefs

Extensions

Terms from a(3) onwards corrected by Max Alekseyev, Feb 10 2011

A096629 Values of n for which {p_3, p_4, ..., p_n} (mod 3) contains equal numbers of 1's and 2's.

Original entry on oeis.org

4, 6, 8, 12, 14, 22, 38, 48, 50, 23338590786, 23338590788, 23338590790, 23338590806, 23338590808, 23338590820, 23338590822, 23338590824, 23338590826, 23338590828, 23338590830, 23338590834, 23338590840, 23338590858, 23338590860, 23338590868, 23338590870
Offset: 1

Views

Author

Eric W. Weisstein, Jul 04 2004

Keywords

Crossrefs

Formula

a(n) = A000720(A098044(n+1)).

Extensions

Edited by Max Alekseyev, Sep 13 2009
Terms a(10) onward from Max Alekseyev, Feb 10 2011

A096449 Primes p such that the number of primes q, 5 <= q < p, congruent to 1 mod 3, is equal to the number of such primes congruent to 2 mod 3.

Original entry on oeis.org

5, 11, 17, 23, 41, 47, 83, 167, 227, 233, 608981812919, 608981812961, 608981813017, 608981813569, 608981813677, 608981813833, 608981813851, 608981813927, 608981813939, 608981813963, 608981814043, 608981814149, 608981814251, 608981814827
Offset: 1

Views

Author

Yasutoshi Kohmoto, Aug 12 2004

Keywords

Comments

First term prime(3) = 5 is placed on 0th row.
If prime(n-1) = +1 mod 3 is on k-th row then we put prime(n) on (k-1)-st row.
If prime(n-1) = -1 mod 3 is on k-th row then we put prime(n) on (k+1)-st row.
This process makes an array of prime numbers:
5, 11, 17, 23, 41, 47, 83, ... (this sequence)
7, 13, 19, 29, 37, 43, 53, 71, 79, 89, 101, .. (A096452).
31, 59, 67, 73, 97, ... (A096453)
61, ...

Crossrefs

Programs

  • Mathematica
    lst = {5}; p = 0; q = 0; r = 5; While[r < 10^9, If[ Mod[r, 3] == 2, p++, q++ ]; r = NextPrime@r; If[p == q, AppendTo[lst, r]; Print@r]]; lst (* Robert G. Wilson v, Sep 20 2009 *)

Formula

For n>1, a(n) = prime(A096629(n-1)+1) = A000040(A096629(n-1)+1). - Max Alekseyev, Sep 19 2009
a(n) = A151800(A098044(n)) = A007918(A098044(n)+1).

Extensions

More terms and better definition from Joshua Zucker, May 21 2006
Terms a(11) onward from Max Alekseyev, Feb 10 2011

A096452 Primes p such that the number of primes q, 5 <= q < p, congruent to 1 mod 3, is one less than the number of such primes congruent to 2 mod 3.

Original entry on oeis.org

7, 13, 19, 29, 37, 43, 53, 71, 79, 89, 101, 107, 113, 131, 163, 173, 223, 229, 239, 251, 383, 443, 1811, 1871, 1877, 1889, 608981812613, 608981812667, 608981812891, 608981812951, 608981812993, 608981813929, 608981813941, 608981814019, 608981814173
Offset: 1

Views

Author

Yasutoshi Kohmoto, Aug 12 2004

Keywords

Crossrefs

Programs

  • Mathematica
    lst = {}; p = q = 0; r = 5; While[r < 10^5, If[ Mod[r, 3] == 2, p++, q++ ]; r = NextPrime@ r; If[p == q + 1, AppendTo[lst, r]; Print@ r]]; lst (* Robert G. Wilson v, Sep 20 2009 *)

Extensions

More terms and better definition from Joshua Zucker, May 21 2006
Terms a(27) onward from Max Alekseyev, Feb 10 2011

A297006 Primes p for which pi_{3,2}(p) - pi_{3,1}(p) = -1, where pi_{m,a}(x) is the number of primes <= x which are congruent to a (mod m).

Original entry on oeis.org

608981813029, 608981813137, 608981813261, 608981813273, 608981813311, 608981813357, 608981813459, 608981813683, 608981813717, 608981813777, 608981813789, 608981814127, 608981818999, 608981819021, 608981819273, 608981819359, 608981819419, 608981820869, 608981820899, 608981820913, 608981826877, 608981827873, 608981827891, 608981828023, 608981828029, 608981828111, 608981828129, 608981836363, 608981836391, 608981836481
Offset: 1

Views

Author

Andrey S. Shchebetov and Sergei D. Shchebetov, Dec 23 2017

Keywords

Comments

This sequence is a companion sequence to A297005. Starting from a(20591)=6148171711663 the sequence includes the second sign-changing zone predicted by C. Bays et al. in 2001. The sequence with the first two sign-changing zones up to 10^13 contains 84323 terms with a(84323)=6156051951677 as its last term (see b-file). In addition, a(1) = A007352(2) as well as a(20591) = A007352(9630).

Crossrefs

A297005 Values of n for which pi_{3,2}(p_n) - pi_{3,1}(p_n) = -1, where p_n is the n-th prime and pi_{m,a}(x) is the number of primes <= x which are congruent to a (mod m).

Original entry on oeis.org

23338590792, 23338590794, 23338590796, 23338590798, 23338590800, 23338590802, 23338590804, 23338590810, 23338590814, 23338590816, 23338590818, 23338590832, 23338591016, 23338591018, 23338591028, 23338591030, 23338591032, 23338591084, 23338591086, 23338591088, 23338591302, 23338591340, 23338591342, 23338591344, 23338591346, 23338591348, 23338591350, 23338591656, 23338591658, 23338591662
Offset: 1

Views

Author

Andrey S. Shchebetov and Sergei D. Shchebetov, Dec 23 2017

Keywords

Comments

This sequence is a companion sequence to A297006. Starting from a(20591)=216415270060 the sequence includes the second sign-changing zone predicted by C. Bays et al. in 2001. The sequence with the first two sign-changing zones up to 10^13 contains 84323 terms with a(84323)=216682882512 as its last term (see b-file). In addition, a(1) = A096630(1).

Crossrefs

A174695 Partial sums of A173950.

Original entry on oeis.org

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

Views

Author

Giovanni Teofilatto, Nov 30 2010

Keywords

Comments

Since this sequence equals A112632(n)-1, and A007352 gives the primes at which the sign of A112632 changes, we have a change of sign in the present sequence not exactly at the primes listed in A007352, but earlier for changes to negative sign, and later for the opposite changes. Moreover, a change of sign in either of the sequences corresponds not necessarily to a change of sign (in the strict sense, i.e., regarding 0 as a number with the same sign as the preceding term) in the other one. - M. F. Hasler, Oct 09 2011

Crossrefs

Concerning zeros or changes of sign, see also A096449 and A275939.

Programs

  • Maple
    A173950 := proc(n) if (ithprime(n)+1) mod 6 = 0 then 1; elif (ithprime(n)-1) mod 6 = 0 then -1; else 0 ; end if; end proc:
    A174695 := proc(n) add(A173950(i),i=1..n) ; end proc:
    seq(A174695(n),n=1..90) ; # R. J. Mathar, Nov 30 2010
  • Mathematica
    Accumulate[Table[Which[Divisible[Prime[n]+1,6],1,Divisible[Prime[n]-1,6],-1,True,0],{n,150}]] (* Harvey P. Dale, Apr 24 2019 *)
  • PARI
    s=0;forprime(p=1,999,print1(s+=if(p%3-1,p>3,-1)","))  \\ M. F. Hasler, Oct 09 2011

Formula

a(n) = A112632(n)-1. - M. F. Hasler, Oct 09 2011
Showing 1-8 of 8 results.