|
|
EXAMPLE
| 28 has proper divisors 1, 2, 4, 7, 14. 28 = 44_6, 1 = 1_6, 2 = 2_6, 4 = 4_6, 7 = 11_6, 14 = 22_6. Reversing these base-6 numbers, we have 44_6 = 1_6 + 2_6 + 4_6 + 11_6 + 22_6 so 28 belongs to the sequence.
|
|
|
MATHEMATICA
| base=6; f[n_] := FromDigits[Reverse[IntegerDigits[n, base]], base]; baseDivisors[n_, base_] := IntegerDigits[Drop[Divisors[n], -1], base]; Do[ startFrom = 2; Do[If[f[n] == Apply[Plus, Map[f, Drop[Divisors[n], -1]]], Print["base = ", base, ", n = ", n, ") ", IntegerDigits[n, base], " divisors: ", Drop[Divisors[n], -1], " base divisors: ", baseDivisors[n, base]]], {n, startFrom, 10000}], {base, 2, 10}]
|