Bug ? Wilson's Theorem
Okubok Kenjiro
okubok at nn.iij4u.or.jp
Thu Dec 18 15:52:04 CST 2008
Sir
I know octave is not a tool for number theory, but when I taught
Wilson's theorem in a high-school I found a bug?
Wilsons theorem says, for any prime number p, (p-1)!+1 is divisible by p;
with octave
rem(prod(1:(p-1)),p) must be zero, my students checked this for all
primes less than 100. There was an exception for p=29,
rem(prod(1:28),29), ans=3.514e+13.
I am a retired mathematician worked in ODE, and am helping highschool
boys after regular
classes. To deal with large integers, I teach them to factorize into
residual classes and their products. I guess octave changes its strategy
at 29, resulting in this case.
Kenjiro Okubo
Prof. Emeritus UEC,Tokyo Japan
More information about the Bug-octave
mailing list