Multiplicatively perfect numbers: Difference between revisions
Content added Content deleted
m (→{{header|Phix}}: feel free to delete this) |
(Added XPL0 example.) |
||
Line 382: | Line 382: | ||
497 = 7 x 71 |
497 = 7 x 71 |
||
</pre> |
</pre> |
||
=={{header|XPL0}}== |
|||
<syntaxhighlight lang "XPL0">func Special(N); |
|||
int N, D, P; |
|||
[D:= 2; P:= 1; |
|||
while D < N do |
|||
[if rem(N/D) = 0 then P:= P*D; |
|||
D:= D+1; |
|||
]; |
|||
return P = N; |
|||
]; |
|||
int N, C; |
|||
[C:= 0; |
|||
Format(4, 0); |
|||
for N:= 2 to 500-1 do |
|||
if Special(N) then |
|||
[RlOut(0, float(N)); |
|||
C:= C+1; |
|||
if rem(C/20) = 0 then CrLf(0); |
|||
]; |
|||
]</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
6 8 10 14 15 21 22 26 27 33 34 35 38 39 46 51 55 57 58 62 |
|||
65 69 74 77 82 85 86 87 91 93 94 95 106 111 115 118 119 122 123 125 |
|||
129 133 134 141 142 143 145 146 155 158 159 161 166 177 178 183 185 187 194 201 |
|||
202 203 205 206 209 213 214 215 217 218 219 221 226 235 237 247 249 253 254 259 |
|||
262 265 267 274 278 287 291 295 298 299 301 302 303 305 309 314 319 321 323 326 |
|||
327 329 334 335 339 341 343 346 355 358 362 365 371 377 381 382 386 391 393 394 |
|||
395 398 403 407 411 413 415 417 422 427 437 445 446 447 451 453 454 458 466 469 |
|||
471 473 478 481 482 485 489 493 497</pre> |