Anonymous user
Perfect totient numbers: Difference between revisions
m
→{{header|REXX}}: added whitespace.
(add FreeBASIC) |
m (→{{header|REXX}}: added whitespace.) |
||
Line 1,163:
<lang rexx>/*REXX program calculates and displays the first N perfect totient numbers. */
parse arg N . /*obtain optional argument from the CL.*/
if N=='' | N=="," then N= 20
@.=
p= 0 /*the count of perfect " " */
$= /*list of the " " " */
Line 1,178:
say 'The first ' N " perfect totient numbers:" /*display the header to the terminal. */
say strip($) /* " " list. " " " */
exit
/*──────────────────────────────────────────────────────────────────────────────────────*/
gcd: parse arg x,y; do until y==0; parse value x//y y with y x; end; return x
Line 1,199:
<lang rexx>/*REXX program calculates and displays the first N perfect totient numbers. */
parse arg N . /*obtain optional argument from the CL.*/
if N=='' | N=="," then N= 20
@.=
p= 0 /*the count of perfect " " */
$= /*list of the " " " */
Line 1,216:
say 'The first ' N " perfect totient numbers:" /*display the header to the terminal. */
say strip($) /* " " list. " " " */
exit
/*──────────────────────────────────────────────────────────────────────────────────────*/
gcd: parse arg x,y; do until y==0; parse value x//y y with y x; end; return x
|