Talk:Minimum multiple of m where digital sum equals m: Difference between revisions

deleted no longer relevant section (misleading/wrong, plus the Phix entry explains it[self] better anyway)
(deleted no longer relevant section (misleading/wrong, plus the Phix entry explains it[self] better anyway))
Line 168:
 
n<sub>20</sub>+n<sub>19</sub> must be at least 7. Each time n<sub>20</sub>+n<sub>19</sub> is incremented 1 must be subtracted from either No or Ne. The table above depicts the possibilities and is in fact a perfectly balanced binary tree. When a candidate is identified No and Ne must be expanded to the set of 8 digits summing to No and the set of 9 digits summing to Ne, and all combinations considered. In this case it is easy as 72 can only be 8 nines and 81 can only be 9 nines. Thus it only remains to prove that 70999999999999999995 is divisible by 3.--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 13:37, 8 February 2022 (UTC)
 
==next number divisible by 11==
Hit a slight snag in my [new and not yet posted] counting-divisible-by-11s-with-same-digit-sum algorithm. <br>
From 59998906 I'm getting 66098989 but the brute force is (correctly) telling me the next is 60949999.<br>
I think this is one (the first I've hit) of those tricky transitions where 11 is transferred between the odd and even digits.<br>
I have (actually) got some (unposted & untested) code that is supposed to be doing this which isn't even triggering, but...
<pre>
59998906
+ 4 0 1 6 <<-- add max from left [which feels wrong]
- 5 6
= 99999460
> 60949999 <<-- pairwise swap all 8 [which feels right compared to other cases].
</pre>
or is it:
<pre>
59998906
+ 1 0 1 9 <<-- add max from right [which feels right and matches the subtraction]
- 5 6
= 69999490
> 60949999 <<-- reverse the last 7 [which feels wrong and could break other cases].
</pre>
I suppose it could be a completely different method altogether. I guess what I am asking is that given 59998906 how would you as a human using either maths or intuition determine the next plausible candidate number, that still sums to 55 and is still divisible by 11? --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 05:47, 9 February 2022 (UTC)
 
==I'm out==
Gave up on 370. 275 still a little tardy/not done 25. Pretty pleased with 200 in 0.7s though. PS went with 2nd opt in prev. --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 12:21, 14 February 2022 (UTC)
7,813

edits