login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A101264 a(n) = 1 if 2*n + 1 is prime, otherwise a(n) = 0. 16
0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,1

COMMENTS

Inverse Mobius transform of the sequence, after dropping a(0), yields A086668. - R. J. Mathar, Jan 25 2009

If we drop a(0) then we may describe the sequence as: for all numbers k(n) [k(n) = 4 ceiling(n/2) + (-1)^n] congruent to -1 or +1 (mod 4) starting with k(n) = {3,5,7,9,11,...}, a(k(n)) is 1 if k(n) is prime and 0 if k(n) is composite. - Daniel Forgues, Mar 01 2009

REFERENCES

D. H. Lehmer, "Computer Technology Applied to the Theory of Numbers," from Studies in Number Theory, ed. William J. LeVeque. Englewood Cliffs, New Jersey: Prentice Hall (1969): 138.

LINKS

Daniel Forgues, Table of n, a(n) for n=0..49999

FORMULA

a(n) = A057427(A085090(n+1)). - Reinhard Zumkeller, Sep 14 2006

For n > 0, a(n) = (2n-1)! mod (2n+1). - Thomas Ordowski, Jul 23 2016

a(n) = pi(2*n+1) - pi(2*n), where pi(n) = A000720(n). - Ridouane Oudra, Aug 25 2019

EXAMPLE

a(1) = 1 because 2*1+1 = 3 is prime;

a(2) = 1 because 2*2+1 = 5 is prime;

a(3) = 1 because 2*3+1 = 7 is prime;

a(4) = 0 because 2*4+1 = 9 is composite.

MAPLE

with(numtheory): a:= proc(n) if isprime(2*n+1)=true then 1 else 0 fi end:

seq(a(n), n=0..80); # Ridouane Oudra, Aug 25 2019

MATHEMATICA

Table[If[PrimeQ[2n + 1], 1, 0], {n, 0, 104}] (* Ray Chandler, Jan 09 2005 *)

Table[Boole[PrimeQ[n]], {n, 1, 209, 2}] (* Alonso del Arte, Sep 25 2012 *)

PROG

(MAGMA) [IsPrime(2*n+1) select 1 else 0: n in [1..100]]; // Marius A. Burtea, Aug 25 2019

(PARI) first(n) = {my(res = vector(n)); forprime(p = 3, 2*n - 1, res[p \ 2] = 1); res} \\ David A. Corneth, Aug 25 2019

CROSSREFS

Bisection (odd n) of A010051.

Cf. A065091, A063524, A000720.

If we drop a(0), equals absolute value of A156707. - Daniel Forgues, Mar 01 2009

Sequence in context: A165191 A189576 A112448 * A189723 A095770 A285972

Adjacent sequences:  A101261 A101262 A101263 * A101265 A101266 A101267

KEYWORD

easy,nonn

AUTHOR

Giovanni Teofilatto, Dec 18 2004

EXTENSIONS

Corrected by Ray Chandler, Jan 09 2005

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 31 03:48 EDT 2021. Contains 346367 sequences. (Running on oeis4.)