cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A060253 Numbers n such that difference between n-th prime and n-th composite number is prime.

This page as a plain text file.
%I A060253 #6 Jun 29 2020 11:40:00
%S A060253 1,2,3,4,7,9,10,11,13,14,19,24,25,32,34,37,60,64,65,67,71,75,79,83,87,
%T A060253 95,104,105,111,115,124,130,132,133,138,145,152,153,161,163,166,174,
%U A060253 182,187,188,190,212,213,217,220,243,246,251,255,257,264,275,279,281
%N A060253 Numbers n such that difference between n-th prime and n-th composite number is prime.
%F A060253 Values of n such that A000040(n)-A002808(n)=p(n)-c(n) is a prime number.
%e A060253 n=10: p(10)=29, c(10)=18, c(10)-p(10)=11, so 10=a(7) is here.
%t A060253 f[ n_Integer ] := Block[ {k = n + PrimePi[ n ] + 1}, While[ k - PrimePi[ k ] - 1 != n, k++ ]; k ]; Select[ Range[ 500 ], PrimeQ[ Prime[ # ] - f[ # ] ] & ]
%t A060253 Module[{nn=2000,pr,cm,len,th},pr=Prime[Range[PrimePi[nn]]];cm=Select[ Range[ nn],CompositeQ];len=Min[Length[pr],Length[cm]];th=Thread[{Take[ pr,len],Take[ cm,len]}];Position[th,_?(PrimeQ[Abs[#[[1]]-#[[2]]]]&)]]// Quiet//Flatten (* _Harvey P. Dale_, Jun 29 2020 *)
%Y A060253 Numbers n such that A038529(n) is prime. Cf. A000040, A002808.
%K A060253 easy,nonn
%O A060253 1,2
%A A060253 _Robert G. Wilson v_, Mar 22 2001