OFFSET
1,3
COMMENTS
This sequence grows faster than any exponential sequence. The implementation here is quite slow.
Let g(x) be fib(1,1,x), g returns y; let h(y) be fib(1,y,x), h returns z; let i(z) be z be applied to itself x-1 times. Then f(x) = i(h(g(x))).
EXAMPLE
n=1: fib(1,1,n);
n=2: fib(1,fib(1,1,n),n);
n=3: fib(1,fib(1,fib(1,1,n),n),n) ...
f(3) is fib(1,fib(1,fib(1,1,3),3),3);
f(3) simplifies to fib(1,fib(1,2,3),3);
f(3) simplifies to fib(1,3,3);
f(3) is 4.
PROG
(Python)
def fib(arb1, arb2, nth):
if nth == 0:
return arb1
if nth == 1:
return arb2
x = [0]*nth
x[0] = arb1
x[1] = arb2
for i in range(2, nth, 1):
x[i] = x[i-1]+x[i-2]
return x[-1]
def fib2d(n):
return fib(1, fib(1, 1, n), n)
def fib3d(n):
return fib(1, fib(1, fib(1, 1, n), n), n)
def slowfibnd(n): # This is an inelegant way to generate a(n)
begin = "fib(1, 0+1, n)"
for x in range(n-1):
begin = begin.replace('0+1', 'fib(1, 0+1, n)')
return eval(begin)
CROSSREFS
KEYWORD
nonn
AUTHOR
Gregory Nisbet (gregory.nisbet(AT)gmail.com), Jul 22 2008
STATUS
approved