[CST-2] advanced algorithms 1996/9/6 (fwd)

Chris Applegate cia20@cam.ac.uk
Fri, 31 May 2002 22:11:05 +0100


Just found a quick shortcut if you have a Casio:

Perform the division n/m as a top-heavy fraction using the fraction
function, then press equals.

The calculator will turn the fraction into a not-top-heavy fraction,
which returns n mod m as the numerator of the fraction part.

This won't always work - if n mod m is a multiple of 5 or 13 it will
simplify it down - in which case you'll need to multiply the value back
up first.

Cheerio,

Chris
do something lastminute.work

Chris Applegate
Room X6, Corpus Christi College, Cambridge, CB2 1RH
chris@qwghlm.co.uk / www.qwghlm.co.uk / [Redacted by SRCF sysadmins on request]
ICQ 41706821          PGP key available on request

> -----Original Message-----
> From: cst-2-admin@srcf.ucam.org [mailto:cst-2-admin@srcf.ucam.org]On
> Behalf Of Sam Staton
> Sent: 31 May 2002 22:03
> To: cst-2@srcf.ucam.org
> Subject: Re: [CST-2] advanced algorithms 1996/9/6 (fwd)
>
>
> Well, to get a mod m you might need to remember that mod
> means remainder.
>
> just do
>
> a divided by m
>
> Chop of the integer part (read it on the screen up to the
> decimal point,
> say b, then do 'minus b')
>
> Multiply by m
>
> voila
>
> --
> sam
>
>
>
> On Fri, 31 May 2002, Timothy Hospedales wrote:
>
> >
> > > > Then just square k times and you get for a=12, a^(n-1)=1.
> > > 1 mod 65 I mean ..
> >
> >  Erm, yes. But the calculators we can use dont have a mod
> button that
> > I can find :)
> >
> >
> > _______________________________________________
> > CST-2 mailing list
> > CST-2@srcf.ucam.org
> > http://www.srcf.ucam.org/mailman/listinfo/cst-2
> >
>
>
>
>
> _______________________________________________
> CST-2 mailing list
> CST-2@srcf.ucam.org
> http://www.srcf.ucam.org/mailman/listinfo/cst-2