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.

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