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!)
A129951 Sum of characteristic function of twin primes < 10^n. 0
2, 5, -30, -411, -4698, -45824, -428661 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Table of n, a(n) for n=1..7.

FORMULA

Let t(x) = 1 if m is a twin prime member, 0 if isolated prime or -1 if not prime. then a(n) = sum(x=1,10^n,t(x)).

PROG

(PARI) for(j=1, 10, print1(sum(x=1, 10^j, t(x))", ")) t(n) = if(abs(istwin(n))==1||n==5, 1, if(isprime(n), -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))

CROSSREFS

Sequence in context: A019027 A019031 A140786 * A127298 A275255 A219273

Adjacent sequences:  A129948 A129949 A129950 * A129952 A129953 A129954

KEYWORD

sign

AUTHOR

Cino Hilliard, Jun 10 2007

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 August 8 19:29 EDT 2020. Contains 336298 sequences. (Running on oeis4.)