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.

A062301 Number of ways writing n-th prime as a sum of two primes.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Jul 05 2001

Keywords

Comments

a(n) = 1 if and only if n is in A006512. - Robert Israel, Apr 04 2018

Crossrefs

Programs

  • GAP
    P:=Filtered([1..1000],IsPrime);; a:=List(List(List(P, i -> Partitions(i,2)), k -> Filtered(k, i -> IsPrime(i[1]) and IsPrime(i[2]))),Length); # Muniru A Asiru, Apr 05 2018
  • Maple
    a:= n-> `if`(isprime(ithprime(n)-2), 1, 0):
    seq(a(n), n=1..105);  # Alois P. Heinz, Oct 02 2020
  • Mathematica
    Table[Sum[(PrimePi[Prime[n] - i] - PrimePi[Prime[n] - i - 1]) (PrimePi[i] - PrimePi[i - 1]), {i, Floor[Prime[n]/2]}], {n, 100}] (* Wesley Ivan Hurt, Apr 04 2018 *)
  • PARI
    a(n) = isprime(prime(n) - 2) \\ David A. Corneth, Apr 04 2018
    

Extensions

Offset changed to 1 by David A. Corneth, Apr 04 2018