public class NumberHelpers {
	// TODO: Optimize dynamically
	public static int calcFactorial(int n) {
		if (n == 1 || n == 0) {
			return 1;
		}
		return n * calcFactorial(n - 1);
	}

	// This assumes that the Fib numbers (1, 1, 2, ...) are indexed starting with one
	// TODO: Optimize dynamically 
	public static int calcFibonacci(int n) {
		if (n == 2 || n == 1) {
			return 1;
		}
		return calcFibonacci(n - 1) + calcFibonacci(n - 2);
	}

	public static int calcTriangle(int n) {
		return n * (n + 1) / 2;
	}

	public static boolean isPrime(int n) {
		if (n == 2) {
			return true; 
		}
		for (int div = 2; div <= Math.sqrt(n); div++) {
			if (n % div == 0) { 
				return false; 
			}
		}
		return true;
	}

	public static boolean isFib(int a) {
		return (isPerfectSquare((5*a*a) + 4) || isPerfectSquare( (5*a*a) - 4 ));
	}

	public static boolean isPerfectSquare(int n) {
		int root = (int) Math.sqrt(n);
		return (n == root * root);
	}

	// TODO: Confirm that this works
	public static boolean isPerfectSquare(int n) {
		return (Math.sqrt(n) % 1 == 0);
	}

	// For perfect numbers, Sum(divisors) = n
	public static boolean isPerfectNum(int n) {
		int sumDivs = 0;
		for (int i = 1; i < n; i++) {
			if (n % i == 0) { 
				sumDivs += i; 
			}
		}
		return (sumDivs == n);
	}
}

@@ -430,24 +430,316 @@
 (n - 2);%0A%09%7D%0A
+%09public int%5B%5D name_of_array=new int%5B100000000%5D;%0A%09name_of_array%5B0%5D=0;name_of_array%5B1%5D=1;%0A%09public static int calcFibonacci_dp(int n) %7B%0A%09%09if(name_of_array%5Bn%5D!=0)%7B%0A%09%09%09return name_of_array%5Bn%5D;%0A%09%09%7D%0A%09%09else%7B%0A%09%09%09name_of_array%5Bn%5D=calcFibonacci(n-1)+calcFibonacci(n-2);%0A%09%09%7D%0A%09%09return name_of_array%5Bn%5D;%0A%09%7D
 %0A%09public sta

Update NumberHelpers.java