OFFSET
1,1
FORMULA
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]
PROG
(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));
t(n) = if(abs(istwin(n))==1||n==5, 1, if(isprime(n), -1, 0));
for(j=1, 10, print1(sum(x=1, 10^j, t(x))", "));
CROSSREFS
KEYWORD
sign,more
AUTHOR
Cino Hilliard, Jun 10 2007
EXTENSIONS
a(8)-a(18) from Amiram Eldar, Jun 30 2024
STATUS
approved