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.

A240809 a(n) = n for 1 <= n <= 4; thereafter a(n) = a(n - a(n-2)) + a(n - a(n-4)).

Original entry on oeis.org

1, 2, 3, 4, 6, 6, 5, 6, 7, 8, 10, 10, 9, 10, 12, 12, 12, 12, 10, 12, 17, 16, 15, 16, 14, 16, 19, 20, 20, 18, 20, 20, 18, 22, 24, 22, 19, 24, 24, 24, 28, 24, 22, 24, 27, 32, 26, 28, 31, 28, 26, 32, 35, 32, 32, 32, 30, 32, 39, 40, 36, 34, 35, 34, 38, 40, 40, 42, 40, 38, 40, 40, 36, 44, 48, 42, 48, 44, 40, 46, 46, 46, 41, 48, 48, 48, 56, 48, 46, 48, 51, 48
Offset: 1

Views

Author

N. J. A. Sloane, Apr 15 2014, Apr 17 2014

Keywords

Comments

Conjectured to be infinite.

References

  • D. R. Hofstadter, Curious patterns and non-patterns in a family of meta-Fibonacci recursions, Lecture in Doron Zeilberger's Experimental Mathematics Seminar, Rutgers University, April 10 2014.

Crossrefs

Cf. A240821.

Programs

  • Magma
    I:=[1, 2, 3, 4]; [n le 4 select I[n] else Self(n-Self(n-2))+Self(n-Self(n-4)): n in [1..100]]; // Vincenzo Librandi, Apr 16 2014
  • Maple
    # Q(r,s) with initial values 1,2,3,4,...
    r:=2; s:=4;
    a:=proc(n) option remember; global r,s;
    if n <= s then n
    else
        if (a(n-r) <= n) and (a(n-s) <= n) then
        a(n-a(n-r))+a(n-a(n-s));
        else lprint("died with n =",n); return (-1);
        fi;
    fi; end;
    [seq(a(n),n=1..100)];