Rhonda numbers: Difference between revisions

added Arturo
(→‎{{header|HicEst}}: Add Hoon example.)
(added Arturo)
Line 47:
 
 
 
=={{header|Arturo}}==
<syntaxhighlight lang="arturo">digs: (@`0`..`9`) ++ @`A`..`Z`
toBase: function [n,base][
join map digits.base:base n 'x -> digs\[x]
]
 
rhonda?: function [n,base][
(base * sum factors.prime n) = product digits.base:base n
]
 
nonPrime: select 2..16 'x -> not? prime? x
 
loop nonPrime 'npbase [
print "The first 10 Rhonda numbers, base-" ++ (to :string npbase) ++ ":"
rhondas: select.first:10 1..∞ 'z -> rhonda? z npbase
print ["In base 10 ->" join.with:", " to [:string] rhondas]
print ["In base" npbase "->" join.with:", " to [:string] map rhondas 'w -> toBase w npbase]
print ""
]</syntaxhighlight>
 
{{out}}
 
<pre>The first 10 Rhonda numbers, base-4:
In base 10 -> 10206, 11935, 12150, 16031, 45030, 94185, 113022, 114415, 191149, 244713
In base 4 -> 2133132, 2322133, 2331312, 3322133, 22333212, 112333221, 123211332, 123323233, 232222231, 323233221
 
The first 10 Rhonda numbers, base-6:
In base 10 -> 855, 1029, 3813, 5577, 7040, 7304, 15104, 19136, 35350, 36992
In base 6 -> 3543, 4433, 25353, 41453, 52332, 53452, 153532, 224332, 431354, 443132
 
The first 10 Rhonda numbers, base-8:
In base 10 -> 1836, 6318, 6622, 10530, 14500, 14739, 17655, 18550, 25398, 25956
In base 8 -> 3454, 14256, 14736, 24442, 34244, 34623, 42367, 44166, 61466, 62544
 
The first 10 Rhonda numbers, base-9:
In base 10 -> 15540, 21054, 25331, 44360, 44660, 44733, 47652, 50560, 54944, 76857
In base 9 -> 23276, 31783, 37665, 66758, 67232, 67323, 72326, 76317, 83328, 126376
 
The first 10 Rhonda numbers, base-10:
In base 10 -> 1568, 2835, 4752, 5265, 5439, 5664, 5824, 5832, 8526, 12985
In base 10 -> 1568, 2835, 4752, 5265, 5439, 5664, 5824, 5832, 8526, 12985
 
The first 10 Rhonda numbers, base-12:
In base 10 -> 560, 800, 3993, 4425, 4602, 4888, 7315, 8296, 9315, 11849
In base 12 -> 3A8, 568, 2389, 2689, 27B6, 29B4, 4297, 4974, 5483, 6A35
 
The first 10 Rhonda numbers, base-14:
In base 10 -> 11475, 18655, 20565, 29631, 31725, 45387, 58404, 58667, 59950, 63945
In base 14 -> 4279, 6B27, 76CD, AB27, B7C1, 1277D, 173DA, 17547, 17BC2, 19437
 
The first 10 Rhonda numbers, base-15:
In base 10 -> 2392, 2472, 11468, 15873, 17424, 18126, 19152, 20079, 24388, 30758
In base 15 -> A97, AEC, 35E8, 4A83, 5269, 5586, 5A1C, 5E39, 735D, 91A8
 
The first 10 Rhonda numbers, base-16:
In base 10 -> 1000, 1134, 6776, 15912, 19624, 20043, 20355, 23946, 26296, 29070
In base 16 -> 3E8, 46E, 1A78, 3E28, 4CA8, 4E4B, 4F83, 5D8A, 66B8, 718E</pre>
 
=={{header|C++}}==
1,532

edits