(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 next
run
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 90909090909091
OK
|
Posted by Charlie
on 2011-01-13 14:24:15 |