Recently I have been creating a program that uses Wilson's theorem to solve for prime numbers, but the main disadvantage of that system is that most computers have the 64 long limit, which comes out to be about 2^63 at max (I think). I then decided to try to make this a number type for my programs, since it could serve useful in the future as well.
I have been using a factoradic system in the following format (since the typical format includes a redundant.
$6!$ $5!$ $4!$ $3!$ $2!$ $1!$ etc... (no decimals, fractions, nor negatives) And each place has a maximum value equal to its place (ie 1 - 1, 2 - 2, 3 - 3 etc...)
What I want to know is what are the most efficient methods for adding, subtracting, multiplying, performing modulo and dividing factoradices(I have figures out the first 3, but not the 2 latter, still, I want to know if there are more efficient methods to do so)
I already know that this is not the most efficient method to do this, but I want to pursue this concept out of curiosity
An answer to any of the operations would be appreciated since it would help my program a lot, thank you!
I don't think this is going to be cured by number representation. Any way you slice it, numbers on the order of $n!$ are really really big and will require huge amounts of memory to store and huge amounts of time to process. It would make more sense to try to compute $(n-1)! \bmod n$ without first constructing $(n-1)!$, by doing all your multiplications mod $n$. But this will still require $n-2$ multiplications mod $n$, which is way too much to be useful.