login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A144517
Primes p=prime(k) such that p - nonprime(k) is nonprime and p + nonprime(k) is prime, where prime(n) is the n-th prime and nonprime(n) is the n-th nonprime starting with nonprime(1) = 0.
2
7, 23, 31, 41, 101, 109, 227, 241, 311, 347, 389, 587, 701, 757, 859, 947, 977, 1063, 1069, 1123, 1181, 1229, 1237, 1289, 1303, 1327, 1451, 1489, 1543, 1559, 1613, 1669, 1733, 1787, 1879, 2011, 2029, 2039, 2203, 2213, 2281, 2357, 2393, 2459, 2503, 2593
OFFSET
1,1
LINKS
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
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