login
A100298
Similar to Cald's sequence (A006509), but move by the n-th composite instead of by the n-th prime.
2
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,2
EXAMPLE
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.
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 *)
CROSSREFS
Sequence in context: A125683 A125685 A098147 * A066461 A351654 A117069
KEYWORD
nonn
AUTHOR
Leroy Quet, Oct 13 2005
EXTENSIONS
More terms from Klaus Brockhaus, Oct 17 2005
STATUS
approved