Jump to content

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

→‎{{header|Raku}}: Add a Raku example
(Added Go)
(→‎{{header|Raku}}: Add a Raku example)
Line 73:
23 found: 0 1 3 5 15 17 51 85 255 257 273 771 819 1285 1365 3855 4095 4097 4369 12291 13107 20485 21845
</pre>
 
=={{header|Raku}}==
<lang perl6>put "{+$_} such numbers:\n", .batch(10)».fmt('%5d').join("\n") given
(^25000).grep: -> $n { all (2,4,16).map: { $n.base($_) eq $n.base($_).flip } }</lang>
{{out}
<pre>23 such numbers:
0 1 3 5 15 17 51 85 255 257
273 771 819 1285 1365 3855 4095 4097 4369 12291
13107 20485 21845</pre>
 
=={{header|Ring}}==
10,333

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.