Re: FLTMA: A little group theory




Markus Triska wrote:
"The Dougster" <DGoncz@xxxxxxx> writes:


I wonder if Prolog or any language allows syntax like the following
The Function phi of integer x returns integer y such that
y = 0
for z = 1 to z-1
if y mod x > 0 then y = y + 1
next z
return y

Please post a corrected definition (should z go from 1 to z-1? should
the loop body be independent from z?), and I'll post a Prolog version.

Best wishes, -- Markus Triska

The Function Phi of the Integer x Returns the Integer y Such That

y = 0
For z = 1 to x-1
if x mod z > 0 Then y = y + 1
next z
Return the Integer y

(pause to see What Hath Doug Writ)

Hm.

Looks right.

Doug

.