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.

A137894 Limiting sequence when we start with positive integers (A000027) and at step n >= 1 add to the term at position n + a(n) the value n.

Original entry on oeis.org

1, 3, 3, 4, 7, 9, 7, 12, 9, 10, 11, 17, 13, 21, 21, 16, 17, 27, 19, 38, 21, 33, 23, 24, 25, 39, 27, 28, 41, 30, 31, 48, 33, 51, 49, 51, 37, 57, 39, 40, 41, 63, 43, 44, 63, 69, 47, 72, 49, 75, 51, 52, 53, 81, 77, 84, 57, 78, 59, 90, 61, 93, 63, 64, 91, 99, 67, 68, 69, 99
Offset: 1

Views

Author

Ctibor O. Zizka, Apr 30 2008

Keywords

Crossrefs

Programs

  • Maple
    mx:= 10000: # maximal index needed
    b:= proc(n) n end:
    a:= proc(n) option remember; global mx; local h, t;
          if n=0 then 0 else a(n-1); t:= b(n);
            if n+t<=mx then h:=b(t+n); b(t+n):=h+n fi; t
          fi
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Mar 04 2015
  • Mathematica
    mx = 10000 (* maximal index needed *); b[n_] := n; a[n_] := a[n] = Module[{h, t}, If[n == 0, 0, a[n-1]; t = b[n]; If[n+t <= mx, h = b[t+n]; b[t+n] = h+n]; t]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Oct 24 2016, after Alois P. Heinz *)
  • Python
    TOP = 1000
    a = [1]*TOP
    for n in range(1,TOP):
      a[n]=n
    for n in range(1,TOP):
      print(str(a[n]),end=',')
      if n+a[n]Alex Ratushnyak, Nov 22 2013

Formula

Limiting sequence when we start with positive integers (A000027) and at step n >= 1 add to the term at position n + a(n) the value n.

Extensions

More terms from Alex Ratushnyak, Nov 22 2013.