MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Q in mathematica ??

On Dec 6, 2012, at 5:01 AM, Q in mathematica <baha791 at> wrote:

> Write  Mathematica Blocks that can solve the problem.
> Write a code that  verifies   Fermat' s Little Theorem which says that 
: If  [Phi](n)  is the Euler Phi  of n, i.e.  the number of positive 
integers less than or equal to n which are relatively prime to n,  then  
a^[Phi](n)[Congruent]1mod n  for all a  relatively  prime to n.

I hope that wasn't a homework exercise you were asked to do, as it's 

   Resolve[ForAll[{a, n},
           (IntegerQ[a] && IntegerQ[n] && GCD[a, n] == 1)
           (Mod[a^EulerPhi[n], n] == 1)

Or, the same thing without the quantification:

    (IntegerQ[a] && IntegerQ[n] && GCD[a, n] == 1)
    (Mod[a^EulerPhi[n], n] == 1)

Murray Eisenberg                           murray at
Mathematics & Statistics Dept.      
Lederle Graduate Research Tower            phone 413 549-1020 (H)
University of Massachusetts                      413 545-2838 (W)
710 North Pleasant Street                  fax   413 545-1801
Amherst, MA 01003-9305

  • Prev by Date: Re: Pet peeve about version numbers of Mathematica
  • Next by Date: Re: Default font in Mathematica 9
  • Previous by thread: Q in mathematica ??
  • Next by thread: Re: Q in mathematica ?? // answering someone's homework