Find palindromic numbers in both binary and ternary bases: Difference between revisions
Find palindromic numbers in both binary and ternary bases (view source)
Revision as of 21:14, 15 April 2024
, 1 month ago→{{header|EasyLang}}
Line 719:
=={{header|EasyLang}}==
<syntaxhighlight>
fastfunc ispalin2 n .
m = n
while m > 0
Line 736 ⟶ 732:
fastfunc reverse3 n .
while n > 0
n = n div 3
.
return
.
return itoa (n div b) b & n mod b
.
.
proc main . .
pow3 =
while 1 = 1
for i =
#
n = (i * 3 + 1) * pow3 + reverse3 i
if ispalin2 n = 1
cnt += 1
if cnt = 6 - 2
return
.
.
.
pow3 *= 3
.
|