Is it possible to find a closed form using modular arithmetic?
$begingroup$
Look at this sequence:
$$a_n=left{1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, cdots right}$$
This is a periodic sequence. Repeating block is $left{1, 0, 0, 2right}.$
Here is my closed form:
$$a_n = frac 14((-1)^n + (2 + i) (-i)^n + (2 - i) i^n + 3)$$
where, $i^2=-1$
Is it possible to find a closed form using modular arithmetic?
I mean for example,
$Amod 3+Bmod 4 cdots cdots cdots$
Is it possible?
sequences-and-series number-theory elementary-number-theory modular-arithmetic closed-form
$endgroup$
add a comment |
$begingroup$
Look at this sequence:
$$a_n=left{1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, cdots right}$$
This is a periodic sequence. Repeating block is $left{1, 0, 0, 2right}.$
Here is my closed form:
$$a_n = frac 14((-1)^n + (2 + i) (-i)^n + (2 - i) i^n + 3)$$
where, $i^2=-1$
Is it possible to find a closed form using modular arithmetic?
I mean for example,
$Amod 3+Bmod 4 cdots cdots cdots$
Is it possible?
sequences-and-series number-theory elementary-number-theory modular-arithmetic closed-form
$endgroup$
add a comment |
$begingroup$
Look at this sequence:
$$a_n=left{1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, cdots right}$$
This is a periodic sequence. Repeating block is $left{1, 0, 0, 2right}.$
Here is my closed form:
$$a_n = frac 14((-1)^n + (2 + i) (-i)^n + (2 - i) i^n + 3)$$
where, $i^2=-1$
Is it possible to find a closed form using modular arithmetic?
I mean for example,
$Amod 3+Bmod 4 cdots cdots cdots$
Is it possible?
sequences-and-series number-theory elementary-number-theory modular-arithmetic closed-form
$endgroup$
Look at this sequence:
$$a_n=left{1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, cdots right}$$
This is a periodic sequence. Repeating block is $left{1, 0, 0, 2right}.$
Here is my closed form:
$$a_n = frac 14((-1)^n + (2 + i) (-i)^n + (2 - i) i^n + 3)$$
where, $i^2=-1$
Is it possible to find a closed form using modular arithmetic?
I mean for example,
$Amod 3+Bmod 4 cdots cdots cdots$
Is it possible?
sequences-and-series number-theory elementary-number-theory modular-arithmetic closed-form
sequences-and-series number-theory elementary-number-theory modular-arithmetic closed-form
edited Jan 25 at 7:25
Elementary
asked Jan 24 at 23:02
ElementaryElementary
360111
360111
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
You want a function of $n$ that behaves as follows:
$f(n) = begin{cases} 1 text{ if } n mod 4 = 1\ 0 text{ if } n mod 4 = 2,3\ 2 text{ if } n mod 4 = 0end{cases}$
Let's denote $n mod 4$ by $n'$. The polynomial $n'(n'-2)(n'-3)$ is $0$ when $n'=0,2,3$ and takes the value $2$ when $n'=1$. So this suggests
$frac 1 2 n'(n'-2)(n'-3)$
should be part of a closed form expression. Similarly $(n'-1)(n'-2)(n'-3)$ is $0$ when $n'=1,2,3$ and takes the value $-6$ when $n'=0$. So this suggests
$-frac 1 3 (n'-1)(n'-2)(n'-3)$
should be part of the expression too. So we have
$f(n) = frac 1 2 n'(n'-2)(n'-3) - frac 1 3 (n'-1)(n'-2)(n'-3)\
= frac 1 6 (n'+2)(n'-2)(n'-3) \
= frac 1 6 (n'^3 -3n'^2 -4n'+12) text{ where } n'=nmod 4$
$endgroup$
$begingroup$
That polynomial is the one interpolating $(1,1),(2,0),(3,0),(4,2)$.
$endgroup$
– lhf
Jan 25 at 10:19
add a comment |
$begingroup$
Using modular-arithmetic is quite similar to using floor functions so you can also use that instead. Here is a possible solution:
$$
f(n) = frac{1}{6}left((n-4lfloor n/4rfloor)^3 -3(n-4lfloor n/4rfloor)^2 - 4(n-lfloor n/4 rfloor) + 12 right)
$$
In this case $n-4lfloor n/4 rfloor$ would be the same as $npmod 4$.
$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
});
}
});
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%2f3086488%2fis-it-possible-to-find-a-closed-form-using-modular-arithmetic%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$
You want a function of $n$ that behaves as follows:
$f(n) = begin{cases} 1 text{ if } n mod 4 = 1\ 0 text{ if } n mod 4 = 2,3\ 2 text{ if } n mod 4 = 0end{cases}$
Let's denote $n mod 4$ by $n'$. The polynomial $n'(n'-2)(n'-3)$ is $0$ when $n'=0,2,3$ and takes the value $2$ when $n'=1$. So this suggests
$frac 1 2 n'(n'-2)(n'-3)$
should be part of a closed form expression. Similarly $(n'-1)(n'-2)(n'-3)$ is $0$ when $n'=1,2,3$ and takes the value $-6$ when $n'=0$. So this suggests
$-frac 1 3 (n'-1)(n'-2)(n'-3)$
should be part of the expression too. So we have
$f(n) = frac 1 2 n'(n'-2)(n'-3) - frac 1 3 (n'-1)(n'-2)(n'-3)\
= frac 1 6 (n'+2)(n'-2)(n'-3) \
= frac 1 6 (n'^3 -3n'^2 -4n'+12) text{ where } n'=nmod 4$
$endgroup$
$begingroup$
That polynomial is the one interpolating $(1,1),(2,0),(3,0),(4,2)$.
$endgroup$
– lhf
Jan 25 at 10:19
add a comment |
$begingroup$
You want a function of $n$ that behaves as follows:
$f(n) = begin{cases} 1 text{ if } n mod 4 = 1\ 0 text{ if } n mod 4 = 2,3\ 2 text{ if } n mod 4 = 0end{cases}$
Let's denote $n mod 4$ by $n'$. The polynomial $n'(n'-2)(n'-3)$ is $0$ when $n'=0,2,3$ and takes the value $2$ when $n'=1$. So this suggests
$frac 1 2 n'(n'-2)(n'-3)$
should be part of a closed form expression. Similarly $(n'-1)(n'-2)(n'-3)$ is $0$ when $n'=1,2,3$ and takes the value $-6$ when $n'=0$. So this suggests
$-frac 1 3 (n'-1)(n'-2)(n'-3)$
should be part of the expression too. So we have
$f(n) = frac 1 2 n'(n'-2)(n'-3) - frac 1 3 (n'-1)(n'-2)(n'-3)\
= frac 1 6 (n'+2)(n'-2)(n'-3) \
= frac 1 6 (n'^3 -3n'^2 -4n'+12) text{ where } n'=nmod 4$
$endgroup$
$begingroup$
That polynomial is the one interpolating $(1,1),(2,0),(3,0),(4,2)$.
$endgroup$
– lhf
Jan 25 at 10:19
add a comment |
$begingroup$
You want a function of $n$ that behaves as follows:
$f(n) = begin{cases} 1 text{ if } n mod 4 = 1\ 0 text{ if } n mod 4 = 2,3\ 2 text{ if } n mod 4 = 0end{cases}$
Let's denote $n mod 4$ by $n'$. The polynomial $n'(n'-2)(n'-3)$ is $0$ when $n'=0,2,3$ and takes the value $2$ when $n'=1$. So this suggests
$frac 1 2 n'(n'-2)(n'-3)$
should be part of a closed form expression. Similarly $(n'-1)(n'-2)(n'-3)$ is $0$ when $n'=1,2,3$ and takes the value $-6$ when $n'=0$. So this suggests
$-frac 1 3 (n'-1)(n'-2)(n'-3)$
should be part of the expression too. So we have
$f(n) = frac 1 2 n'(n'-2)(n'-3) - frac 1 3 (n'-1)(n'-2)(n'-3)\
= frac 1 6 (n'+2)(n'-2)(n'-3) \
= frac 1 6 (n'^3 -3n'^2 -4n'+12) text{ where } n'=nmod 4$
$endgroup$
You want a function of $n$ that behaves as follows:
$f(n) = begin{cases} 1 text{ if } n mod 4 = 1\ 0 text{ if } n mod 4 = 2,3\ 2 text{ if } n mod 4 = 0end{cases}$
Let's denote $n mod 4$ by $n'$. The polynomial $n'(n'-2)(n'-3)$ is $0$ when $n'=0,2,3$ and takes the value $2$ when $n'=1$. So this suggests
$frac 1 2 n'(n'-2)(n'-3)$
should be part of a closed form expression. Similarly $(n'-1)(n'-2)(n'-3)$ is $0$ when $n'=1,2,3$ and takes the value $-6$ when $n'=0$. So this suggests
$-frac 1 3 (n'-1)(n'-2)(n'-3)$
should be part of the expression too. So we have
$f(n) = frac 1 2 n'(n'-2)(n'-3) - frac 1 3 (n'-1)(n'-2)(n'-3)\
= frac 1 6 (n'+2)(n'-2)(n'-3) \
= frac 1 6 (n'^3 -3n'^2 -4n'+12) text{ where } n'=nmod 4$
answered Jan 25 at 10:16
gandalf61gandalf61
9,109825
9,109825
$begingroup$
That polynomial is the one interpolating $(1,1),(2,0),(3,0),(4,2)$.
$endgroup$
– lhf
Jan 25 at 10:19
add a comment |
$begingroup$
That polynomial is the one interpolating $(1,1),(2,0),(3,0),(4,2)$.
$endgroup$
– lhf
Jan 25 at 10:19
$begingroup$
That polynomial is the one interpolating $(1,1),(2,0),(3,0),(4,2)$.
$endgroup$
– lhf
Jan 25 at 10:19
$begingroup$
That polynomial is the one interpolating $(1,1),(2,0),(3,0),(4,2)$.
$endgroup$
– lhf
Jan 25 at 10:19
add a comment |
$begingroup$
Using modular-arithmetic is quite similar to using floor functions so you can also use that instead. Here is a possible solution:
$$
f(n) = frac{1}{6}left((n-4lfloor n/4rfloor)^3 -3(n-4lfloor n/4rfloor)^2 - 4(n-lfloor n/4 rfloor) + 12 right)
$$
In this case $n-4lfloor n/4 rfloor$ would be the same as $npmod 4$.
$endgroup$
add a comment |
$begingroup$
Using modular-arithmetic is quite similar to using floor functions so you can also use that instead. Here is a possible solution:
$$
f(n) = frac{1}{6}left((n-4lfloor n/4rfloor)^3 -3(n-4lfloor n/4rfloor)^2 - 4(n-lfloor n/4 rfloor) + 12 right)
$$
In this case $n-4lfloor n/4 rfloor$ would be the same as $npmod 4$.
$endgroup$
add a comment |
$begingroup$
Using modular-arithmetic is quite similar to using floor functions so you can also use that instead. Here is a possible solution:
$$
f(n) = frac{1}{6}left((n-4lfloor n/4rfloor)^3 -3(n-4lfloor n/4rfloor)^2 - 4(n-lfloor n/4 rfloor) + 12 right)
$$
In this case $n-4lfloor n/4 rfloor$ would be the same as $npmod 4$.
$endgroup$
Using modular-arithmetic is quite similar to using floor functions so you can also use that instead. Here is a possible solution:
$$
f(n) = frac{1}{6}left((n-4lfloor n/4rfloor)^3 -3(n-4lfloor n/4rfloor)^2 - 4(n-lfloor n/4 rfloor) + 12 right)
$$
In this case $n-4lfloor n/4 rfloor$ would be the same as $npmod 4$.
answered Jan 25 at 9:47
Yong Hao NgYong Hao Ng
3,6141222
3,6141222
add a comment |
add a comment |
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%2f3086488%2fis-it-possible-to-find-a-closed-form-using-modular-arithmetic%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