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.

A100298 Similar to Cald's sequence (A006509), but move by the n-th composite instead of by the n-th prime.

Original entry on oeis.org

1, 5, 11, 3, 12, 2, 14, 28, 13, 29, 47, 27, 6, 0, 24, 49, 23, 50, 22, 52, 20, 53, 19, 54, 18, 56, 17, 57, 15, 59, 104, 58, 10, 0, 0, 51, 103, 157, 102, 46, 0, 0, 60, 122, 185, 121, 186, 120, 188, 119, 189, 117, 43, 118, 42, 0, 78, 158, 77, 159, 75, 160, 74, 161, 73, 163, 72
Offset: 1

Views

Author

Leroy Quet, Oct 13 2005

Keywords

Examples

			The 4th term is 3 and the 4th composite is 9.
3 - 9 is negative, so instead add 9 to 3 to get 12, which becomes the 5th term because 12 is not among the earlier terms of the sequence.
		

Crossrefs

Programs

  • Mathematica
    composite[n_] := FixedPoint[ n + PrimePi[#] + 1 & , n + PrimePi[n] + 1]; lst = {1}; Do[b = Last[lst]; p = composite[Length[lst]]; If[b > p && ! MemberQ[lst, b - p], AppendTo[lst, b - p], If[ ! MemberQ[lst, b + p], AppendTo[lst, b + p], AppendTo[lst, 0]]], {100}]; lst (* Jean-François Alcover, Nov 15 2013, after A006509 and Robert G. Wilson v *)

Extensions

More terms from Klaus Brockhaus, Oct 17 2005