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.

A278055 Relative of Hofstadter Q-sequence: a(1) = 1, a(2) = 2, a(3) = 3, a(4) = 4, a(5) = 5; a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3)) for n > 5.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 17, 18, 18, 19, 20, 21, 21, 22, 23, 24, 24, 25, 26, 26, 27, 27, 28, 29, 30, 30, 31, 32, 33, 33, 34, 35, 35, 36, 36, 37, 38, 39, 39, 40, 41, 42, 42, 43, 44, 44, 45, 45, 46, 47, 48, 48, 49, 50, 50, 51
Offset: 1

Views

Author

Nathan Fox, Nov 10 2016

Keywords

Comments

This sequence is monotonic, with successive terms increasing by 0 or 1. So the sequence hits every positive integer.
A number k appears twice in this sequence if and only if for some i, k is congruent to A057198(i) mod 3^i and k > A057198(i).

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = a[n - a[n -1]] + a[n - a[n -2]] + a[n - a[n -3]]; a[1] = 1; a[2] = 2; a[3] = 3; a[4] = 4; a[5] = 5; Array[a, 71] (* Robert G. Wilson v, Dec 02 2016 *)
  • PARI
    A=Vecsmall([]);
    a(n)=if(n<7, return(n)); if(#ACharles R Greathouse IV, Nov 19 2016

Formula

a(n) ~ 2n/3.