Clan x86

Technical (Development, Security, etc.) => General Programming => Tutorials, References, and Examples => Topic started by: rabbit on May 10, 2006, 09:02:58 PM

Title: [TI-83] Various Number Theory Things
Post by: rabbit on May 10, 2006, 09:02:58 PM
TI-83 lacks a few things helpful for Number Theory, so I added them in during a free today, thought they may be helpful to others:

prgmMODULUS
Used to find even divisibility (VERY HELPFUL!).  This is a requirement for other programs below.
:If F:Then
:E/F->G
:F*(G-int(G))->G
:If G<0:G+F->G
:Else
:0->G
:End

Result: 0 F divides E evenly (ie: F = 2, E = 10).
remainder otherwise.

prgmSUMFACTS
Sums all factors (divisors) of a given number, 1 and the number inclusive.  Useful in finding k-perfect numbers.
:Input "NUM=",A
:0->K
:For(I,1,A+1)
:A->E
:I->F
:prgmMODULUS
:If G=0
:K+I->K
:End
:Disp K


prgmFACTOR
Displays all factors of a number, 1 and number exclusive
:Input "NUM=",A
:0->K
:For(I,1,A+1)
:A->E
:I->F
:prgmMODULUS
:If G=0
:Disp I
:End


prgmPF
Launcher for prgmPRMEFACT
:ClrHome
:Input "NUM=",A
:prgmPRMEFACT


prgmPRMEFACT
Displays the prime factorization (kind of) of a number
:2->I
:While I<A
:A->E
:I->F
:prgmMODULUS
:If G=0:Then
:Disp I
:A/I->A
:Else
:I+1->I
:End
:End
:Disp A
Title: Re: [TI-83] Various Number Theory Things
Post by: deadly7 on May 11, 2006, 01:36:24 AM
Neat.  I like the last one the most.

Why are you using an 83?  They're terrible calculators.
Title: Re: [TI-83] Various Number Theory Things
Post by: Sidoh on May 11, 2006, 03:19:36 AM
Quote from: deadly7 on May 11, 2006, 01:36:24 AM
Neat.  I like the last one the most.

Why are you using an 83?  They're terrible calculators.

...

Nice, rabbit.  I doubt I'll ever have much use to do number theory on a graphing calculator (with the stuff I've done, I've used my computer), but I'll keep them in mind. :P
Title: Re: [TI-83] Various Number Theory Things
Post by: rabbit on May 11, 2006, 06:30:36 AM
Quote from: deadly7 on May 11, 2006, 01:36:24 AM
Neat.  I like the last one the most.

Why are you using an 83?  They're terrible calculators.
We haven't been allowed 83's in NT, we've been using TI-06's all year (the blue ones for like, 3rd graders), but even those have a mod button (INT/) :\
Title: Re: [TI-83] Various Number Theory Things
Post by: Joe on May 11, 2006, 09:25:50 PM
I don't have my TI-83 handy at the moment (it's at school) but I could have sworn there was a mod function in the catalog.
Title: Re: [TI-83] Various Number Theory Things
Post by: MyndFyre on May 11, 2006, 09:30:08 PM
I got to use an 89 in college calc.  :D
Title: Re: [TI-83] Various Number Theory Things
Post by: rabbit on May 12, 2006, 06:44:33 AM
Yeah.  Sang (a Korean, no doubt!) has an 89 and is in our class.  The 89 is what inspired me..
Title: Re: [TI-83] Various Number Theory Things
Post by: Nate on May 12, 2006, 08:22:55 PM
My friend has an 89...so cheap
Title: Re: [TI-83] Various Number Theory Things
Post by: deadly7 on May 13, 2006, 02:33:45 PM
I have an 86 and I can use my brother's 89 whenever I want. :D!