Super duper recursive function
Posted: Wed Sep 24, 2014 8:56 pm
Okay, so safari crashed on me, so my well-written post on this super cool function I made was just destroyed, so I won't go into as much depth as I would if MY POSTS DIDN'T ALWAYS DISAPPEAR!!!! Sorry, just had to rant a little. Anyways, my function is basically defined as the (f(x),n) where you go to the f(n)th level recursion with f(x), which would probably mean something to you if stupid safari hadn't... *Exfret goes grumbling on about stuff*... Anyways, I'll just give you an example for when f(x)=x+1 and n=2.
First level: f(n)=2+1=3
Second level: f2(x)=f(x) applied to itself f(n) times=f(f(f(x)))=(((x)+1)+1)+1=x+3
f2(n)=n+3=2+3=5
Third level: ff(n)(x)=f3(x)=f2(x) applied to itself f2(n) times=f2(f2(f2(f2(f2(x)))))=(((((x)+3)+3)+3)+3)+3=x+3*5=x+15
ff(n)(n)=n+15=2+15=17
So you could return the function f(x)=x+15, or the number 17. This may not seem like a very quickly growing function, but if g(x)=x^(2^x), then (x+1,3)~g(g(g(870))). The arguments that returned 17 were f(x)=x+1 and n=2, but those that got this huge number were f(x)=x+1 and n=3. Oh, what a tiny change can do.
Here's the sequence varying n but keeping f(x) to x+1, starting at x=0:
1, 4, 17, a gazillion, then I don't even want to think about what comes after that...
Edit: It's actually 1,5,17 as ARP pointed out.
First level: f(n)=2+1=3
Second level: f2(x)=f(x) applied to itself f(n) times=f(f(f(x)))=(((x)+1)+1)+1=x+3
f2(n)=n+3=2+3=5
Third level: ff(n)(x)=f3(x)=f2(x) applied to itself f2(n) times=f2(f2(f2(f2(f2(x)))))=(((((x)+3)+3)+3)+3)+3=x+3*5=x+15
ff(n)(n)=n+15=2+15=17
So you could return the function f(x)=x+15, or the number 17. This may not seem like a very quickly growing function, but if g(x)=x^(2^x), then (x+1,3)~g(g(g(870))). The arguments that returned 17 were f(x)=x+1 and n=2, but those that got this huge number were f(x)=x+1 and n=3. Oh, what a tiny change can do.
Here's the sequence varying n but keeping f(x) to x+1, starting at x=0:
1, 4, 17, a gazillion, then I don't even want to think about what comes after that...
Edit: It's actually 1,5,17 as ARP pointed out.