OFFSET
1,1
COMMENTS
Are there infinitely many such primes?
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
The 6th prime is 13, the 6th nonprime is 10, 13 + 10 = 23 so 23 is in this sequence.
MAPLE
Primes, Nonprimes:= selectremove(isprime, [$1..10^5]):
select(isprime, Primes + Nonprimes[1..nops(Primes)]); # Robert Israel, Jul 08 2016
MATHEMATICA
primepcomp[n_] := Reap[For[x = 1, x <= n, x++, y = Prime[x] + composite[x]; If[PrimeQ[y], Sow[y]]]][[2, 1]]; composite[n_] := Module[{c = 1, x = 0}, While[c <= n, x++; If[!PrimeQ[x], c++]]; x]; primepcomp[300] (* Jean-François Alcover, Nov 18 2013, translated from Pari *)
nn = 262; Select[Total /@ Transpose@ {#, Take[Complement[Range@ Prime@ nn, #], nn]} &@ Prime@ Range@ nn, PrimeQ] (* Michael De Vlieger, Jul 08 2016 *)
PROG
(PARI) composite(n)= local(c, x); c=1; x=0; while(c <= n, x++; if(!isprime(x), c++); ); x
primepcomp(n) = for(x=1, n, y=prime(x)+ composite(x); if(isprime(y), print1(y", ")))
(PARI) list(lim)=my(v=List([3]), n=4, p=3, t); while((t=n+p)<=lim, if(isprime(t), listput(v, t)); p=nextprime(p+1); if(isprime(n++), n++)); Vec(v) \\ Charles R Greathouse IV, Sep 01 2016
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Aug 23 2004
EXTENSIONS
Name corrected by Adam Kubias, Jul 08 2016
STATUS
approved