Numbers in base 10 that are palindromic in bases 2, 4, and 16: Difference between revisions

Content added Content deleted
(Added Algol W)
Line 1,048: Line 1,048:
» '<span style="color:blue">PAL2416</span>' STO
» '<span style="color:blue">PAL2416</span>' STO
« { }
« { 0 }
0 25000 '''FOR''' n
1 25000 '''FOR''' n
'''IF''' n <span style="color:blue">PAL2416</span> '''THEN''' n + '''END NEXT'''
'''IF''' n <span style="color:blue">PAL2416</span> '''THEN''' n + '''END'''
2 '''STEP'''
» '<span style="color:blue">TASK</span>' STO
» '<span style="color:blue">TASK</span>' STO
Runs in 1 hours 37 minutes on a HP-48SX.
Runs in 1 hours 37 minutes on a HP-48SX.

====Much faster approach====
====Much faster approach====
The task generates palindromes in base 16, which must then be verified as palindromes in the other two bases.
The task generates palindromes in base 16, which must then be verified as palindromes in the other two bases.