Jump to content
  • Advertisement
Sign in to follow this  

Fastest Growing Hierarchy

This topic is 2198 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

UPDATE: I figured it out. If you're interested, here was my problem and the solution is below.

In trying to write a recursive function that returns the fastest growing hierarchy (a really fast growing function).

Here is the definition:

Base function f[sub]0[/sub]: f[sub]0[/sub](n) = n+1

Next function f[sub](a+1)[/sub]: f[sub](a+1)[/sub](n) = f[sub]a[/sub][sup]n[/sup](n)

Functional powers: f[sup](a+1)[/sup](n) = f(f[sup]a[/sup](n)) where f[sup]0[/sup](n) = n

#include <iostream>

using namespace std;

int hf(int, int);

int f(int x, int power, int functionalBase)
if (power==1) return hf(x, functionalBase);
else return f(f(x, power-1, functionalBase),1, functionalBase);

int hf(int x, int functionalBase)
if (functionalBase==0) return x+1;
else return f(x,x,functionalBase-1);

int main()
cout << f(2, 2, 2);
Edited by sooner123

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!