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.

This page as a plain text file.
%I A137894 #21 May 01 2021 11:43:09
%S A137894 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,
%T A137894 39,27,28,41,30,31,48,33,51,49,51,37,57,39,40,41,63,43,44,63,69,47,72,
%U A137894 49,75,51,52,53,81,77,84,57,78,59,90,61,93,63,64,91,99,67,68,69,99
%N 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.
%H A137894 Alois P. Heinz, <a href="/A137894/b137894.txt">Table of n, a(n) for n = 1..10000</a>
%F 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.
%p A137894 mx:= 10000: # maximal index needed
%p A137894 b:= proc(n) n end:
%p A137894 a:= proc(n) option remember; global mx; local h, t;
%p A137894       if n=0 then 0 else a(n-1); t:= b(n);
%p A137894         if n+t<=mx then h:=b(t+n); b(t+n):=h+n fi; t
%p A137894       fi
%p A137894     end:
%p A137894 seq(a(n), n=1..100);  # _Alois P. Heinz_, Mar 04 2015
%t A137894 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_ *)
%o A137894 (Python)
%o A137894 TOP = 1000
%o A137894 a = [1]*TOP
%o A137894 for n in range(1,TOP):
%o A137894   a[n]=n
%o A137894 for n in range(1,TOP):
%o A137894   print(str(a[n]),end=',')
%o A137894   if n+a[n]<TOP: a[n+a[n]] += n
%o A137894 # _Alex Ratushnyak_, Nov 22 2013
%Y A137894 Cf. A000027, A136119, A137319, A137417, A137418, A136259, A136272.
%K A137894 easy,nonn
%O A137894 1,2
%A A137894 _Ctibor O. Zizka_, Apr 30 2008
%E A137894 More terms from _Alex Ratushnyak_, Nov 22 2013.