# HP Forums

Full Version: (12C Platinum) Reverse Factorial
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Just acquired a brand new HP-12C Platinum and here is the first program for it.
This program also work on original HP-12C.

Program is use for reverse factorial.
If you know the number of ways and need to know what is the value of its Factorial.

-----------------------------------------------------

Procedure:

Integer [R/S] display Factorial Integer

If Integer is not a perfect Factorial the answer will display "negative" Factorial integer,
then switch stack display the + or - integer.

Integer [R/S] display Negative Factorial [X<>Y] +or- Integer
Remark: The negative result indicate that this is not a perfect factorial.

----------------------------------------------

Example:

120 is what Factorial?

120 [R/S] display 5

-----------------------------------

555 is what Factorial?

555 [R/S] display -5 [X<>Y] 435

---------------------------------
Program: Reverse Factorial (RPN Mode)
Code:
``` 001 STO 0 002 STO 1 003  2 004 STO 2 005 RCL 0 006 RCL 2 007  ÷ 008 STO 0 009 RCL 2 010 X<>Y 011 X≤Y 012 GTO 016 013  1 014 STO+2 015 GTO 005 016  1 017 RCL 0 018  - 019 X=0 020 GTO 028 021 RCL 1 022 RCL 2 023 n! 024  - 025 RCL 2 026 CHS 027 GTO 000 028 RCL 2```

Program for ALG Mode
Code:
``` 001 STO 0 002 STO 1 003  2 004 STO 2 005 RCL 0 006  ÷ 007 RCL 2 008  = 009 STO 0 010 RCL 2 011 X<>Y 012 X≤Y 013 GTO 017 014  1 015 STO+2 016 GTO 005 017  1 018  - 019 RCL 0 020  = 021 X=0 022 GTO 031 023 RCL 1 024  - 025 RCL 2 026 n! 027  = 028 RCL 2 029 CHS 030 GTO 000 031 RCL 2```

Gamo
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :