OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
29 is in the sequence because 29 and 31 are twin primes and prime(prime(29)) = prime(109) = 599, which is a twin prime with 601.
MATHEMATICA
TwinPrimeQ[n_]:=If[PrimeQ[n], If[PrimeQ[n-2]||PrimeQ[n+2], True, False], False](*TwinPrimeQ*) lst={}; Do[If[TwinPrimeQ[Prime[Prime[n]]]&&TwinPrimeQ[n], AppendTo[lst, n]], {n, 7!}]; lst (* Vladimir Joseph Stephan Orlovsky, Sep 07 2008 *)
PROG
(PARI) twips(n) = { c1=0; c2=0; forprime(x=3, n, if(isprime(x+2), c1++); x1=prime(prime(x)); if(isprime(x-2) || isprime(x+2), if(isprime(x1-2) || isprime(x1+2), print1(x", "); c2++; ) ) ); print(); print(c2/c1+.0) }
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Oct 21 2003
STATUS
approved