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!)
A129951 Sum of characteristic function of twin primes < 10^n. 0

%I #9 Jun 30 2024 03:30:08

%S 2,5,-30,-411,-4698,-45824,-428661,-4000209,-37149512,-345401797,

%T -3220550623,-30125571140,-282726877353,-2661820464144,

%U -25135733453455,-238021558244735,-2259761800241599,-21505250733431118

%N Sum of characteristic function of twin primes < 10^n.

%F Let t(m) = 1 if m is a twin prime member, -1 if isolated prime or 0 if not prime. Then a(n) = Sum_{k=1..10^n} t(k). [Corrected by _Amiram Eldar_, Jun 30 2024]

%F a(n) = 4*A007508(n) - A006880(n) - 2. - _Amiram Eldar_, Jun 30 2024

%o (PARI) 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 t(n) = if(abs(istwin(n))==1||n==5, 1, if(isprime(n), -1, 0));

%o for(j=1, 10, print1(sum(x=1, 10^j, t(x))", "));

%Y Cf. A001097, A006880, A007508, A007510.

%K sign,more

%O 1,1

%A _Cino Hilliard_, Jun 10 2007

%E a(8)-a(18) from _Amiram Eldar_, Jun 30 2024

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 September 7 03:03 EDT 2024. Contains 375728 sequences. (Running on oeis4.)