Mainly Tech projects on Python and Electronic Design Automation.

Wednesday, June 08, 2011

Woa - a glitch on Wolfram Mathworld?

I had come across Kaprekar numbers and decided to write a Rosetta Code task around the series. There were issues about the need for extra explanation of why 1 is a member of the series.
I had originally read the wp description and noted that there is a main part to testing if a number is in the series:
 In mathematics, a Kaprekar number for a given base is a non-negative integer, the representation of whose square in that base can be split into two parts that add up to the original number again. For instance, 45 is a Kaprekar number, because 45² = 2025 and 20+25 = 45.
 That is, splitting the ordered digits of the square of the number into two parts that sum to the original number.

Wikipedia then goes on to state that runs of all zeros are not considered positive integers and so 100*100 = 10,000 and 100 + 000 = 100 is disallowed.

What got me was that 1 is considered a member of the series. The only way I could shoe-horn it into the general rule is to allow "splitting" the digits of the square before the first or after the last digit and so producing a number with no digits in it as a partial sum that is allowed and has value zero?!

I widened my references and took a look at the Wolfram Mathworld entry.  Its explanation for the series does not allow for 1 being a member, but shows it as such anyway. It is confused as it describes a series that would exclude numbers 4879 and 5292, i.e. Sloanes A053816; but points to  Sloanes  A006886!

Sloanes A006886 gives another definition for the series:
 Kaprekar numbers: n such that n=q+r and n^2=q*10^m+r, for some m >= 1, q>=0 and 0<=r<10^m, with n != 10^a, a>=1.
 If we try n = 1 then n*n = 1 and there is no m, q, and r that satisfies all the conditions.

I will submit a comment to Mathworld and see what they have to say.

P.S. I could have started this blog entry: "I'm not a mathematician but ..."


  1. For n=1 take r=1, q=0, m=1:
    n^2 = 1^2 = 1 = 0 * 10^1 + 1 = q * 10^m + r
    1 = m >=1, 0 = q >= 0, 0<= r = 1 < 10 = 10^1

    And: n = 1 != 10, 100, 1000, 10000, ...
    i.e. n != 10^a for all a >=1

    But I have to agree, it is odd to include 1 in the series, but to exclude all the other powers of 10.

  2. It sort of makes sense to me...
    You can square 1 to give 1, and then split it into two parts, one '1' and one zero-length != 0.

    Here 1 + nothing = 1. There's no other power of ten that works this way.

  3. You don't necessarily have to split. Or you can think of it as splitting into a length 1 and length 0. It just so happens that 1 being it's square is the only number with this property, so no other numbers are like it.

  4. Wolfram don't seem to be answering their mail and their page still points to the wrong OEIS sequence?



Subscribe Now: google

Add to Google Reader or Homepage

Go deh too!

Blog Archive