Press space and give a number 1-170 (170 is the max scratch can handle before infinity) and it will give you the factorial, and subfactorial/derangement.
This took me many hours to get right, and thanks to this website I understood how to calculate subfactorials/derangements. This website can also produce subfactorials/derangements, and can even go up to 10000. Link to website: https://www.dcode.fr/subfactorial