A158866 Indices of twin primes if the sum of these twin primes+1 is an upper twin prime.
2, 5, 30, 31, 66, 73, 88, 91, 141, 147, 217, 513, 607, 637, 743, 760, 784, 845, 856, 911, 920, 938, 949, 958, 994, 1015, 1031, 1092, 1150, 1246, 1373, 1470, 1553, 1586, 1768, 1814, 1871, 2017, 2029, 2129, 2261, 2271, 2331, 2370, 2458, 2488, 2510, 2545, 2579
Offset: 1
Keywords
Examples
The 30th lower twin prime is 659. 659+661+1 = 1321, prime and 1319 is too. Then 1319 is the lower member of the twin prime pair (1319,1321). So 30 is in the sequence.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A158870.
Programs
-
Maple
count:= 0: Res:= NULL: k:= 1: for j from 1 while count < 100 do if isprime(6*j-1) and isprime(6*j+1) then k:= k+1; if isprime(12*j-1) and isprime(12*j+1) then count:= count+1; Res:= Res,k; fi fi od: Res; # Robert Israel, Mar 06 2018
-
Mathematica
utpQ[{a_, b_}]:=And@@PrimeQ[a + b + {1, -1}]; Flatten[Position[Select[ Partition[Prime[Range[25000]],2,1],#[[2]]-#[[1]]==2&],?utpQ]] (* _Harvey P. Dale, Sep 16 2013 *)
-
PARI
twinl(n) = { local(c,x); c=0; x=1; while(c
Formula
Extensions
Edited by R. J. Mathar, Apr 06 2009
Comments