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.

A171576 a(n) = abs(n-th noncomposite number minus n-th even nonprime number).

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Dec 12 2009

Keywords

Examples

			a(1) = abs(1-0) = 1, a(2) = abs(2-4) = 2, a(3) = abs(3-6) = 3.
		

Crossrefs

Cf. A008578 (noncomposite), A163300 (even nonprime).

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 *)

Formula

a(n) = abs(A008578(n) - A163300(n)).

Extensions

Corrected (a 67 replaced by another 69) by R. J. Mathar, May 22 2010