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.

A172103 Partial sums of A167020 where A167020(n)=1 iff 6*n-1 is prime.

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Jan 25 2010

Keywords

Comments

Where A167020 is the characteristic sequence: A167020(n)=1 iff 6*n-1 is prime.

Crossrefs

Programs

  • Mathematica
    Accumulate[Table[If[PrimeQ[6 n-1],1,0],{n,100}]] (* Harvey P. Dale, Dec 27 2022 *)
  • PARI
    ism(n) = isprime(6*n-1); \\ A167020
    a(n) = sum(k=1, n, ism(k)); \\ Michel Marcus, Feb 06 2019

Extensions

Entries checked by R. J. Mathar, Apr 14 2010

A172105 Numbers k such that k-th partial sum of A167020 - k-th partial sum of A167021 = 0 (or A172103(k) - A172104(k) = 0).

Original entry on oeis.org

1, 2, 3, 6, 7, 13, 27, 37, 38
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 25 2010

Keywords

Comments

No further terms between 38 and 1500000. [From R. J. Mathar, May 02 2010]

Crossrefs

Extensions

Corrected (13 inserted, terms in the range 297 to 316 removed) by R. J. Mathar, May 02 2010

A167021 a(n) = 1 iff 6n+1 is prime.

Original entry on oeis.org

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

Views

Author

Washington Bomfim, Oct 27 2009

Keywords

Examples

			a(3) = 1 because 6*3+1 is prime;
a(4) = 0 since 6*4+1 is composite.
		

Crossrefs

Cf. A024899, A167020, A132350. For n < 14, a(n) = A132350(n).

Programs

  • Magma
    [IsPrime(6*n+1) select 1 else 0:n in [1..105]]; // Marius A. Burtea, Oct 06 2019
  • Mathematica
    If[PrimeQ[6#+1],1,0]&/@Range[120] (* Harvey P. Dale, Apr 03 2012 *)
  • PARI
    a(n) = isprime(6*n+1); \\ Michel Marcus, Jan 19 2019
    

A340767 Number of primes p <= 6*n + 5 that are congruent to 2 modulo 3.

Original entry on oeis.org

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

Views

Author

Jianing Song, Apr 28 2021

Keywords

Examples

			There are 14 primes <= 6*16+5 = 101 that are congruent to 2 modulo 3, namely 2, 5, 11, 17, 23, 29, 41, 47, 53, 59, 71, 83, 89, 101, so a(16) = 14.
		

Crossrefs

Programs

  • PARI
    a(n) = sum(i=1, 6*n+5, isprime(i) && (i%3==2))

Formula

a(n) = A340764(6*n+5).
a(n) = 1 + Sum_{k=0..n+1} A167020(k).

A323011 a(n) = A172103(n) - A172104(n).

Original entry on oeis.org

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

Views

Author

Torlach Rush, Jan 01 2019

Keywords

Examples

			a(1) = A172103(1) - A172104(1) = 0.
a(2) = A172103(2) - A172104(2) = 0.
a(3) = A172103(3) - A172104(3) = 0.
a(4) = A172103(4) - A172104(4) = 1.
		

Crossrefs

Programs

  • Maple
    f:= proc(t) `if`(isprime(6*t-1),1,0) - `if`(isprime(6*t+1),1,0) end proc:
    ListTools:-PartialSums(map(f, [$1..100])); # Robert Israel, Feb 19 2019
  • Mathematica
    Accumulate@ Boole@ PrimeQ[6 Range@ # - 1] - Accumulate@ Boole@ PrimeQ[6 Range@ # + 1] &@ 60 (* Michael De Vlieger, Jan 27 2019 *)
  • PARI
    isp(n) = isprime(6*n+1); \\ A167021
    ism(n) = isprime(6*n-1); \\ A167020
    psisp(n) = sum(k=1, n, isp(k)); \\ A172104
    psism(n) = sum(k=1, n, ism(k)); \\ A172103
    a(n) = psism(n) - psisp(n); \\ Michel Marcus, Jan 18 2019

Extensions

More terms from Michel Marcus, Feb 01 2019
Showing 1-5 of 5 results.