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.

A280875 Set a(1)=0, a(2)=1, a(3)=3; b(1)=1, b(2)=2; c(1)=3. Thereafter, a(n) is the smallest positive integer m such that m is not yet in sequence a, m-a(n-1) is not yet in sequence b, and m-a(n-2) is not yet in sequence c; set b(n-1)=m-a(n-1), c(n-2)=m-a(n-2).

Original entry on oeis.org

0, 1, 3, 2, 5, 9, 4, 13, 10, 6, 18, 11, 16, 7, 25, 17, 15, 28, 12, 19, 27, 8, 14, 24, 35, 49, 20, 37, 52, 21, 44, 33, 23, 47, 41, 29, 54, 70, 22, 42, 61, 36, 78, 31, 53, 74, 30, 57, 83, 26, 56, 84, 32, 64, 51, 34, 71, 100, 38, 81, 60, 40, 86, 63, 39, 87, 69, 43
Offset: 1

Views

Author

Luca Petrone, May 14 2018

Keywords

Examples

			For n=4: m=2 works, because 2 is not in a, 2-3=-1 is not in b, and 2-1=1 is not in c; set a(4)=2, b(3)=-1 and c(2)=1.
For n=5: m=5 works, because 5 is not in a, 5-2=3 is not in b, and 5-3=2 is not in c; set a(5)=5, b(4)=3 and c(3)=2.
		

Crossrefs

Cf. A257883, A308000 (b), A308001 (c).

Programs

  • Mathematica
    a = {0, 1};
    d1 = {1};
    d2 = {};
    For[n = 3, n <= 10000, n++,
    For[t = Min[Complement[Range[Max[n]], a]], t <= Infinity, t++,
    If[MemberQ[a, t] == False,
    If[MemberQ[d1, t - a[[n - 1]]] == False && MemberQ[d2, t - a[[n - 2]]] == False,Break[];]]];
    a = Flatten[Append[a, t]];
    d1 = Flatten[Append[d1, t - a[[n - 1]]]];
    d2 = Flatten[Append[d2, t - a[[n - 2]]]];]

Extensions

Edited by N. J. A. Sloane, Jun 25 2018.