· Portal  Help Search Members Calendar 
Welcome Guest ( Log In  Register )  Resend Validation Email 
Join the millions that use us for their forum communities. Create your own forum today.  Welcome to Dozensonline. We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access memberonly sections, and use many memberonly features such as customizing your profile, and sending personal messages. Registration is simple, fast, and completely free. (You will be asked to confirm your email address before we sign you on.) Join our community! If you're already a member please log in to your account to access all of our features: 
Ged 
Posted: Feb 19 2015, 01:08 PM

Casual Member Group: Members Posts: 83 Member No.: 16 Joined: 6August 05 
I have just found this and I have tried it and it works! But is there a similar one for Dozenal? I tried fourdigits and you get a round:
Kaprekar's Constant 6174 1. Take any fourdigit number except 1111, 2222, ..., 9999. Leading zeros are aloud. 2. Arrange the digits in increasing and then decreasing order to get two fourdigit numbers, add leading zeros if necessary. 3.Subtract the smaller number from the bigger number. 4. Repeat steps 2 and 3. In at most 7 iterations, this process will ALWAYS produce 6174. 
jim 
Posted: Feb 21 2015, 08:26 AM

Regular Group: Members Posts: 165 Member No.: 641 Joined: 20April 12 
I don't understand it but I see 9's.
7 cubed x 18 = 6174 Jim 
wendy.krieger 
Posted: Feb 21 2015, 12:10 PM


Dozens Demigod Group: Members Posts: 2,432 Member No.: 655 Joined: 11July 12 
In base 12, it seems to settle down to some cycles as shown. [CONFIRMED] 3EE8  8284  6376 7EE4  7375  4198  8374  5287  6196 Base 18 seems to do just two iterations of 3; [CONFIRMED] 10 1 15 8  14 1 15 4  14 9 7 4 6 1 15 12  14 5 11 4  10 5 11 8 In base 120, the cycles are shorter, giving eg (7260 cases to test). 0 0 0 0 72 23 95 48 40 23 95 80  72 39 79 48 88 7 111 32  104 55 63 16 88 23 95 32  72 55 63 48  24 7 111 96  104 71 47 16 88 39 79 32  56 39 79 64  40 7 111 80  104 39 79 16 88 55 63 32  56 7 111 64  104 7 111 16  104 87 31 16 88 71 47 32  56 23 95 64  72 7 111 48  104 23 95 16 This is interesting. If you add 1 1 0 to these numbers, they all correspond to fifteenths, but the first is just fifths, and the second is a composite of thirds and fifths. Each of the fifteenths ie 8n (n=1 to 14) occur exactly 6 times. Here is the rexx script if you want to play with it. Even more interesting, is that 6174 + 110 = 6284, and this is 3/5 1/5 4/5 2/5. That's exactly the same as twelfty's 72 23 95 48, and indeed, the same formation works in all bases which are multiples of 5, eg 20 gives 12 3 15 8. 15 gives 9 2 11 6 etc.
KAPREKAR.REX base d0 d1 .... eg k 10 7 1 6 5 This sorts the digits into ascending and descending order, eg 7 6 5 1 and 1 5 6 7, and subtracts them (6, 1, 1, 6). The negative digits are eliminated as in hand arithetic, by adding base, and subtract 1 from the next column. This is iterated and printed LL times. 22 seems a suited value on a 25line screen. 

dgoodmaniii 
Posted: Feb 21 2015, 08:42 PM


Dozens Demigod Group: Admin Posts: 1,927 Member No.: 554 Joined: 21May 09 
I'm writing a program to test this. I'll report the results tonight; I'm halfway through and need to do something else. But this looks like fun. 

wendy.krieger 
Posted: Feb 21 2015, 10:23 PM

Dozens Demigod Group: Members Posts: 2,432 Member No.: 655 Joined: 11July 12 
Base 40 settles down to a single value, while base 55 has a period of 20 items.
Base 120 can be used to derive 15. Add 1.1.0 to each element of the cycle, divide the digits by 8, and then subtract 1.1.0, eg 88.71.47.32 gives 88,72,48,32 gives 11,9,6,4 gives 11,8,5,4 
dgoodmaniii 
Posted: Feb 22 2015, 12:19 AM


Dozens Demigod Group: Admin Posts: 1,927 Member No.: 554 Joined: 21May 09 
Programs used to produce the following are at the bottom of this post. First off, I could find no pattern for fourdigit numbers in dozenal. I ran 100; different numbers for 10; iterations each and produced no patterns; indeed, the number of duplicates was lower than I would expect even from chance. (Not actually, of course, but it surprised me.) Of course, I may have made some horrible coding mistake to make it not work, but it did work for the decimal version pretty smoothly, so I don't think I have. For five digit numbers, however, there was a definite pattern, and the number is 83E74. I haven't jiggered the program to record the number of iterations necessary to produce this, but only five of the 100; different trial numbers (randomly selected) failed to produce this number. I have not yet investigated if these are simply five identical digits, which the rules originally suggested specifically exclude, or what. I hope to learn more about this later tonight when I get some more leisure time. So, in conclusion: 5digit numbers, 83E74. The below program is "check.sh"; it takes the number offered as its first argument, does no errorchecking whatsoever, calls a function to split the given number into itself arranged ascending and descending, then does the necessary subtraction, prints the result, and loops again. Now that I have an idea what the right number is, I'll probably tell it to stop when it reaches said number and report the number of iterations necessary to reach it; until then, here it is.
The below program is "rollcheck.sh," which is bash rather than simply POSIX shell so I can use the convenient randomnumber function. (Yes, I could get them from /dev/random; but whaa.) It simply produces a random number; makes sure that it's really only five digits (by piping it through "cut"), and feeds it to check.sh, writing the results therefore into a file called "results." At the end, it extracts all the duplicate entries, prints them to the screen, then writes them to a file called "commons."
(I promise that on my computer this code is indented sensibly; the code environment on the board doesn't retain that.) 

wendy.krieger 
Posted: Feb 22 2015, 02:57 AM

Dozens Demigod Group: Members Posts: 2,432 Member No.: 655 Joined: 11July 12 
Don's program was looking for a single value, rather than a loop. You could use an associative array to detect loops.
My program prints out 20 consecutive iterations of the process, and you can see in that the full iterations of either of the two loops. In fact, all of the data was cut from a command prompt, and edited to make it line. But in any case, there really isn't a lot of numbers to check. The base forms are a, b, b, a, where a \ge b \ge 0. You then apply the carry ripple through it. 
dgoodmaniii 
Posted: Feb 22 2015, 03:09 AM


Dozens Demigod Group: Admin Posts: 1,927 Member No.: 554 Joined: 21May 09 
I'm sorry, I don't understand what you're saying here. Looking for a loop? It uses a loop to seek a single value; namely, the common result of this series of arithmetic operations. I'm not sure why I'd be looking for a loop, nor even what precisely that would mean in this context.
Aren't there, in fact, a lot of numbers to check? Namely, 10000EEEEE? I'm not sure what you mean by "carry ripple", either. 

jim 
Posted: Feb 22 2015, 05:06 AM

Regular Group: Members Posts: 165 Member No.: 641 Joined: 20April 12 
You guys are not looking at this as an ancient problem and it is a pyramid problem and it is about cubes.
In the ancient world to work out the side of a cube double that of 7 was not to use 1.25992 as it took too much calculation. 1.26 was used. A cube twice the volume of 7 343 is 686 and the cube root is 8.81944 The ancients used 1.26 so the cube root = 8.82. 8.82 x 7 = 61.74 Then interestingly 7 squared 49 x 1.26 the approximate for the cube root of 2 = 61.74. Jim 
wendy.krieger 
Posted: Feb 22 2015, 06:21 AM


Dozens Demigod Group: Members Posts: 2,432 Member No.: 655 Joined: 11July 12 
There are not many numbers to check at all. For example, for four and five place dozenal numbers, there are just 78, and all fall under 100;. Consider what happens when you try 7165. The process is to sort the digits and subtract the ascending from the descending, eg 7651  1567. But we can subtract 1551 from these to get 6100  0016. So the outcome of 7165 is the same as 0016, or 0061 etc. So, the loops are then
suffices for all four and five place numbers, since the middle number disappears. The ripple carry is in my code, which first finds 7 6 5 1  1 5 6 7 = 6 1 1 6. The next step is to do the carry: ie 6 = 1 6, carry the one to 2 1 2 = 0 10 So this is 6 0 10 6, dozenal, or 6 0 8 4 decimal, etc. I ran through the base 12 five place numbers, and 74 of the 78 end up at 83E74 (which corresponds to the next iteration as 0 0 0 1 1), but there are three irregulars, 00006, 00007 and 00056, which ends at 6EEE5  64E66, and the irregular 00000 which gives itself. The fourplace numbers all end up in the loop aboves. 40 gives 24.07.31.16 after no more than 21 iterations, except for x.x.x.x which leads to 0.0.0.0. 8.24 is the smallest number to give this straight up. 10 gives 6174 after no more than 7 iterations, except for NNNN, 26 is the smallest number to give this straight up. 

Dan 
Posted: Feb 22 2015, 08:34 AM


Dozens Disciple Group: Members Posts: 1,463 Member No.: 19 Joined: 8August 05 
I think she means a repeating cycle of numbers. For example, in the middlesquare PRNG method with 4 decimal digits, the sequence 0540 → 2916 → 5030 → 3009 → 0540 → 2916 → 5030 → 3009... 

wendy.krieger 
Posted: Feb 22 2015, 08:42 AM

Dozens Demigod Group: Members Posts: 2,432 Member No.: 655 Joined: 11July 12 
No, Jim, we're not looking at any particular property of 6174, except that it is a set of digits with interesting properties. That is, we're not looking at the number 1.1.1.0 base 18 (ie 7*7*7*18), or any of the facinating relations between 63 and 50 and their cubes.
What we're looking at is the sort of thing that people who don't use other bases and have too much free time on their hand do. They somehow think that there is some sort of magic in the decimal expansion of pi, or tricks with digits. Here, the number in question is derived from eg 6200  0026, or other numbers by adding symmetric numbers, like 1221 to both sides, eg 7421  1247. Of course, people notice these tricks, and say, Oi! what about dozenal? What about a hundred. Doesn't Kaprekar's process give a single value anywhere? So we do a bit of panbase hacking. Don's code seems to be largely base 12, where as mine is set for any base, such as base 120. In fact, you set the base in the first param. 
Dan 
Posted: Feb 22 2015, 08:45 AM

Dozens Disciple Group: Members Posts: 1,463 Member No.: 19 Joined: 8August 05 
What we're looking for is a fixed point of the function that maps one number in the Kaprekar sequence to the next.
For example, in decimal, 6174 maps to 7641  1467 = 6174 again. Through a bruteforce search, I've found that the only such fixed point with 4 dozenal digits is 0000. But it does seem that many initial "seed" values lead into the loop 8374 → 5287 → 6196 → 7BB4 → 7375 → 4198 → 8374 → ... 
wendy.krieger 
Posted: Feb 22 2015, 08:57 AM


Dozens Demigod Group: Members Posts: 2,432 Member No.: 655 Joined: 11July 12 
This list shows the kaprekar iterations of 0 0 1 2 and 0 0 0 3 in base 12. These settle down to loops, such as from 3: to 9: in the first example, and 4: to 7: in the second example. All 78 root values have been checked, and apart from 0000, they all end in one of these two loops.
There are 78 root values for the fivedigit case, of which 74 settle down to a single value 83E74. One settles down to 00000, and three settle down to the second loop. These are 00006, 00007, and 00056. All 78 values have been followed through.
Early tests on the sixplace dozenal suggests one or more loops of ten (ie 2*5). Some have a leadin of 20 places, which means i will need to think differently here. The 2place version has a period of 6 (the six odd multiples of E), while the threedigit version ends at 5E6. The sevendigit version has a period of 9, or some multiple of it. Likewise the 820 root values for base 40 have all been done, all give 24 7 31 16, with the exception of when all four digits are the same, these give 0 0 0 0. The longest lead is 20, meaning that the number appears only at the 21 iteration. The reason why i was suggesting an associative array, is because the return to the start of the loop is immediately detected when one stores a value using the number. For example, in the first fourdigit 12 example above, the script would store the value (before the colon) in the label (after the colon), eg a."2 0 10 10" = 1, etc. But when it gets to line 9, it looks for a."8 3 7 4" but this already has 3 in it, so there are 2 leaders (ie 31), and a loop of 6 (ie 93). 

wendy.krieger 
Posted: Feb 22 2015, 10:21 AM

Dozens Demigod Group: Members Posts: 2,432 Member No.: 655 Joined: 11July 12 
For 120, the following
2digit: There is a period of 55, except for multiples of 11, which give 5. 3digit: All settle down to 59.E9.60, but the leadins can be quite long. 4digit: Tested loops settle down to one of the fourperiod places. 5digit: These seem to head to 80.39.E9.79.40, but the experience with 12 tells us not to suppose all do this. 
jim 
Posted: Feb 22 2015, 11:17 AM

Regular Group: Members Posts: 165 Member No.: 641 Joined: 20April 12 
Hi Wendy
What if we tried 2592? I think we would do it in 7? Jim 
dgoodmaniii 
Posted: Feb 23 2015, 02:12 AM

Dozens Demigod Group: Admin Posts: 1,927 Member No.: 554 Joined: 21May 09 
Yes, my scripts were entirely dozenal, by design. And yes, I wasn't really interested in finding cycles, but in locating a recurring value.
I still don't really understand what Wendy means by a "carry ripple," but yes, I found through brute force attack that the fivedigit pattern isn't as clean as it had originally looked. It's really two patterns, one that ends at 83E74, and the other that loops at 6EEE5  64E66. On the other hand, with three digits, I found that nearly all ended in 5E6 (this is a small enough number that I could run every one without growing old waiting for it to finish). Out of XEE possibilities, X5X ended in 5E6. There doesn't seem to be any number of dozenal digits that works as cleanly as 6174 in decimal, though. 
wendy.krieger 
Posted: Feb 23 2015, 03:45 AM

Dozens Demigod Group: Members Posts: 2,432 Member No.: 655 Joined: 11July 12 
Carry ripple, is simply that when you subtract, eg 6200 from 0026, you have to do several carries. The term 'ripple' is a hardware term, that if you have several addition gates, the final result isn't stable until the carry has 'rippled' through the units, tens, hundreds gates.
In the example above, subtracting 26 from 6200 causes a carry in the units, tens, and hundeds column, so the thing isn't final until that is done. After the uncarried subtraction is done of pairs of numbers, one is left with eg a, b, b, a, where b <= a. This is eaily achieved from a starting from eg "0 0 b a" directly. This is why i only looked at these numbers. My rexx script (i upated the image in my first post), actually handles all bases, and any number of digits. The sort method is primitive, (it's a kind of insertion sort), but effective for very small numbers. On the other hand, the killer for larger values is that the leadin to the period can be quite long. For example, for three places of 120, it does settle down to 59.119.60, but this can take sixty iterations to get there. From running the script on fourplace dozenal (kaprekar 12 0 0 0 1) it came apparent that it settles down to a cycle of three or six places. When Don said that some of the fiveplace dozenal gave no result, i could from my runthroughs that these typically referred to the cycletwo cases, 00005, 00006 and 00056. 
Ged 
Posted: May 25 2015, 11:02 PM

Casual Member Group: Members Posts: 83 Member No.: 16 Joined: 6August 05 
Dgoodmaniii I thought you had got it with the 5 digit 83E74. Then I saw that you found 6EEE5  64E66.
So it looks like this phenomena only works for decimal. How nice it would have been if it worked for other bases with different number of digits e.g. half the base minus one. That would have been brilliant. Thanks for trying. 