A171576 a(n) = abs(n-th noncomposite number minus n-th even nonprime number).
1, 2, 3, 3, 3, 1, 1, 1, 1, 3, 7, 7, 11, 13, 13, 15, 19, 23, 23, 27, 29, 29, 33, 35, 39, 45, 47, 47, 49, 49, 51, 63, 65, 69, 69, 77, 77, 81, 85, 87, 91, 95, 95, 103, 103, 105, 105, 115, 125, 127, 127, 129, 133, 133, 141, 145, 149, 153, 153, 157, 159, 159, 167, 179, 181
Offset: 1
Keywords
Examples
a(1) = abs(1-0) = 1, a(2) = abs(2-4) = 2, a(3) = abs(3-6) = 3.
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
Module[{nn=400,nc,enp,len},nc=Select[Range[nn],!CompositeQ[#]&];enp= Join[{0},Range[4,nn,2]];len=Min[Length[nc],Length[enp]];Abs[#[[1]]- #[[2]]]&/@Thread[{Take[nc,len],Take[enp,len]}]] (* Harvey P. Dale, Mar 01 2020 *)
Extensions
Corrected (a 67 replaced by another 69) by R. J. Mathar, May 22 2010