The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 3
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
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.
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 *)
PROG
(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]<TOP: a[n+a[n]] += n
# Alex Ratushnyak, Nov 22 2013
CROSSREFS
Sequence in context: A327726 A050066 A050064 * A087329 A298914 A205116
KEYWORD
easy,nonn
AUTHOR
Ctibor O. Zizka, Apr 30 2008
EXTENSIONS
More terms from Alex Ratushnyak, Nov 22 2013.
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 19 03:17 EDT 2024. Contains 372666 sequences. (Running on oeis4.)