A161811 Difference between nonprime(n+2) and nonprime(n).
4, 5, 4, 3, 2, 3, 4, 3, 2, 3, 4, 3, 2, 3, 3, 2, 2, 2, 3, 4, 3, 2, 2, 2, 3, 3, 2, 3, 4, 3, 2, 3, 3, 2, 2, 2, 3, 3, 2, 2, 2, 3, 4, 3, 2, 2, 2, 3, 3, 2, 3, 4, 3, 2, 2, 2, 3, 3, 2, 3, 3, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 3, 3, 2, 3, 4, 3, 2, 3, 4, 3, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2, 3, 3, 2, 2, 2, 3, 4
Offset: 1
Keywords
Examples
nonprime(1+2)-nonprime(1) = 4-0; so a(1) = 4. nonprime(5+2)-nonprime(5) = 10-8; so a(5) = 2. nonprime(11+2)-nonprime(11) = 20-16; so a(11) = 4.
Programs
-
Mathematica
#[[3]]-#[[1]]&/@Partition[Select[Range[0,150],!PrimeQ[#]&],3,1] (* Harvey P. Dale, Jul 08 2022 *)
Extensions
Edited, corrected (a(11)=2 replaced by 4) and extended by Klaus Brockhaus, Jun 24 2009
Comments