All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 I WONDER (Posted on 2011-01-13)

Can you provide a simple YES or NO correct answer to the question :
Is 1010101......101 (n ones interwoven with n-1 zeroes) evenly divisible (i.e. without remainder) by 111…1(a string of n ones)?

Rem: n>1

Comments: ( Back to comment list | You must be logged in to post comments.)
 re: my solution | Comment 2 of 10 |
(In reply to my solution by Daniel)

The other interpretation would assume the particular value of n is known. If n is odd, then the divisibility is present; if n is even it is not:

`list   10   for N=2 to 15   20     A=(100^N-1)//99   30     B=(10^N-1)//9   40     Q=A//B   50     print A;B,Q  100   nextrun`

Quotient is shown in last column below. Slash is doubled for those that are not integers, due to the way UBASIC displays rationals.

` 101  11         101//11 10101  111      91 1010101  1111   10001//11 101010101  11111        9091 10101010101  111111     1000001//11 1010101010101  1111111          909091 101010101010101  11111111       100000001//11 10101010101010101  111111111    90909091 1010101010101010101  1111111111         10000000001//11 101010101010101010101  11111111111      9090909091 10101010101010101010101  111111111111   1000000000001//11 1010101010101010101010101  1111111111111        909090909091 101010101010101010101010101  11111111111111     100000000000001//11 10101010101010101010101010101  111111111111111          90909090909091OK`

 Posted by Charlie on 2011-01-13 14:24:15

 Search: Search body:
Forums (0)