OFFSET
0,1
LINKS
R. Zumkeller, Table of n, a(n) for n = 0..10000
Wikipedia, Safe prime
FORMULA
a(n) = if n and also (n-1)/2 is prime then 1 else 0;
A156875(n) = Sum_{k=1..n} a(k). - Reinhard Zumkeller, Feb 18 2009
a(n) = 1 iff A292936(n) > 1. - Antti Karttunen, Dec 15 2017
MATHEMATICA
Array[Boole[And[PrimeQ@ #, PrimeQ[(# - 1)/2]]] &, 105, 0] (* Michael De Vlieger, Dec 16 2017 *)
PROG
(Haskell)
a156659 n = fromEnum $ a010051 n == 1 && a010051 (n `div` 2) == 1
-- Reinhard Zumkeller, Sep 18 2011
(PARI) a(n) = isprime(n) && isprime(floor((n-1)/2)) \\ Iain Fox, Dec 17 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Feb 13 2009
STATUS
approved