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.

A284644 a(1) = a(2) = 2, a(3) = 1; a(n) = a(n-a(n-1)) + a(n-a(n-2)) for n > 3.

Original entry on oeis.org

2, 2, 1, 3, 5, 3, 5, 6, 4, 6, 10, 5, 7, 9, 9, 10, 11, 11, 12, 10, 14, 11, 9, 16, 14, 11, 17, 21, 11, 16, 19, 17, 19, 20, 19, 21, 21, 22, 22, 22, 24, 21, 23, 23, 22, 25, 25, 18, 35, 26, 24, 32, 25, 22, 35, 34, 20, 38, 36, 27, 34, 40, 20, 39, 33, 36, 39, 28, 40, 37, 39
Offset: 1

Views

Author

Altug Alkan, Mar 31 2017

Keywords

Comments

A "brother" to Hofstadter's Q-sequence (A005185) and A244477 using with different starting values.

Examples

			a(4) = 3 because a(4) = a(4 - a(3)) + a(4 - a(2)) = a(3) + a(2) = 3.
		

Crossrefs

Programs

  • Maple
    A284644:= proc(n) option remember; procname(n-procname(n-1)) +procname(n-procname(n-2)) end proc:
    A284644(1):= 2: A284644(2):= 2: A284644(3):= 1:
    map(A284644, [$1..1000]);
  • Mathematica
    a[1] = a[2] = 2; a[3] = 1; a[n_] := a[n] = a[n - a[n - 1]] + a[n - a[n - 2]]; Table[a@ n, {n, 72}] (* Michael De Vlieger, Apr 02 2017 *)
  • PARI
    a=vector(1000); a[1]=a[2]=2; a[3]=1; for(n=4, #a, a[n] = a[n-a[n-1]]+a[n-a[n-2]]); a