Anonymous user
Numbers whose binary and ternary digit sums are prime: Difference between revisions
Numbers whose binary and ternary digit sums are prime (view source)
Revision as of 20:18, 26 June 2021
, 2 years ago→{{header|REXX}}: added comments.
(Added XPL0 example.) |
m (→{{header|REXX}}: added comments.) |
||
Line 1,123:
$= /*a list of numbers found (so far). */
do j=1 for n-1 /*find #s whose B2 & B3 sums are prime.*/
b2= sumDig( tBase(j, 2) ); if \!.b2 then iterate /*convert to base2, sum digits.*/ /* ◄■■■■■■■■ a filter. */
b3= sumDig( tBase(j, 3) ); if \!.b3 then iterate /* " " base3 " " */ /* ◄■■■■■■■■ a filter. */
found= found + 1 /*bump the number of found integers. */
if cols<1 then iterate /*Only showing the summary? Then skip.*/
|