$begingroup$
What I am trying to achieve is related to cryptography/blockchain/bitcoin so the largest number here is huge...in other words: I want to find the largest multiple of 7 which is lower than this number:
$115792089237316195423570985008687907852837564279074904382605163141518161494336 $
I can just go to WolframAlpha and type "multiples of 7" and I get a list of the multiples relatively fast but it will take some time until I keep hitting "more" to get to a number lower than this above.
elementary-number-theory arithmetic
New contributor
kpopguy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
What I am trying to achieve is related to cryptography/blockchain/bitcoin so the largest number here is huge...in other words: I want to find the largest multiple of 7 which is lower than this number:
$115792089237316195423570985008687907852837564279074904382605163141518161494336 $
I can just go to WolframAlpha and type "multiples of 7" and I get a list of the multiples relatively fast but it will take some time until I keep hitting "more" to get to a number lower than this above.
elementary-number-theory arithmetic
New contributor
kpopguy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
$begingroup$
m.wolframalpha.com/input/… works a lot easier it lists as 2 mod 7.
$endgroup$
– Roddy MacPhee
20 mins ago
$begingroup$
78 digits is semi small cryptographically compared to 617 digit (2048 bit) crypto keys.
$endgroup$
– Roddy MacPhee
9 mins ago
$begingroup$
I would very much like (aka 'prefer') to see a solution which does not require use of extended-precision or large-integer software packages. (Compare with, e.g., the simple "sum the digits" approach for multiples of 3). Is Roddy's answer the only such?
$endgroup$
– Carl Witthoft
36 secs ago
add a comment |
$begingroup$
What I am trying to achieve is related to cryptography/blockchain/bitcoin so the largest number here is huge...in other words: I want to find the largest multiple of 7 which is lower than this number:
$115792089237316195423570985008687907852837564279074904382605163141518161494336 $
I can just go to WolframAlpha and type "multiples of 7" and I get a list of the multiples relatively fast but it will take some time until I keep hitting "more" to get to a number lower than this above.
elementary-number-theory arithmetic
New contributor
kpopguy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
What I am trying to achieve is related to cryptography/blockchain/bitcoin so the largest number here is huge...in other words: I want to find the largest multiple of 7 which is lower than this number:
$115792089237316195423570985008687907852837564279074904382605163141518161494336 $
I can just go to WolframAlpha and type "multiples of 7" and I get a list of the multiples relatively fast but it will take some time until I keep hitting "more" to get to a number lower than this above.
elementary-number-theory arithmetic
elementary-number-theory arithmetic
New contributor
kpopguy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
kpopguy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 14 mins ago
Especially Lime
22.4k22858
22.4k22858
New contributor
kpopguy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 hours ago
kpopguykpopguy
233
233
New contributor
kpopguy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
kpopguy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
kpopguy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$begingroup$
m.wolframalpha.com/input/… works a lot easier it lists as 2 mod 7.
$endgroup$
– Roddy MacPhee
20 mins ago
$begingroup$
78 digits is semi small cryptographically compared to 617 digit (2048 bit) crypto keys.
$endgroup$
– Roddy MacPhee
9 mins ago
$begingroup$
I would very much like (aka 'prefer') to see a solution which does not require use of extended-precision or large-integer software packages. (Compare with, e.g., the simple "sum the digits" approach for multiples of 3). Is Roddy's answer the only such?
$endgroup$
– Carl Witthoft
36 secs ago
add a comment |
$begingroup$
m.wolframalpha.com/input/… works a lot easier it lists as 2 mod 7.
$endgroup$
– Roddy MacPhee
20 mins ago
$begingroup$
78 digits is semi small cryptographically compared to 617 digit (2048 bit) crypto keys.
$endgroup$
– Roddy MacPhee
9 mins ago
$begingroup$
I would very much like (aka 'prefer') to see a solution which does not require use of extended-precision or large-integer software packages. (Compare with, e.g., the simple "sum the digits" approach for multiples of 3). Is Roddy's answer the only such?
$endgroup$
– Carl Witthoft
36 secs ago
$begingroup$
m.wolframalpha.com/input/… works a lot easier it lists as 2 mod 7.
$endgroup$
– Roddy MacPhee
20 mins ago
$begingroup$
m.wolframalpha.com/input/… works a lot easier it lists as 2 mod 7.
$endgroup$
– Roddy MacPhee
20 mins ago
$begingroup$
78 digits is semi small cryptographically compared to 617 digit (2048 bit) crypto keys.
$endgroup$
– Roddy MacPhee
9 mins ago
$begingroup$
78 digits is semi small cryptographically compared to 617 digit (2048 bit) crypto keys.
$endgroup$
– Roddy MacPhee
9 mins ago
$begingroup$
I would very much like (aka 'prefer') to see a solution which does not require use of extended-precision or large-integer software packages. (Compare with, e.g., the simple "sum the digits" approach for multiples of 3). Is Roddy's answer the only such?
$endgroup$
– Carl Witthoft
36 secs ago
$begingroup$
I would very much like (aka 'prefer') to see a solution which does not require use of extended-precision or large-integer software packages. (Compare with, e.g., the simple "sum the digits" approach for multiples of 3). Is Roddy's answer the only such?
$endgroup$
– Carl Witthoft
36 secs ago
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
One can compute this number $a$ modulo $7$. The result is $2bmod 7$. So take $a-2$. It is the largest multiple of $7$ less than $a$.
$endgroup$
$begingroup$
thanks, this should work
$endgroup$
– kpopguy
2 hours ago
$begingroup$
@PeterSzilas See How to compute modulo, or similar links. With wolframalpha, compute it here.
$endgroup$
– Dietrich Burde
2 hours ago
$begingroup$
Dietrich.Thanks.Any advantage to using the modulo calculator, why not just divide (calculator) and find remainder ?You have to enter this lengthy number anyway? Hope this question is not too trivial.Thanks.
$endgroup$
– Peter Szilas
2 hours ago
$begingroup$
@Peter When you are using such big numbers (and given the context), you would usually not be typing in the number, but writing a program (in Python or Go, etc). This is a more efficient method than, say dividing the number by 7 and the successively smaller numbers till the remainder is 0.
$endgroup$
– Devashish Kaushik
1 hour ago
$begingroup$
Davashish.Thank you. My questions came up when I read 2 mod 7, where from ?As you can see not a number cruncher:)Thank you for your comment.
$endgroup$
– Peter Szilas
50 mins ago
add a comment |
$begingroup$
$$begin{array}{cccccc}115792&089237&316195&423570&985008&687907\852837&564279&074904&382605&163141&518161\494336end{array}$$
Sum up the places of these numbers, by place value carrying when needed, then apply $10^kequiv 3^k bmod 7$ you'll then have a much smaller number to find the remainder of that's equivalent.
5667972, which goes to :$$6(3^5)+6(3^4)+2(3^2)equiv 1458+486+18equiv 2+3+4equiv 2 bmod 7$$ so the largest multiple of 7, is 2 less than the number. Yes, this is a slightly tedious way to go, but it's inspired via extension of Fermat's little theorem, and polynomial remainder theorem.
$endgroup$
add a comment |
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
});
}
});
kpopguy 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%2f3152587%2fhow-to-find-the-largest-mutiple-of-7-which-is-lower-than-another-number%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
One can compute this number $a$ modulo $7$. The result is $2bmod 7$. So take $a-2$. It is the largest multiple of $7$ less than $a$.
$endgroup$
$begingroup$
thanks, this should work
$endgroup$
– kpopguy
2 hours ago
$begingroup$
@PeterSzilas See How to compute modulo, or similar links. With wolframalpha, compute it here.
$endgroup$
– Dietrich Burde
2 hours ago
$begingroup$
Dietrich.Thanks.Any advantage to using the modulo calculator, why not just divide (calculator) and find remainder ?You have to enter this lengthy number anyway? Hope this question is not too trivial.Thanks.
$endgroup$
– Peter Szilas
2 hours ago
$begingroup$
@Peter When you are using such big numbers (and given the context), you would usually not be typing in the number, but writing a program (in Python or Go, etc). This is a more efficient method than, say dividing the number by 7 and the successively smaller numbers till the remainder is 0.
$endgroup$
– Devashish Kaushik
1 hour ago
$begingroup$
Davashish.Thank you. My questions came up when I read 2 mod 7, where from ?As you can see not a number cruncher:)Thank you for your comment.
$endgroup$
– Peter Szilas
50 mins ago
add a comment |
$begingroup$
One can compute this number $a$ modulo $7$. The result is $2bmod 7$. So take $a-2$. It is the largest multiple of $7$ less than $a$.
$endgroup$
$begingroup$
thanks, this should work
$endgroup$
– kpopguy
2 hours ago
$begingroup$
@PeterSzilas See How to compute modulo, or similar links. With wolframalpha, compute it here.
$endgroup$
– Dietrich Burde
2 hours ago
$begingroup$
Dietrich.Thanks.Any advantage to using the modulo calculator, why not just divide (calculator) and find remainder ?You have to enter this lengthy number anyway? Hope this question is not too trivial.Thanks.
$endgroup$
– Peter Szilas
2 hours ago
$begingroup$
@Peter When you are using such big numbers (and given the context), you would usually not be typing in the number, but writing a program (in Python or Go, etc). This is a more efficient method than, say dividing the number by 7 and the successively smaller numbers till the remainder is 0.
$endgroup$
– Devashish Kaushik
1 hour ago
$begingroup$
Davashish.Thank you. My questions came up when I read 2 mod 7, where from ?As you can see not a number cruncher:)Thank you for your comment.
$endgroup$
– Peter Szilas
50 mins ago
add a comment |
$begingroup$
One can compute this number $a$ modulo $7$. The result is $2bmod 7$. So take $a-2$. It is the largest multiple of $7$ less than $a$.
$endgroup$
One can compute this number $a$ modulo $7$. The result is $2bmod 7$. So take $a-2$. It is the largest multiple of $7$ less than $a$.
answered 2 hours ago
Dietrich BurdeDietrich Burde
80.8k647104
80.8k647104
$begingroup$
thanks, this should work
$endgroup$
– kpopguy
2 hours ago
$begingroup$
@PeterSzilas See How to compute modulo, or similar links. With wolframalpha, compute it here.
$endgroup$
– Dietrich Burde
2 hours ago
$begingroup$
Dietrich.Thanks.Any advantage to using the modulo calculator, why not just divide (calculator) and find remainder ?You have to enter this lengthy number anyway? Hope this question is not too trivial.Thanks.
$endgroup$
– Peter Szilas
2 hours ago
$begingroup$
@Peter When you are using such big numbers (and given the context), you would usually not be typing in the number, but writing a program (in Python or Go, etc). This is a more efficient method than, say dividing the number by 7 and the successively smaller numbers till the remainder is 0.
$endgroup$
– Devashish Kaushik
1 hour ago
$begingroup$
Davashish.Thank you. My questions came up when I read 2 mod 7, where from ?As you can see not a number cruncher:)Thank you for your comment.
$endgroup$
– Peter Szilas
50 mins ago
add a comment |
$begingroup$
thanks, this should work
$endgroup$
– kpopguy
2 hours ago
$begingroup$
@PeterSzilas See How to compute modulo, or similar links. With wolframalpha, compute it here.
$endgroup$
– Dietrich Burde
2 hours ago
$begingroup$
Dietrich.Thanks.Any advantage to using the modulo calculator, why not just divide (calculator) and find remainder ?You have to enter this lengthy number anyway? Hope this question is not too trivial.Thanks.
$endgroup$
– Peter Szilas
2 hours ago
$begingroup$
@Peter When you are using such big numbers (and given the context), you would usually not be typing in the number, but writing a program (in Python or Go, etc). This is a more efficient method than, say dividing the number by 7 and the successively smaller numbers till the remainder is 0.
$endgroup$
– Devashish Kaushik
1 hour ago
$begingroup$
Davashish.Thank you. My questions came up when I read 2 mod 7, where from ?As you can see not a number cruncher:)Thank you for your comment.
$endgroup$
– Peter Szilas
50 mins ago
$begingroup$
thanks, this should work
$endgroup$
– kpopguy
2 hours ago
$begingroup$
thanks, this should work
$endgroup$
– kpopguy
2 hours ago
$begingroup$
@PeterSzilas See How to compute modulo, or similar links. With wolframalpha, compute it here.
$endgroup$
– Dietrich Burde
2 hours ago
$begingroup$
@PeterSzilas See How to compute modulo, or similar links. With wolframalpha, compute it here.
$endgroup$
– Dietrich Burde
2 hours ago
$begingroup$
Dietrich.Thanks.Any advantage to using the modulo calculator, why not just divide (calculator) and find remainder ?You have to enter this lengthy number anyway? Hope this question is not too trivial.Thanks.
$endgroup$
– Peter Szilas
2 hours ago
$begingroup$
Dietrich.Thanks.Any advantage to using the modulo calculator, why not just divide (calculator) and find remainder ?You have to enter this lengthy number anyway? Hope this question is not too trivial.Thanks.
$endgroup$
– Peter Szilas
2 hours ago
$begingroup$
@Peter When you are using such big numbers (and given the context), you would usually not be typing in the number, but writing a program (in Python or Go, etc). This is a more efficient method than, say dividing the number by 7 and the successively smaller numbers till the remainder is 0.
$endgroup$
– Devashish Kaushik
1 hour ago
$begingroup$
@Peter When you are using such big numbers (and given the context), you would usually not be typing in the number, but writing a program (in Python or Go, etc). This is a more efficient method than, say dividing the number by 7 and the successively smaller numbers till the remainder is 0.
$endgroup$
– Devashish Kaushik
1 hour ago
$begingroup$
Davashish.Thank you. My questions came up when I read 2 mod 7, where from ?As you can see not a number cruncher:)Thank you for your comment.
$endgroup$
– Peter Szilas
50 mins ago
$begingroup$
Davashish.Thank you. My questions came up when I read 2 mod 7, where from ?As you can see not a number cruncher:)Thank you for your comment.
$endgroup$
– Peter Szilas
50 mins ago
add a comment |
$begingroup$
$$begin{array}{cccccc}115792&089237&316195&423570&985008&687907\852837&564279&074904&382605&163141&518161\494336end{array}$$
Sum up the places of these numbers, by place value carrying when needed, then apply $10^kequiv 3^k bmod 7$ you'll then have a much smaller number to find the remainder of that's equivalent.
5667972, which goes to :$$6(3^5)+6(3^4)+2(3^2)equiv 1458+486+18equiv 2+3+4equiv 2 bmod 7$$ so the largest multiple of 7, is 2 less than the number. Yes, this is a slightly tedious way to go, but it's inspired via extension of Fermat's little theorem, and polynomial remainder theorem.
$endgroup$
add a comment |
$begingroup$
$$begin{array}{cccccc}115792&089237&316195&423570&985008&687907\852837&564279&074904&382605&163141&518161\494336end{array}$$
Sum up the places of these numbers, by place value carrying when needed, then apply $10^kequiv 3^k bmod 7$ you'll then have a much smaller number to find the remainder of that's equivalent.
5667972, which goes to :$$6(3^5)+6(3^4)+2(3^2)equiv 1458+486+18equiv 2+3+4equiv 2 bmod 7$$ so the largest multiple of 7, is 2 less than the number. Yes, this is a slightly tedious way to go, but it's inspired via extension of Fermat's little theorem, and polynomial remainder theorem.
$endgroup$
add a comment |
$begingroup$
$$begin{array}{cccccc}115792&089237&316195&423570&985008&687907\852837&564279&074904&382605&163141&518161\494336end{array}$$
Sum up the places of these numbers, by place value carrying when needed, then apply $10^kequiv 3^k bmod 7$ you'll then have a much smaller number to find the remainder of that's equivalent.
5667972, which goes to :$$6(3^5)+6(3^4)+2(3^2)equiv 1458+486+18equiv 2+3+4equiv 2 bmod 7$$ so the largest multiple of 7, is 2 less than the number. Yes, this is a slightly tedious way to go, but it's inspired via extension of Fermat's little theorem, and polynomial remainder theorem.
$endgroup$
$$begin{array}{cccccc}115792&089237&316195&423570&985008&687907\852837&564279&074904&382605&163141&518161\494336end{array}$$
Sum up the places of these numbers, by place value carrying when needed, then apply $10^kequiv 3^k bmod 7$ you'll then have a much smaller number to find the remainder of that's equivalent.
5667972, which goes to :$$6(3^5)+6(3^4)+2(3^2)equiv 1458+486+18equiv 2+3+4equiv 2 bmod 7$$ so the largest multiple of 7, is 2 less than the number. Yes, this is a slightly tedious way to go, but it's inspired via extension of Fermat's little theorem, and polynomial remainder theorem.
answered 44 mins ago
Roddy MacPheeRoddy MacPhee
384116
384116
add a comment |
add a comment |
kpopguy is a new contributor. Be nice, and check out our Code of Conduct.
kpopguy is a new contributor. Be nice, and check out our Code of Conduct.
kpopguy is a new contributor. Be nice, and check out our Code of Conduct.
kpopguy 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%2f3152587%2fhow-to-find-the-largest-mutiple-of-7-which-is-lower-than-another-number%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
$begingroup$
m.wolframalpha.com/input/… works a lot easier it lists as 2 mod 7.
$endgroup$
– Roddy MacPhee
20 mins ago
$begingroup$
78 digits is semi small cryptographically compared to 617 digit (2048 bit) crypto keys.
$endgroup$
– Roddy MacPhee
9 mins ago
$begingroup$
I would very much like (aka 'prefer') to see a solution which does not require use of extended-precision or large-integer software packages. (Compare with, e.g., the simple "sum the digits" approach for multiples of 3). Is Roddy's answer the only such?
$endgroup$
– Carl Witthoft
36 secs ago