Numbers in base 10 that are palindromic in bases 2, 4, and 16: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: added programming notes about the speed increase.) |
m (→{{header|REXX}}: re-aligned a REXX statement.) |
||
Line 175: | Line 175: | ||
idx= 1 /*set the IDX (index) to unity. */ |
idx= 1 /*set the IDX (index) to unity. */ |
||
do j=1 by 2 to n-1 /*find int palindromes in bases 2,4,16.*/ |
do j=1 by 2 to n-1 /*find int palindromes in bases 2,4,16.*/ |
||
h= d2x(j) /*convert dec. # to hexadecimal. */ |
|||
if h\==reverse(h) then iterate /*Hex number not palindromic? Skip.*/ /* ◄■■■■■■■■ a filter. */ |
if h\==reverse(h) then iterate /*Hex number not palindromic? Skip.*/ /* ◄■■■■■■■■ a filter. */ |
||
b= x2b( d2x(j) ) + 0 /*convert dec. # to hex, then to binary*/ |
b= x2b( d2x(j) ) + 0 /*convert dec. # to hex, then to binary*/ |