Solving for solutions to $left(a+bright)^2=a.b$Solve $frac{b}{a}=a.b$ in decimalSolve $x^4 - 2x^3 + x = y^4 +...
Does the US political system, in principle, allow for a no-party system?
What is the oldest European royal house?
Short story about an infectious indestructible metal bar?
A running toilet that stops itself
Insult for someone who "doesn't know anything"
How to make sure I'm assertive enough in contact with subordinates?
School performs periodic password audits. Is my password compromised?
Why do phishing e-mails use faked e-mail addresses instead of the real one?
What do you call someone who likes to pick fights?
Has a sovereign Communist government ever run, and conceded loss, on a fair election?
How to install "rounded" brake pads
Why would /etc/passwd be used every time someone executes `ls -l` command?
Was this cameo in Captain Marvel computer generated?
Tabular environment - text vertically positions itself by bottom of tikz picture in adjacent cell
How do you use environments that have the same name within a single latex document?
How to educate team mate to take screenshots for bugs with out unwanted stuff
What is the orbit and expected lifetime of Crew Dragon trunk?
Too soon for a plot twist?
Should we avoid writing fiction about historical events without extensive research?
The (Easy) Road to Code
An Undercover Army
Should I apply for my boss's promotion?
Was it really inappropriate to write a pull request for the company I interviewed with?
Why do we call complex numbers “numbers” but we don’t consider 2-vectors numbers?
Solving for solutions to $left(a+bright)^2=a.b$
Solve $frac{b}{a}=a.b$ in decimalSolve $x^4 - 2x^3 + x = y^4 + 3y^2 + y wedge (x,y) in mathbb{Z}^2$What is the explicit formula (solution) to this recursively defined binary matrix?integer solutions for $left( a+sqrt{b} right) ^ n=p+qsqrt{b}$?An alternative proof for Bertrand's Postulate when $n ge 36$$G(n) = 1 + sumlimits_{ substack{d|n\d != 1\dneq n}}G(n /d)$, how to solve for $G(n)=n$.Why is it so hard to find numbers with some palindromic properties?How to prove $logleft(frac e{2t}right) approx logleft(frac1tright)$ for $0 < t < frac 12$?Patterns in solutions to simultaneous palindromes in two number basesSolving for $x$ in $y=Ncdotleft(frac{10}{x}right)^{-2.6}$
$begingroup$
I ran across this stackoverflow question regarding finding solutions to
$$left(a+bright)^2=a.b$$
for $a,binBbb{N}$ where $a.b$ denotes concatenation of $a$ and $b$. Since concatenation isn't really a "true" mathematical operation, I'll write
$$left(a+bright)^2=atimes10^c+b$$
where $c=lfloor{log_{10}b}rfloor+1$. The post there also has an implicit stipulation that neither $a$ nor $b$ may contain leading zeros, but that does not matter for the sake of this question- I can filter those solutions later. I wish to gain some mathematical insight into the pattern of these solutions, so that maybe I can write a more efficient solver.
The naive method of searching for solutions by iterating over pairs of $a$ and $b$ takes $Oleft(n^2right)$ time. By instead iterating over all squares $i^2$, and decomposing each into $lfloor2log_{10}irfloor$ separate $a,b$ pairs, we can search for solutions in $Oleft(nlog(n)right)$ time. I've since realized that because $a,b<i$ and $atimes10^c+b=i^2$, that $a$ and $b$ must both be within $+0/-2$ orders of magnitude of $i$, and so there is at most three possibly valid $a,b$ pairs per $i^2$. This brings the time complexity down to $Oleft(nright)$, but I still feel like there might be other mathematical insights that could allow me to prune other invalid $a,b$, whether they result in an asymptotic speedup or not.
Is there a closed-form solution to this problem, or any particular pattern to the $a$ and $b$ forming valid solutions?
algebra-precalculus elementary-number-theory
New contributor
Dillon Davis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
|
show 3 more comments
$begingroup$
I ran across this stackoverflow question regarding finding solutions to
$$left(a+bright)^2=a.b$$
for $a,binBbb{N}$ where $a.b$ denotes concatenation of $a$ and $b$. Since concatenation isn't really a "true" mathematical operation, I'll write
$$left(a+bright)^2=atimes10^c+b$$
where $c=lfloor{log_{10}b}rfloor+1$. The post there also has an implicit stipulation that neither $a$ nor $b$ may contain leading zeros, but that does not matter for the sake of this question- I can filter those solutions later. I wish to gain some mathematical insight into the pattern of these solutions, so that maybe I can write a more efficient solver.
The naive method of searching for solutions by iterating over pairs of $a$ and $b$ takes $Oleft(n^2right)$ time. By instead iterating over all squares $i^2$, and decomposing each into $lfloor2log_{10}irfloor$ separate $a,b$ pairs, we can search for solutions in $Oleft(nlog(n)right)$ time. I've since realized that because $a,b<i$ and $atimes10^c+b=i^2$, that $a$ and $b$ must both be within $+0/-2$ orders of magnitude of $i$, and so there is at most three possibly valid $a,b$ pairs per $i^2$. This brings the time complexity down to $Oleft(nright)$, but I still feel like there might be other mathematical insights that could allow me to prune other invalid $a,b$, whether they result in an asymptotic speedup or not.
Is there a closed-form solution to this problem, or any particular pattern to the $a$ and $b$ forming valid solutions?
algebra-precalculus elementary-number-theory
New contributor
Dillon Davis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
2
$begingroup$
Reducing modulo $a$ gives $b^2 equiv b pmod a$, and hence $b^2 equiv b mod m$ if $m mid a$. For generic $a$ this leads to strong restrictions on $b$. For prime $a = p$ (or prime factors $p$ of $a$) this implies $b = 0, 1 pmod p$.
$endgroup$
– Travis
Mar 4 at 2:26
2
$begingroup$
Your formula for concatenation isn't quite right. It's problematic when $b$ is a power of $10$. E.g., if $a=1$ and $b=10$, then $c=lceillog_{10}10rceil=1$ and $atimes10^c+b=20$, not $110$.
$endgroup$
– Barry Cipra
Mar 4 at 2:53
2
$begingroup$
One can just as well prune cases by reducing modulo $b$, which gives $a^2 = 10^c a pmod b$. If $2 mid b$, we get immediately that $2 mid a$, likewise for $5$. Similarly, if $3 mid b$, then we conclude that either $3 mid a$ or $a equiv (-1)^c pmod 3$.
$endgroup$
– Travis
Mar 4 at 3:22
2
$begingroup$
One simple pruning: $a$ must be even, since $(a+b)^2equiv a+b$ mod $2$. So you might as well rewrite the equation to solve as $(2a+b)^2=2atimes10^c+b$. Also, $b$ cannot be congruent to $2$ or $3$ mod $5$, since $(a+b)^2$ is always $0$, $1$, or $4$.
$endgroup$
– Barry Cipra
Mar 4 at 13:01
2
$begingroup$
One other simple pruning: As soon as $b$ has two or more digits, it must be congruent to $0$, $1$, or $4$ mod $8$, since those are the only residues for $(a+b)^2$ (and $a$, as noted in the previous column, is even, so $atimes10^cequiv0$ mod $8$ if $cge2$).
$endgroup$
– Barry Cipra
Mar 4 at 13:12
|
show 3 more comments
$begingroup$
I ran across this stackoverflow question regarding finding solutions to
$$left(a+bright)^2=a.b$$
for $a,binBbb{N}$ where $a.b$ denotes concatenation of $a$ and $b$. Since concatenation isn't really a "true" mathematical operation, I'll write
$$left(a+bright)^2=atimes10^c+b$$
where $c=lfloor{log_{10}b}rfloor+1$. The post there also has an implicit stipulation that neither $a$ nor $b$ may contain leading zeros, but that does not matter for the sake of this question- I can filter those solutions later. I wish to gain some mathematical insight into the pattern of these solutions, so that maybe I can write a more efficient solver.
The naive method of searching for solutions by iterating over pairs of $a$ and $b$ takes $Oleft(n^2right)$ time. By instead iterating over all squares $i^2$, and decomposing each into $lfloor2log_{10}irfloor$ separate $a,b$ pairs, we can search for solutions in $Oleft(nlog(n)right)$ time. I've since realized that because $a,b<i$ and $atimes10^c+b=i^2$, that $a$ and $b$ must both be within $+0/-2$ orders of magnitude of $i$, and so there is at most three possibly valid $a,b$ pairs per $i^2$. This brings the time complexity down to $Oleft(nright)$, but I still feel like there might be other mathematical insights that could allow me to prune other invalid $a,b$, whether they result in an asymptotic speedup or not.
Is there a closed-form solution to this problem, or any particular pattern to the $a$ and $b$ forming valid solutions?
algebra-precalculus elementary-number-theory
New contributor
Dillon Davis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
I ran across this stackoverflow question regarding finding solutions to
$$left(a+bright)^2=a.b$$
for $a,binBbb{N}$ where $a.b$ denotes concatenation of $a$ and $b$. Since concatenation isn't really a "true" mathematical operation, I'll write
$$left(a+bright)^2=atimes10^c+b$$
where $c=lfloor{log_{10}b}rfloor+1$. The post there also has an implicit stipulation that neither $a$ nor $b$ may contain leading zeros, but that does not matter for the sake of this question- I can filter those solutions later. I wish to gain some mathematical insight into the pattern of these solutions, so that maybe I can write a more efficient solver.
The naive method of searching for solutions by iterating over pairs of $a$ and $b$ takes $Oleft(n^2right)$ time. By instead iterating over all squares $i^2$, and decomposing each into $lfloor2log_{10}irfloor$ separate $a,b$ pairs, we can search for solutions in $Oleft(nlog(n)right)$ time. I've since realized that because $a,b<i$ and $atimes10^c+b=i^2$, that $a$ and $b$ must both be within $+0/-2$ orders of magnitude of $i$, and so there is at most three possibly valid $a,b$ pairs per $i^2$. This brings the time complexity down to $Oleft(nright)$, but I still feel like there might be other mathematical insights that could allow me to prune other invalid $a,b$, whether they result in an asymptotic speedup or not.
Is there a closed-form solution to this problem, or any particular pattern to the $a$ and $b$ forming valid solutions?
algebra-precalculus elementary-number-theory
algebra-precalculus elementary-number-theory
New contributor
Dillon Davis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Dillon Davis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited Mar 4 at 2:56
Dillon Davis
New contributor
Dillon Davis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked Mar 4 at 2:17
Dillon DavisDillon Davis
1315
1315
New contributor
Dillon Davis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Dillon Davis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Dillon Davis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
$begingroup$
Reducing modulo $a$ gives $b^2 equiv b pmod a$, and hence $b^2 equiv b mod m$ if $m mid a$. For generic $a$ this leads to strong restrictions on $b$. For prime $a = p$ (or prime factors $p$ of $a$) this implies $b = 0, 1 pmod p$.
$endgroup$
– Travis
Mar 4 at 2:26
2
$begingroup$
Your formula for concatenation isn't quite right. It's problematic when $b$ is a power of $10$. E.g., if $a=1$ and $b=10$, then $c=lceillog_{10}10rceil=1$ and $atimes10^c+b=20$, not $110$.
$endgroup$
– Barry Cipra
Mar 4 at 2:53
2
$begingroup$
One can just as well prune cases by reducing modulo $b$, which gives $a^2 = 10^c a pmod b$. If $2 mid b$, we get immediately that $2 mid a$, likewise for $5$. Similarly, if $3 mid b$, then we conclude that either $3 mid a$ or $a equiv (-1)^c pmod 3$.
$endgroup$
– Travis
Mar 4 at 3:22
2
$begingroup$
One simple pruning: $a$ must be even, since $(a+b)^2equiv a+b$ mod $2$. So you might as well rewrite the equation to solve as $(2a+b)^2=2atimes10^c+b$. Also, $b$ cannot be congruent to $2$ or $3$ mod $5$, since $(a+b)^2$ is always $0$, $1$, or $4$.
$endgroup$
– Barry Cipra
Mar 4 at 13:01
2
$begingroup$
One other simple pruning: As soon as $b$ has two or more digits, it must be congruent to $0$, $1$, or $4$ mod $8$, since those are the only residues for $(a+b)^2$ (and $a$, as noted in the previous column, is even, so $atimes10^cequiv0$ mod $8$ if $cge2$).
$endgroup$
– Barry Cipra
Mar 4 at 13:12
|
show 3 more comments
2
$begingroup$
Reducing modulo $a$ gives $b^2 equiv b pmod a$, and hence $b^2 equiv b mod m$ if $m mid a$. For generic $a$ this leads to strong restrictions on $b$. For prime $a = p$ (or prime factors $p$ of $a$) this implies $b = 0, 1 pmod p$.
$endgroup$
– Travis
Mar 4 at 2:26
2
$begingroup$
Your formula for concatenation isn't quite right. It's problematic when $b$ is a power of $10$. E.g., if $a=1$ and $b=10$, then $c=lceillog_{10}10rceil=1$ and $atimes10^c+b=20$, not $110$.
$endgroup$
– Barry Cipra
Mar 4 at 2:53
2
$begingroup$
One can just as well prune cases by reducing modulo $b$, which gives $a^2 = 10^c a pmod b$. If $2 mid b$, we get immediately that $2 mid a$, likewise for $5$. Similarly, if $3 mid b$, then we conclude that either $3 mid a$ or $a equiv (-1)^c pmod 3$.
$endgroup$
– Travis
Mar 4 at 3:22
2
$begingroup$
One simple pruning: $a$ must be even, since $(a+b)^2equiv a+b$ mod $2$. So you might as well rewrite the equation to solve as $(2a+b)^2=2atimes10^c+b$. Also, $b$ cannot be congruent to $2$ or $3$ mod $5$, since $(a+b)^2$ is always $0$, $1$, or $4$.
$endgroup$
– Barry Cipra
Mar 4 at 13:01
2
$begingroup$
One other simple pruning: As soon as $b$ has two or more digits, it must be congruent to $0$, $1$, or $4$ mod $8$, since those are the only residues for $(a+b)^2$ (and $a$, as noted in the previous column, is even, so $atimes10^cequiv0$ mod $8$ if $cge2$).
$endgroup$
– Barry Cipra
Mar 4 at 13:12
2
2
$begingroup$
Reducing modulo $a$ gives $b^2 equiv b pmod a$, and hence $b^2 equiv b mod m$ if $m mid a$. For generic $a$ this leads to strong restrictions on $b$. For prime $a = p$ (or prime factors $p$ of $a$) this implies $b = 0, 1 pmod p$.
$endgroup$
– Travis
Mar 4 at 2:26
$begingroup$
Reducing modulo $a$ gives $b^2 equiv b pmod a$, and hence $b^2 equiv b mod m$ if $m mid a$. For generic $a$ this leads to strong restrictions on $b$. For prime $a = p$ (or prime factors $p$ of $a$) this implies $b = 0, 1 pmod p$.
$endgroup$
– Travis
Mar 4 at 2:26
2
2
$begingroup$
Your formula for concatenation isn't quite right. It's problematic when $b$ is a power of $10$. E.g., if $a=1$ and $b=10$, then $c=lceillog_{10}10rceil=1$ and $atimes10^c+b=20$, not $110$.
$endgroup$
– Barry Cipra
Mar 4 at 2:53
$begingroup$
Your formula for concatenation isn't quite right. It's problematic when $b$ is a power of $10$. E.g., if $a=1$ and $b=10$, then $c=lceillog_{10}10rceil=1$ and $atimes10^c+b=20$, not $110$.
$endgroup$
– Barry Cipra
Mar 4 at 2:53
2
2
$begingroup$
One can just as well prune cases by reducing modulo $b$, which gives $a^2 = 10^c a pmod b$. If $2 mid b$, we get immediately that $2 mid a$, likewise for $5$. Similarly, if $3 mid b$, then we conclude that either $3 mid a$ or $a equiv (-1)^c pmod 3$.
$endgroup$
– Travis
Mar 4 at 3:22
$begingroup$
One can just as well prune cases by reducing modulo $b$, which gives $a^2 = 10^c a pmod b$. If $2 mid b$, we get immediately that $2 mid a$, likewise for $5$. Similarly, if $3 mid b$, then we conclude that either $3 mid a$ or $a equiv (-1)^c pmod 3$.
$endgroup$
– Travis
Mar 4 at 3:22
2
2
$begingroup$
One simple pruning: $a$ must be even, since $(a+b)^2equiv a+b$ mod $2$. So you might as well rewrite the equation to solve as $(2a+b)^2=2atimes10^c+b$. Also, $b$ cannot be congruent to $2$ or $3$ mod $5$, since $(a+b)^2$ is always $0$, $1$, or $4$.
$endgroup$
– Barry Cipra
Mar 4 at 13:01
$begingroup$
One simple pruning: $a$ must be even, since $(a+b)^2equiv a+b$ mod $2$. So you might as well rewrite the equation to solve as $(2a+b)^2=2atimes10^c+b$. Also, $b$ cannot be congruent to $2$ or $3$ mod $5$, since $(a+b)^2$ is always $0$, $1$, or $4$.
$endgroup$
– Barry Cipra
Mar 4 at 13:01
2
2
$begingroup$
One other simple pruning: As soon as $b$ has two or more digits, it must be congruent to $0$, $1$, or $4$ mod $8$, since those are the only residues for $(a+b)^2$ (and $a$, as noted in the previous column, is even, so $atimes10^cequiv0$ mod $8$ if $cge2$).
$endgroup$
– Barry Cipra
Mar 4 at 13:12
$begingroup$
One other simple pruning: As soon as $b$ has two or more digits, it must be congruent to $0$, $1$, or $4$ mod $8$, since those are the only residues for $(a+b)^2$ (and $a$, as noted in the previous column, is even, so $atimes10^cequiv0$ mod $8$ if $cge2$).
$endgroup$
– Barry Cipra
Mar 4 at 13:12
|
show 3 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Dillon Davis is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3134318%2fsolving-for-solutions-to-leftab-right2-a-b%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Dillon Davis is a new contributor. Be nice, and check out our Code of Conduct.
Dillon Davis is a new contributor. Be nice, and check out our Code of Conduct.
Dillon Davis is a new contributor. Be nice, and check out our Code of Conduct.
Dillon Davis is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3134318%2fsolving-for-solutions-to-leftab-right2-a-b%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
$begingroup$
Reducing modulo $a$ gives $b^2 equiv b pmod a$, and hence $b^2 equiv b mod m$ if $m mid a$. For generic $a$ this leads to strong restrictions on $b$. For prime $a = p$ (or prime factors $p$ of $a$) this implies $b = 0, 1 pmod p$.
$endgroup$
– Travis
Mar 4 at 2:26
2
$begingroup$
Your formula for concatenation isn't quite right. It's problematic when $b$ is a power of $10$. E.g., if $a=1$ and $b=10$, then $c=lceillog_{10}10rceil=1$ and $atimes10^c+b=20$, not $110$.
$endgroup$
– Barry Cipra
Mar 4 at 2:53
2
$begingroup$
One can just as well prune cases by reducing modulo $b$, which gives $a^2 = 10^c a pmod b$. If $2 mid b$, we get immediately that $2 mid a$, likewise for $5$. Similarly, if $3 mid b$, then we conclude that either $3 mid a$ or $a equiv (-1)^c pmod 3$.
$endgroup$
– Travis
Mar 4 at 3:22
2
$begingroup$
One simple pruning: $a$ must be even, since $(a+b)^2equiv a+b$ mod $2$. So you might as well rewrite the equation to solve as $(2a+b)^2=2atimes10^c+b$. Also, $b$ cannot be congruent to $2$ or $3$ mod $5$, since $(a+b)^2$ is always $0$, $1$, or $4$.
$endgroup$
– Barry Cipra
Mar 4 at 13:01
2
$begingroup$
One other simple pruning: As soon as $b$ has two or more digits, it must be congruent to $0$, $1$, or $4$ mod $8$, since those are the only residues for $(a+b)^2$ (and $a$, as noted in the previous column, is even, so $atimes10^cequiv0$ mod $8$ if $cge2$).
$endgroup$
– Barry Cipra
Mar 4 at 13:12