Perfect totient numbers: Difference between revisions
Content added Content deleted
(Added Algol 68) |
Not a robot (talk | contribs) (Add PILOT) |
||
Line 1,431: | Line 1,431: | ||
3 9 15 27 39 81 111 183 243 255 327 363 471 729 2187 2199 3063 4359 4375 5571 |
3 9 15 27 39 81 111 183 243 255 327 363 471 729 2187 2199 3063 4359 4375 5571 |
||
</pre> |
</pre> |
||
=={{header|PILOT}}== |
|||
<lang pilot>C :z=0 |
|||
:n=3 |
|||
*num |
|||
C :s=0 |
|||
:x=n |
|||
*perfect |
|||
C :t=0 |
|||
:i=1 |
|||
*totient |
|||
C :a=x |
|||
:b=i |
|||
*gcd |
|||
C :c=a-b*(a/b) |
|||
:a=b |
|||
:b=c |
|||
J (b>0):*gcd |
|||
C (a=1):t=t+1 |
|||
C :i=i+1 |
|||
J (i<=x-1):*totient |
|||
C :x=t |
|||
:s=s+x |
|||
J (x<>1):*perfect |
|||
T (s=n):#n |
|||
C (s=n):z=z+1 |
|||
C :n=n+2 |
|||
J (z<20):*num |
|||
E :</lang> |
|||
{{out}} |
|||
<pre>3 |
|||
9 |
|||
15 |
|||
27 |
|||
39 |
|||
81 |
|||
111 |
|||
183 |
|||
243 |
|||
255 |
|||
327 |
|||
363 |
|||
471 |
|||
729 |
|||
2187 |
|||
2199 |
|||
3063 |
|||
4359 |
|||
4375 |
|||
5571</pre> |
|||
=={{header|PL/I}}== |
=={{header|PL/I}}== |