Ulam numbers: Difference between revisions

(→‎{{header|ALGOL 68}}: Improve the algorithm to be more like the XPL0 sample)
(→‎{{header|ALGOL 68}}: Tweak comments)
Line 93:
 
=={{header|ALGOL 68}}==
SameBasically, the same algotithm as XPL0.
<syntaxhighlight lang="algol68">
BEGIN # find some Ulam numbers, U(n) = the smallest number > U(n-1) that is #
Line 129:
CHAR upi = ulam[ pi ];
IF upi = unused
THEN ulam[ pi ] := one # u[ p # p] + i is unique so far #
ELIF upi = one
THEN ulam[ pi ] := multiple # u[ p # p] + i isn't unique #
FI
OD
3,038

edits