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.

A156660 Characteristic function of Sophie Germain primes.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Feb 13 2009

Keywords

Crossrefs

Programs

  • Haskell
    a156660 n = fromEnum $ a010051 n == 1 && a010051 (2 * n + 1) == 1
    -- Reinhard Zumkeller, May 01 2012
    
  • PARI
    a(n)=isprime(n)&&isprime(2*n+1) \\ Felix Fröhlich, Aug 11 2014

Formula

a(n) = if n and also 2*n+1 is prime then 1 else 0.
a(A005384(n)) = 1; a(A138887(n)) = 0; a(A053176(n)) = 0.
A156874(n) = Sum_{k=1..n} a(k). - Reinhard Zumkeller, Feb 18 2009
a(n) = A010051(n)*A010051(2*n+1).
For n>1 a(n) = floor((floor(phi(n)/(n-1)) + floor(phi(2*n+1)/(2*n)))/2). - Enrique Pérez Herrero, Apr 28 2012
For n>1 a(n) = floor(phi(2*n^2+n)/(2*n^2-2*n)). - Enrique Pérez Herrero, May 02 2012

Extensions

Definition corrected by Daniel Forgues, Aug 04 2009