(32SII) Solving a Single Congruence Equation for the HP 32Sii
|
01-16-2014, 05:58 AM
(This post was last modified: 01-16-2014 06:20 AM by Thomas Klemm.)
Post: #2
|
|||
|
|||
RE: Solving a Single Congruence Equation for the HP 32Sii
Instead of brute force the Chinese remainder theorem could be used. This program for the HP-11C can easily be translated to the HP-32Sii or most other HP calculators.
001 LBL A 002 STO 1 003 STO 5 004 R↓ 005 STO 6 006 R↓ 007 STO 2 008 0 009 STO 3 010 1 011 STO 4 012 LBL 0 013 RCL 1 014 RCL 2 015 / 016 INT 017 STO 0 018 RCL 3 019 RCL 4 020 STO 3 021 RCL 0 022 * 023 - 024 STO 4 025 RCL 1 026 RCL 2 027 STO 1 028 RCL 0 029 * 030 - 031 STO 2 032 X≠0 033 GTO 0 034 RCL 5 035 RCL 3 036 X<0 037 + 038 RCL 6 039 * 040 ENTER 041 ENTER 042 RCL 5 043 / 044 INT 045 RCL 5 046 * 047 - 048 RTN Usage: A ENTER B ENTER N GSB A Example: 5 * x = 3 mod 17 5 ENTER 3 ENTER 17 GSB A 4 Restriction: gcd(A, N) = 1 |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(32SII) Solving a Single Congruence Equation for the HP 32Sii - Eddie W. Shore - 01-16-2014, 03:16 AM
RE: Solving a Single Congruence Equation for the HP 32Sii - Thomas Klemm - 01-16-2014 05:58 AM
RE: Solving a Single Congruence Equation for the HP 32Sii - Thomas Klemm - 01-17-2014, 09:04 PM
RE: (32SII) Solving a Single Congruence Equation for the HP 32Sii - Albert Chan - 03-06-2019, 04:50 AM
RE: (32SII) Solving a Single Congruence Equation for the HP 32Sii - Albert Chan - 03-10-2019, 07:41 PM
|
User(s) browsing this thread: 3 Guest(s)