Perfect totient numbers: Difference between revisions
Content added Content deleted
Not a robot (talk | contribs) (Add PL/M) |
Not a robot (talk | contribs) (Add BASIC) |
||
Line 91: | Line 91: | ||
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|BASIC}}== |
|||
<lang BASIC>10 DEFINT A-Z |
|||
20 N=3 |
|||
30 S=N: T=0 |
|||
40 X=S: S=0 |
|||
50 FOR I=1 TO X-1 |
|||
60 A=X: B=I |
|||
70 IF B>0 THEN C=A: A=B: B=C MOD B: GOTO 70 |
|||
80 IF A=1 THEN S=S+1 |
|||
90 NEXT |
|||
100 T=T+S |
|||
110 IF S>1 GOTO 40 |
|||
120 IF T=N THEN PRINT N,: Z=Z+1 |
|||
130 N=N+2 |
|||
140 IF Z<20 GOTO 30</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|BCPL}}== |
=={{header|BCPL}}== |