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.

A075325 Pair the natural numbers such that the m-th pair is (r, s) where r, s and s-r are the smallest numbers which have not occurred earlier and also are not equal to the difference of any earlier pair: (1, 3), (4, 9), (6, 13), (8, 18), (11, 23), (14, 29), (16, 33), (19, 39), (21, 43), (24, 49), (26, 53), (28, 58), ... Sequence gives first term of each pair.

Original entry on oeis.org

1, 4, 6, 8, 11, 14, 16, 19, 21, 24, 26, 28, 31, 34, 36, 38, 41, 44, 46, 48, 51, 54, 56, 59, 61, 64, 66, 68, 71, 74, 76, 79, 81, 84, 86, 88, 91, 94, 96, 99, 101, 104, 106, 108, 111, 114, 116, 118, 121, 124, 126, 128, 131, 134, 136, 139, 141, 144, 146, 148, 151, 154, 156
Offset: 1

Views

Author

Amarnath Murthy, Sep 16 2002

Keywords

Comments

Most of the pairs are of the form (r,2r+1) except for the ones like a(4) = (8,18) and a(12) = (28,58) and (38,78) etc. which are of the form (r,2r +2).

Examples

			The first pair (1, 3) covers 1, 2, 3. The second pair is (4, 9) covering 4, 5, 9.
		

Crossrefs

The sequence formed by listing the differences between the second and first elements of each pair is A047215.

Programs

  • Mathematica
    (* Here, the offset for (a(n)) is 0. *)
    z = 200;
    mex[list_, start_] := (NestWhile[# + 1 &, start, MemberQ[list, #] &]);
    a = {}; b = {}; c = {};
    Do[AppendTo[a,
       mex[Flatten[{a, b, c}], If[Length[a] == 0, 1, Last[a]]]];
      AppendTo[b, mex[Flatten[{a, b, c}], Last[a]]];
      AppendTo[c, Last[a] + Last[b]], {z}];
    Take[a, 100] (* A075325 *)
    Take[b, 100] (* A047215 *)
    Take[c, 100] (* A075326 *)
    Grid[{Join[{"n"}, Range[0, 20]], Join[{"a(n)"}, Take[a, 21]],
      Join[{"b(n)"}, Take[b, 21]], Join[{"c(n)"}, Take[c, 21]]},
     Alignment -> ".",
     Dividers -> {{2 -> Red, -1 -> Blue}, {2 -> Red, -1 -> Blue}}]
    (* Peter J. C. Moses, Apr 26 2018 *)
  • PARI
    used = vector(500); i = 1; A = vector(80); B = A; C = A; for (n = 1, 80, while (used[i], i++); j = i + 1; while (used[j] || used [i + j], j++); A[n] = i; B[n] = i + j; C[n] = i + i + j; used[i] = 1; used[j] = 1; used[i + j] = 1); A \\ David Wasserman, Jan 16 2005

Formula

Let A(n) = A007814(n). Let B(n) = A(n) + 1 if A(n) < 2; B(n) = 0 if A(n)>=2 & A(n) is even; B(n) = 2 if A(n) >= 2 & A(n) is odd. Then a(n) = (5n+B(n)-4)/2. - John Chew (jjchew(AT)math.utoronto.ca), Jun 20 2006

Extensions

More terms from David Wasserman, Jan 16 2005