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.

A246964 Limiting sequence of transformations when we start with the all 1's sequence a=A000012 and at step n>=0 replace a(n+a(n)) with Sum_{k=n..n+a(n)} a(k).

Original entry on oeis.org

1, 2, 1, 5, 1, 2, 1, 5, 10, 1, 2, 1, 23, 1, 2, 1, 5, 1, 39, 1, 2, 47, 50, 1, 2, 1, 5, 1, 2, 1, 5, 10, 1, 2, 1, 105, 1, 2, 1, 5, 1, 121, 1, 2, 129, 132, 1, 2, 1, 5, 1, 2, 1, 5, 10, 1, 2, 206, 432, 1, 2, 1, 5, 1, 449, 1, 2, 457, 889, 1, 2, 1, 820, 1, 2, 1, 5, 1
Offset: 0

Views

Author

Floor van Lamoen, Mar 02 2015

Keywords

Examples

			Start . . . . . . . . . . . . . . . . .       : 1,1,1,1,1,...
Step 0: a(0+a(0)) = a(1)<- a(0)+a(1) = 2      : 1,2,1,1,1,...
Step 1: a(1+a(1)) = a(3)<- a(1)+a(2)+a(3) = 4 : 1,2,1,4,1,...
Step 2: a(2+a(2)) = a(3)<- a(2)+a(3) = 5      : 1,2,1,5,1,...
		

Programs

  • Maple
    mx:= 20000:  # maximal index needed
    b:= proc() 1 end:
    a:= proc(n) option remember; global mx; local t;
          if n<0 then 0 else a(n-1); t:= b(n);
            if n+t<= mx then b(n+t):= add(b(k), k=n..n+t) fi; t
          fi
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Mar 04 2015
  • Mathematica
    mx = 20000; (* Maximal index needed *)
    b[_] = 1;
    a[n_] := a[n] = Module[{t}, If[n<0, 0, t = b[n]; If[n+t <= mx, b[n+t] = Sum[b[k], {k, n, n+t}]]; t]];
    a /@ Range[0, 100] (* Jean-François Alcover, Nov 13 2020, after Alois P. Heinz *)