OFFSET
1,1
COMMENTS
This sequence contains no 0's between x=1 to 33000. The interval [PIPS3(4133), PIPS3(4134)] contains 1 twin prime pair; the interval [PIPS3(8268), PIPS3(8269)] contains 2 twin prime pairs.
FORMULA
PIPS3(x) = A049090(x) = the x-th prime-indexed prime of order 3 = prime(prime(prime(prime(x)))) where prime(x) is the x-th prime. a(n) = count of twins in [PIPS3(n), PIPS3(n+1)].
EXAMPLE
a(1) = 3, since there are three pairs of twin primes at least PIPS3(1) = 11 and at most PIPS3(2) = 31: (11,13), (17,19), and (29,31).
PROG
(PARI) piptwins3(m, n) = { for(x=m, n, f=1; c=0; p1 = prime(prime(prime(prime(x)))); p2 = prime(prime(prime(prime(x+1)))); forprime(j=p1, p2-2, if(isprime(j+2), f=0; c++) ); print1(c", "); ) }
(Sage)
def PIP(n, i): # Returns the n-th prime-indexed prime of order i.
if i==0:
return primes_first_n(n)[n-1]
else:
return PIP(PIP(n, i-1), 0)
def A088971(n): # Returns a(n)
return len([i for i in range(PIP(n, 3), PIP(n+1, 3), 2) if (is_prime(i) and is_prime(i+2))])
A088971(1) # Danny Rorabaugh, Mar 30 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Cino Hilliard, Oct 30 2003
EXTENSIONS
Edited to count twin pairs entirely within [PIPS3(n), PIPS3(n+1)], rather than pairs with the first prime in that interval. - Danny Rorabaugh, Apr 01 2015
STATUS
approved