Talk:Kaprekar numbers: Difference between revisions

(→‎In base B 10: why printing?)
Line 119:
[[User:Toucan|Toucan]] 17:18, 26 June 2011 (UTC)
:I don't quite understand that. Can you show an example? --[[User:Mwn3d|Mwn3d]] 17:29, 26 June 2011 (UTC)
::Let's take an example from the implementation in C:
::74241 is a Kaprekar number in base 17. But, written in base 17, it's f1f2, or if you prefer f1f2_17 = 74241_10, with obvious notation.
::The fact that it's a Kaprekar number will be better showed when printing in base 17 (numbers with _17 appended), and you will write
:: f1f2_17^2 = d75f1b94_ 17 and d75f_17 + 1b94_17 = f1f2_17
::However, the ''number'' is still f1f2_17 = 74241_10 = 12201_16 = ... You can print this number in any base you wish, it's the same number.
::As Ledrug says, the only reason to print f1f2 is showing how N^2 may be cut to prove it's a Kaprekar number. But it's not really related to
::Kaprekar numbers, it's a "printing in base B" subtask.
:True. I added the non-base10 extra requirement, and the printing part is there to clearly show if a solution decoupled the numerical aspect from a number's string representation. The base 17 was specifically chosen because languages often can handle base conversion up to 16 natively, so 17 may require a hand-rolled string conversion, which can also be interesting while not difficult. Plus, if you print it out in base 17, it's much easier for a human reader to see the correctness of the solution. --[[User:Ledrug|Ledrug]] 21:25, 26 June 2011 (UTC)
506

edits