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.

A258049 Position of n in A258047 after deleting the initial 0.

Original entry on oeis.org

1, 2, 4, 5, 7, 9, 11, 14, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 36, 38, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125
Offset: 1

Views

Author

Clark Kimberling, Jun 05 2015

Keywords

Comments

A258047 = (0,1,2,-1,3,6,-7,5,-3,7,...). Remove the initial 0 to get (1,2,-1,3,6,-7,5,6,-3,7,...), and note that (1,2,3,4,...) occupy positions 1,2,4,7,..., (as in A258049) and that (-1,-2,-3,...) occupy positions 3,6,8,... (as in A258050).

Crossrefs

Cf. A258047, A258050 (complement).

Programs

  • Mathematica
    {a, f} = {{1}, {0}}; Do[tmp = {#, # - Last[a]} &[Min[Complement[#, Intersection[a, #]]&[Last[a] + Complement[#, Intersection[f, #]] &[Range[2 - Last[a], -1]]]]];
    If[! IntegerQ[tmp[[1]]], tmp = {Last[a] + #, #} &[NestWhile[# + 1 &, 1, ! (! MemberQ[f, #] && ! MemberQ[a, Last[a] - #]) &]]];
    AppendTo[a, tmp[[1]]]; AppendTo[f, tmp[[2]]], {500}];
    -1 + Flatten[Position[Sign[f], 1]] (* A258049 *)
    -1 + Flatten[Position[Sign[f], -1]] (* A258050 *) (* Peter J. C. Moses, May 14 2015 *)