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

A172104 Partial sums of A167021 where A167021(n)=1 iff 6*n+1 is prime.

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Jan 25 2010

Keywords

Comments

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

Crossrefs

Programs

  • PARI
    isp(n) = isprime(6*n+1); \\ A167021
    a(n) = sum(k=1, n, isp(k)); \\ Michel Marcus, Feb 06 2019

Extensions

Entries checked by R. J. Mathar, Apr 24 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

A167020 a(n) = 1 iff 6n-1 is prime.

Original entry on oeis.org

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

Views

Author

Washington Bomfim, Oct 27 2009

Keywords

Examples

			a(5) = 1 because 6*5-1 is prime, a(6) = 0 since 6*6-1 is composite.
		

Crossrefs

Programs

  • Magma
    [IsPrime(6*n-1) select 1 else 0: n in[1..100]]; // Vincenzo Librandi, Jan 19 2019
  • Mathematica
    Table[If[PrimeQ[6 n - 1], 1, 0], {n, 100}] (* Vincenzo Librandi, Jan 19 2019 *)
  • PARI
    a(n) = isprime(6*n-1); \\ Michel Marcus, Jan 19 2019
    

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