public static boolean isFactorial(int n) {
    	int i, j;
    	i=1;  j=1;
    	do {
    		if (i==n)
    			return true;
    		j++;
    		i = i*j;    		
    	} 
    	while (i<=n);    	
    	return false;
    }