login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A156659 Characteristic function of safe primes. 14
0, 0, 0, 0, 0, 1, 0, 1, 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, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
LINKS
Wikipedia, Safe prime
FORMULA
a(n) = if n and also (n-1)/2 is prime then 1 else 0;
a(A005385(n)) = 1; a(A156657(n)) = 0; a(A059456(n)) = 0.
a(n) = A010051(n)*A010051((n-1)/2).
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
Sequence in context: A202238 A144194 A144196 * A011671 A086483 A337383
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Feb 13 2009
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)