Talk:Minimum positive multiple in base 10 using only 0 and 1: Difference between revisions

→‎general observations: replacing 37 by 3 does not work
m (→‎How does it work "C code for Ed Pegg Jr's 'Binary' Puzzle algorithm" ?: corrected ten =( 10^x-1)%num to //ten == 10^(x-1)%num)
(→‎general observations: replacing 37 by 3 does not work)
 
(8 intermediate revisions by 5 users not shown)
Line 98:
:I've added a reference "How to find Minimum Positive Multiple in base 10 using only 0 and 1" which I think helps.--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 13:49, 3 March 2020 (UTC)
:Thanks, that helps allot --[[User Horst.h|Horst.h]] 14:09, 3 March 2020 (UTC)
 
=NUM;num++){
::On [https://math.stackexchange.com/questions/388165/how-to-find-the-smallest-number-with-just-0-and-1-which-is-divided-by-a-give that link], I see
n1 = num+1;
10<sup>0</sup> = 1 mod 7 possible sums: 1
//clear pow
10<sup>1</sup> = 10 = 3 mod 7 possible sums: 1, 3, 4
for(i=0;i
10<sup>2</sup> = 10*3 = 30 = 2 mod 7 possible sums: 1, 2, 3, 4, 5, 6
::but on the third line, I don't get the "10^2==10*3" part. What do I need to read to clue me in on that? --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 04:10, 5 March 2020 (UTC)
::: The "3" is from the previous line, the result of 10<sup>1</sup> mod 7. The next power has to multiply that with 10. --[[User:Heiner|Heiner]] ([[User talk:Heiner|talk]]) 04:21, 5 March 2020 (UTC)
::The multiplication by 3 is not crucial to understanding the code. The important principal is that (n mod z) + (g mod z) = (n+g) mod z (see [[Casting_out_nines]]. So:
10<sup>0</sup> = 1 mod 7 = 1 -> possible sums: 1
10<sup>1</sup> = 10 mod 7 = 3 -> possible sums: 1, 3, 4
10<sup>2</sup> = 100 mod 7 = 2 -> possible sums: 1, 2, 3, 4, 5, 6
 
I could rewrite this as:
10<sup>0</sup> = 1 mod 7 = 1 -> possible sums: 1
10<sup>1</sup> = 1<sup>1</sup>0 = 10 mod 7 = 3 -> possible sums: 1, 3, 4
10<sup>2</sup> = 1<sup>1</sup>0<sup>3</sup>0 = 30 mod 7 = 2 -> possible sums: 1, 2, 3, 4, 5, 6
where the additional superscripts are the carries as if I were back at school learning long division.
 
So the whole thing is:
1 -> 1
1<sup>1</sup>0 -> 3
1<sup>1</sup>1 -> 4
1<sup>1</sup>0<sup>3</sup>0 -> 2
1<sup>1</sup>0<sup>3</sup>1 -> 3
1<sup>1</sup>1<sup>4</sup>0 -> 5
1<sup>1</sup>1<sup>4</sup>1 -> 6
1<sup>1</sup>0<sup>1</sup>0<sup>2</sup>0 -> 6
1<sup>1</sup>0<sup>1</sup>0<sup>2</sup>1 -> 0 Success this is divisible by 7.
Note that because (n mod 7) + (g mod 7) = (n+g) mod 7 I only need to calculate 100 mod 7 and I know say 110 mod 7 is (100 mod 7) + (10 mod 7) so I can calculate all possible sums by adding 100 mod 7 to the sums I already have in a modular way.
--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 15:00, 14 March 2020 (UTC)
 
== general observations ==
Line 120 ⟶ 149:
 
:: Yuppers, I wrongedlyness bidirectionally confuseducated '''B10''' with the multiplier. &nbsp; &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:43, 2 March 2020 (UTC)
 
::: I think about prime decomposition of the integer to test, because of the observation that 3 is equivilant to 37 both are factors of 111, so when a number has a factor of 37 I can substitute it by 3, like 2 and 5 both are the factors of 10.<BR>But this is only possible, when both numbers are prime.<BR>7 and 143= 11*13 with 7*(11*13) =1001 so 143*37 = 5291 can't be transformed to 3*7 = 21 with the same result,but into 143*3.
<pre style="height:150px">
Line 206 ⟶ 236:
For very long B10 3/37 and 41/271 are often factors.
--[[user Horst.h|Horst.h]] 11:21, 3 March 2020 (UTC)~
 
Hello Host.h, I do not understand everything above, but you seem to say, that a factor of 37 may be replaced by a factor 3... but I find:
# 57 = 19 * 3
B10( 57) = 11001 = n * 193
# 703 = 19 * 37
B10( 703) = 10100001 = n * 14367
what seems to be a (smallish) counter example (there are more). Did I get you wrong? --[[User:Heiner|Heiner]] ([[User talk:Heiner|talk]]) 18:12, 4 April 2020 (UTC)
73

edits