OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
7(4) - 6(4) = 1 (nonprime) and 7(4) + 6(4) = 13 (prime), so 7 is in the sequence.
31(11) - 16(11) = 15 (nonprime) and 31(11) + 16(11) = 47 (prime), so 31 is in the sequence.
41(13) - 20(13) = 21 (nonprime) and 41(13) + 20(13) = 61 (prime), so 41 is in the sequence.
101(26) - 36(20) = 65 (nonprime) and 101(26) + 36(26) = 137 (prime), so 101 is in the sequence.
109(29) - 40(29) = 69 (nonprime) and 109(29) + 40(29) = 149 (prime), so 109 is in the sequence.
MAPLE
A141468 := proc(n) option remember; local a; if n = 1 then 0; else for a from procname(n-1)+1 do if not isprime(a) then return a; end if; od: end if; end proc: A144517 := proc(n) option remember; local p, i; if n = 1 then 7; else p := nextprime(procname(n-1)) ; while true do i := numtheory[pi](p) ; if not isprime(p-A141468(i)) and isprime(p+A141468(i)) then return p; fi; p := nextprime(p) ; end do: end if; end: seq(A144517(n), n=1..80) ; # R. J. Mathar, Oct 22 2009
MATHEMATICA
Module[{pr=Prime[Range[1000]], npr, len}, npr=Complement[Range[0, Last[pr]], pr]; len=Min[Length[pr], Length[npr]]; Transpose[Select[Thread[ {Take[pr, len], Take[npr, len]}], !PrimeQ[First[#]-Last[#]]&&PrimeQ[Total[#]]&]][[1]]] (* Harvey P. Dale, Aug 24 2012 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Dec 15 2008
EXTENSIONS
Roughly 20 percent of the entries corrected by R. J. Mathar, Oct 22 2009
Better definition from Michel Marcus, Aug 07 2017
STATUS
approved