OFFSET
0,3
REFERENCES
S. Wolfram, A New Kind of Science, 2001, p. 908.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 0..10000
S. Wolfram, A New Kind of Science, pages 907-908.
MAPLE
z := x -> 0: s := x -> (1 + op(1, x)): p := x -> subs(q = x, y -> op(q, y)): c := x -> subs(q = x, y -> eval((op(1, q))([(seq(op(i, q), i = 2..nops(q)))(y)]))): r := x -> subs(q = x, y -> eval(`if`(op(1, y) = 0, (op(1, q))([op(2, y)]), (op(2, q))([r(q)([op(1, y) - 1, op(2, y)]), op(1, y) - 1, op(2, y)])))): seq(r([z, r([s, r([s, r([s, p(2)])])])])([i, 0]), i = 0..109);
MATHEMATICA
(Mathematica code from New Kind of Science, p. 908, added by N. J. A. Sloane, Feb 17 2015)
F = Fold[Fold[
2^Ceiling[Log[2, Ceiling[(#1 + 2)/(#2 + 2)]]] (#2 + 2) -
2 - #1 &, #2, Range[#1]] &, 0, Range[#]] &
Table[F[n], {n, 0, 500}]
PROG
(PARI) f(x, y)=(y+2)<<ceil(log(ceil((x+2)/(y+2)))/log(2))-2-x
a(n)=my(t, y); for(k=1, n, y=k; for(i=1, t, y=f(y, i)); t=y); t
A(n)=my(v=vector(n), t, y); v[1]=1; for(k=2, n, y=k; for(i=1, t, y=f(y, i)); v[k]=t=y); v \\ Charles R Greathouse IV, Jan 25 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Fink, Jun 08 2003
STATUS
approved