Program to find factoradic number