login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A129950 Indicator function of twin primes: 1 if twin prime member, 0 if not prime, -1 else (isolated prime or 2). 1

%I

%S 0,-1,1,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,-1,0,0,0,0,0,1,0,1,0,0,

%T 0,0,0,-1,0,0,0,1,0,1,0,0,0,-1,0,0,0,0,0,-1,0,0,0,0,0,1,0,1,0,0,0,0,0,

%U -1,0,0,0,1,0,1,0,0,0,0,0,-1,0,0,0,-1,0,0,0,0,0,-1,0,0,0,0,0,0,0,-1,0,0,0

%N Indicator function of twin primes: 1 if twin prime member, 0 if not prime, -1 else (isolated prime or 2).

%C Absolute values are the same as A010051.

%o (PARI) for(j=1,100,print1(t(j)",")) t(x) = if(abs(istwin(x))==1||x==5,1,if(isprime(x),-1,0)) istwin(n) = local(p1, p2); if(n==5,return(2));if(isprime(n),p1=n-2;p2=n+2; if(isprime(p1),return(1));if(isprime(p2),return(-1));return(0))

%o (PARI) a(n)=if(isprime(n),(-1)^(!isprime(n-2) & !isprime(n+2),0)

%K sign

%O 1,1

%A Cino Hilliard (hillcino368(AT)hotmail.com), Jun 10 2007

%E Definition and a(67) corrected by M. F. Hasler, Jan 20 2012

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified May 22 13:19 EDT 2013. Contains 225548 sequences.