# The Rite of Sling

Duels are interesting things. Flashman made his name in one and earnt an impressive scar in another. Maupassant explored their psychology and so did his imitator Maugham. Game theory might be a good guide on how to fight one, but I’d like to look at something simpler: the concept of duelling numbers.

How would two numbers fight? One way is to use digit-sums. Find the digit-sum of each number, then take it away from the other number. Repeat until one or both numbers <= 0, like this:

function duel(n1,n2){
print(n1," <-> ",n2);
do{
s1=digitsum(n1);
s2=digitsum(n2);
n1 -= s2;
n2 -= s1;
print(” -> ",n1," <-> ",n2);
}while(n1>0 && n2>0);
}

Suppose n1 = 23 and n2 = 22. At the first step, s1 = digitsum(23) = 5 and s2 = digitsum(22) = 4. So n1 = 23 – 4 = 19 and n2 = 22 – 5 = 17. And what happens in the end?

23 ↔ 22 ➔ 19 ↔ 17 ➔ 11 ↔ 7 ➔ 4 ↔ 5 ➔ -1 ↔ 1

So 23 loses the duel with 22. Now try 23 vs 24:

23 ↔ 24 ➔ 17 ↔ 19 ➔ 7 ↔ 11 ➔ 5 ↔ 4 ➔ 1 ↔ -1

23 wins the duel with 24. The gap can be bigger. For example, 85 and 100 are what might be called David and Goliath numbers, because the David of 85 beats the Goliath of 100:

85 ↔ 100 ➔ 84 ↔ 87 ➔ 69 ↔ 75 ➔ 57 ↔ 60 ➔ 51 ↔ 48 ➔ 39 ↔ 42 ➔ 33 ↔ 30 ➔ 30 ↔ 24 ➔ 24 ↔ 21 ➔ 21 ↔ 15 ➔ 15 ↔ 12 ➔ 12 ↔ 6 ➔ 6 ↔ 3 ➔ 3 ↔ -3

999 and 1130 are also David and Goliath numbers:

999 ↔ 1130 ➔ 994 ↔ 1103 ➔ 989 ↔ 1081 ➔ 979 ↔ 1055 ➔ 968 ↔ 1030 ➔ 964 ↔ 1007 ➔ 956 ↔ 988 ➔ 931 ↔ 968 ➔ 908 ↔ 955 ➔ 889 ↔ 938 ➔ 869 ↔ 913 ➔ 856 ↔ 890 ➔ 839 ↔ 871 ➔ 823 ↔ 851 ➔ 809 ↔ 838 ➔ 790 ↔ 821 ➔ 779 ↔ 805 ➔ 766 ↔ 782 ➔ 749 ↔ 763 ➔ 733 ↔ 743 ➔ 719 ↔ 730 ➔ 709 ↔ 713 ➔ 698 ↔ 697 ➔ 676 ↔ 674 ➔ 659 ↔ 655 ➔ 643 ↔ 635 ➔ 629 ↔ 622 ➔ 619 ↔ 605 ➔ 608 ↔ 589 ➔ 586 ↔ 575 ➔ 569 ↔ 556 ➔ 553 ↔ 536 ➔ 539 ↔ 523 ➔ 529 ↔ 506 ➔ 518 ↔ 490 ➔ 505 ↔ 476 ➔ 488 ↔ 466 ➔ 472 ↔ 446 ➔ 458 ↔ 433 ➔ 448 ↔ 416 ➔ 437 ↔ 400 ➔ 433 ↔ 386 ➔ 416 ↔ 376 ➔ 400 ↔ 365 ➔ 386 ↔ 361 ➔ 376 ↔ 344 ➔ 365 ↔ 328 ➔ 352 ↔ 314 ➔ 344 ↔ 304 ➔ 337 ↔ 293 ➔ 323 ↔ 280 ➔ 313 ↔ 272 ➔ 302 ↔ 265 ➔ 289 ↔ 260 ➔ 281 ↔ 241 ➔ 274 ↔ 230 ➔ 269 ↔ 217 ➔ 259 ↔ 200 ➔ 257 ↔ 184 ➔ 244 ↔ 170 ➔ 236 ↔ 160 ➔ 229 ↔ 149 ➔ 215 ↔ 136 ➔ 205 ↔ 128 ➔ 194 ↔ 121 ➔ 190 ↔ 107 ➔ 182 ↔ 97 ➔ 166 ↔ 86 ➔ 152 ↔ 73 ➔ 142 ↔ 65 ➔ 131 ↔ 58 ➔ 118 ↔ 53 ➔ 110 ↔ 43 ➔ 103 ↔ 41 ➔ 98 ↔ 37 ➔ 88 ↔ 20 ➔ 86 ↔ 4 ➔ 82 ↔ -10

You can look in the other direction and find bully numbers, or numbers that beat all numbers smaller than themselves. In base 10, the numbers 2 to 9 obviously do. So do these:

35, 36, 37, 38, 39, 47, 48, 49, 58, 59, 64, 65, 66, 67, 68, 69, 76, 77, 78, 79, 189

In other bases, bullies are sometimes common, sometimes rare. Sometimes they don’t exist at all for n > b. Here are bully numbers for bases 2 to 30:

base=2: 3, 5, 7, 13, 15, 21, 27, 29, 31, 37, 43, 45, 47, 54, 59
b=3: 4, 5, 7, 8, 14
b=4: 5, 6, 7, 9, 10, 11, 14, 15, 27, 63
b=5: 12, 13, 14, 18, 19, 23, 24
b=6: 15, 16, 17, 22, 23, 26, 27, 28, 29, 32, 33, 34, 35, 65, 71, 101
b=7: 17, 18, 19, 20, 24, 25, 26, 27, 32, 33, 34, 40, 41, 45, 46, 47, 48, 76
b=8: 37, 38, 39, 46, 47, 59, 60, 61, 62, 63, 95, 103, 111, 119
b=9: 42, 43, 44, 52, 53, 61, 62
b=10: 35, 36, 37, 38, 39, 47, 48, 49, 58, 59, 64, 65, 66, 67, 68, 69, 76, 77, 78, 79, 189
b=11: 38, 39, 40, 41, 42, 43, 49, 50, 51, 52, 53, 54, 62, 63, 64, 65, 73, 74, 75, 76, 85, 86, 87
b=12: 57, 58, 59
b=13: 58, 59, 60, 61, 62, 63, 64, 74, 75, 76, 77, 87, 88, 89, 90, 101, 102, 103, 115, 116, 127, 128, 129
b=14: none (except 2 to 13)
b=15: 116, 117, 118, 119, 130, 131, 132, 133, 134, 147, 148, 149
b=16: 122, 123, 124, 125, 126, 127, 140, 141, 142, 143, 156, 157, 158, 159, 173, 174, 175, 190, 191, 222, 223
b=17: 151, 152, 168, 169, 185, 186
b=18: 85, 86, 87, 88, 89, 191, 192, 193, 194, 195, 196, 197, 212, 213, 214, 215
b=19: 242, 243, 244, 245, 246
b=20: none
b=21: 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 162, 163, 164, 165, 166, 167, 183, 184, 185, 186, 187, 188, 206, 207, 208, 209, 227, 228, 229, 230, 248, 249, 250, 251, 270, 271, 272
b=22: 477, 478, 479, 480, 481, 482, 483
b=23: none
b=24: none
b=25: 271, 272, 273, 274, 296, 297, 298, 299, 322, 323, 324, 348, 349, 372, 373, 374
b=26: none
b=27: none
b=28: none
b=29: 431, 432, 433, 434, 459, 460, 461, 462, 463, 490, 491, 492, 546, 547, 548, 549, 550
b=30: none