6
$\begingroup$

The integer $ababab$ $(a>0,b>0)$ is always divisible by $7$, without rest.

I tried to prove this by:

Solve[Mod[(a*10^5 + b*10^4 + a*10^3 + b*10^2 + a*10^1 + b), 7] == 0, {a, b}, PositiveIntegers]

I expected a True as result. What do I wrong?

What does the result show?

$\{\{a\to \fbox{$7 c_1\text{ if }(c_2|c_1)\in \mathbb{Z}\land c_1\geq 1\land c_2\geq 0$},b\to \fbox{$7 c_2+1\text{ if }(c_2|c_1)\in \mathbb{Z}\land c_1\geq 1\land c_2\geq 0$}\},...\}$

$\endgroup$
4
  • $\begingroup$ Could someone please include a variation with Divisible? $\endgroup$
    – Syed
    Commented Feb 22, 2022 at 10:21
  • 1
    $\begingroup$ @Syed Just included. $\endgroup$
    – Artes
    Commented Feb 22, 2022 at 10:35
  • 1
    $\begingroup$ Isn't it called a "remainder"? For me, "without rest" means that it does not take a nap. $\endgroup$ Commented Feb 24, 2022 at 9:33
  • $\begingroup$ "rest" is an the Englishification of the corresponding Swedish term :). $\endgroup$ Commented Feb 26, 2022 at 18:39

3 Answers 3

11
$\begingroup$

One may regard this question as the test of the system ability of proving theorems, but there is another view to understand what lies beneath this theorem.

Then we figure out that the problem is quite trivial.

$$a\;10^5+a\; 10^3+a\; 10 +b\; 10^4+b \;10^2+b=101010 a+ 10101 b$$

The simplest proof:

    And @@ Divisible[{101010, 10101}, 7]
True

Stronger theorem: all common divisors divide the number $ababab$:

Intersection[Divisors[101010], Divisors[10101]]
{1, 3, 7, 13, 21, 37, 39, 91, 111, 259, 273, 481, 777, 1443, 3367, 10101}

among them $7$, regardless $a$ and $b$ are positive or nonnegative integers. Q.E.D.

$\endgroup$
1
  • 1
    $\begingroup$ The set Divisors[10101] is a subsection of Divisors[101010] namely And @@ Divisible[101010, Divisors[10101]] yields True. $\endgroup$
    – Artes
    Commented Feb 22, 2022 at 11:44
7
$\begingroup$
Reduce[ForAll[{a, b}, 
a > 0 && b > 0 && a ∈ Integers && b ∈ Integers, 
Mod[(a*10^5 + b*10^4 + a*10^3 + b*10^2 + a*10^1 + b), 7] == 0], {a, 
 b}]

(*   True   *)
$\endgroup$
2
  • $\begingroup$ Great, this works too: Reduce[ForAll[{a, b}, a \[Element] PositiveIntegers && b \[Element] PositiveIntegers, Mod[(a*10^5 + b*10^4 + a*10^3 + b*10^2 + a*10^1 + b), 7] == 0], {a, b}] $\endgroup$
    – mrz
    Commented Feb 22, 2022 at 9:31
  • $\begingroup$ My version 8.0 doesn't know PositiveIntegers ... $\endgroup$
    – Akku14
    Commented Feb 22, 2022 at 9:53
4
$\begingroup$
Simplify[Mod[FromDigits[{a, b, a, b, a, b}], 7]==0, {a, b} ∈ 
  PositiveIntegers]

True

BTW,{a, b} ∈ Integers also work.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.