Does this sum go infinity?












6












$begingroup$


Consider $F(x)$ that maps from $Bbb N$ to ${pm 1}$, such that if $x$ is odd, then $F(x)$ = $$(-1)^{(frac{x-1}{2})}$$, and if $x$ is even, then $F(x)=F(y)$, where $y$ is the odd number obtained after dividing $x$ by $2$ until it is odd.



Does $S_n = sum_{p=1}^n F(p)$ have an explicit formula?
And if $n$ tends to $infty$ does the sum alternates or will it lie between an interval or does it tend to $pm infty$ ?










share|cite|improve this question









New contributor




Hari Krishna P is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$








  • 1




    $begingroup$
    @Max thanks for the edit....this was my first question on mathstackexchange!
    $endgroup$
    – Hari Krishna P
    4 hours ago
















6












$begingroup$


Consider $F(x)$ that maps from $Bbb N$ to ${pm 1}$, such that if $x$ is odd, then $F(x)$ = $$(-1)^{(frac{x-1}{2})}$$, and if $x$ is even, then $F(x)=F(y)$, where $y$ is the odd number obtained after dividing $x$ by $2$ until it is odd.



Does $S_n = sum_{p=1}^n F(p)$ have an explicit formula?
And if $n$ tends to $infty$ does the sum alternates or will it lie between an interval or does it tend to $pm infty$ ?










share|cite|improve this question









New contributor




Hari Krishna P is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$








  • 1




    $begingroup$
    @Max thanks for the edit....this was my first question on mathstackexchange!
    $endgroup$
    – Hari Krishna P
    4 hours ago














6












6








6


3



$begingroup$


Consider $F(x)$ that maps from $Bbb N$ to ${pm 1}$, such that if $x$ is odd, then $F(x)$ = $$(-1)^{(frac{x-1}{2})}$$, and if $x$ is even, then $F(x)=F(y)$, where $y$ is the odd number obtained after dividing $x$ by $2$ until it is odd.



Does $S_n = sum_{p=1}^n F(p)$ have an explicit formula?
And if $n$ tends to $infty$ does the sum alternates or will it lie between an interval or does it tend to $pm infty$ ?










share|cite|improve this question









New contributor




Hari Krishna P is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$




Consider $F(x)$ that maps from $Bbb N$ to ${pm 1}$, such that if $x$ is odd, then $F(x)$ = $$(-1)^{(frac{x-1}{2})}$$, and if $x$ is even, then $F(x)=F(y)$, where $y$ is the odd number obtained after dividing $x$ by $2$ until it is odd.



Does $S_n = sum_{p=1}^n F(p)$ have an explicit formula?
And if $n$ tends to $infty$ does the sum alternates or will it lie between an interval or does it tend to $pm infty$ ?







sequences-and-series algebra-precalculus






share|cite|improve this question









New contributor




Hari Krishna P is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|cite|improve this question









New contributor




Hari Krishna P is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|cite|improve this question




share|cite|improve this question








edited 4 hours ago







Hari Krishna P













New contributor




Hari Krishna P is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 4 hours ago









Hari Krishna PHari Krishna P

314




314




New contributor




Hari Krishna P is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Hari Krishna P is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Hari Krishna P is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 1




    $begingroup$
    @Max thanks for the edit....this was my first question on mathstackexchange!
    $endgroup$
    – Hari Krishna P
    4 hours ago














  • 1




    $begingroup$
    @Max thanks for the edit....this was my first question on mathstackexchange!
    $endgroup$
    – Hari Krishna P
    4 hours ago








1




1




$begingroup$
@Max thanks for the edit....this was my first question on mathstackexchange!
$endgroup$
– Hari Krishna P
4 hours ago




$begingroup$
@Max thanks for the edit....this was my first question on mathstackexchange!
$endgroup$
– Hari Krishna P
4 hours ago










1 Answer
1






active

oldest

votes


















5












$begingroup$

Let $T(n) = sum_{ktext{ is odd, } kle n}F(k)$. We can easily see that $T(0)=0$, $T(1)=1$, $T(2)=1$, $T(3)=0$, and $T(n+4)=T(n)$ for all $nge 0$. This is $1$ if the last two bits of $n$ (when expressed in binary) are different, and $0$ if they are the same.



Then, $T(lfloor n/2rfloor) = sum_{ktext{ is odd, } kle lfloor n/2rfloor}F(k)=sum_{ktext{ is odd, } 2kle n}F(2k)$, $T(lfloor n/4rfloor) = sum_{ktext{ is odd, } 4kle n}F(4k)$, and so on. Every integer is equal to $2^m k$ for some nonnegative $m$ and odd $k$. As such, we can take a sum, and get
$$S_n = T(n)+T(lfloor n/2rfloor)+T(lfloor n/4rfloor)+cdots = sum_{m=0}^{lfloor log_2 nrfloor}T(lfloor n/2^mrfloor)$$
Each term is $1$ if two particular adjacent bits of $n$ are different and zero if they're equal - the $1$ bit and the $2$ bit for $T(n)$, the $2$ bit and the $4$ bit for $T(lfloor n/2rfloor)$, the $4$ bit and the $8$ bit for $T(lfloor n/4rfloor)$, and so on.



Sum them up, and $S_n$ is the number of times the sequence of bits switches between $0$ and $1$. Among $m$-bit numbers, this can be as low as $1$ for $n=2^m-1$ (the first switch, from $0$ in the $2^m$ place to $1$ in the $2^{m-1}$ place, is always there) or as high as $m$ for $n=lfloor 2^{m+1}/3rfloor$.



So, there it is - an explicit form for $S_n$, and a sequence $1,2,5,10,21,42,85,dots$ for which $S_n$ goes to $infty$.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Awesome! Thank you!!
    $endgroup$
    – Hari Krishna P
    2 hours ago











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
});


}
});






Hari Krishna P is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3150671%2fdoes-this-sum-go-infinity%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









5












$begingroup$

Let $T(n) = sum_{ktext{ is odd, } kle n}F(k)$. We can easily see that $T(0)=0$, $T(1)=1$, $T(2)=1$, $T(3)=0$, and $T(n+4)=T(n)$ for all $nge 0$. This is $1$ if the last two bits of $n$ (when expressed in binary) are different, and $0$ if they are the same.



Then, $T(lfloor n/2rfloor) = sum_{ktext{ is odd, } kle lfloor n/2rfloor}F(k)=sum_{ktext{ is odd, } 2kle n}F(2k)$, $T(lfloor n/4rfloor) = sum_{ktext{ is odd, } 4kle n}F(4k)$, and so on. Every integer is equal to $2^m k$ for some nonnegative $m$ and odd $k$. As such, we can take a sum, and get
$$S_n = T(n)+T(lfloor n/2rfloor)+T(lfloor n/4rfloor)+cdots = sum_{m=0}^{lfloor log_2 nrfloor}T(lfloor n/2^mrfloor)$$
Each term is $1$ if two particular adjacent bits of $n$ are different and zero if they're equal - the $1$ bit and the $2$ bit for $T(n)$, the $2$ bit and the $4$ bit for $T(lfloor n/2rfloor)$, the $4$ bit and the $8$ bit for $T(lfloor n/4rfloor)$, and so on.



Sum them up, and $S_n$ is the number of times the sequence of bits switches between $0$ and $1$. Among $m$-bit numbers, this can be as low as $1$ for $n=2^m-1$ (the first switch, from $0$ in the $2^m$ place to $1$ in the $2^{m-1}$ place, is always there) or as high as $m$ for $n=lfloor 2^{m+1}/3rfloor$.



So, there it is - an explicit form for $S_n$, and a sequence $1,2,5,10,21,42,85,dots$ for which $S_n$ goes to $infty$.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Awesome! Thank you!!
    $endgroup$
    – Hari Krishna P
    2 hours ago
















5












$begingroup$

Let $T(n) = sum_{ktext{ is odd, } kle n}F(k)$. We can easily see that $T(0)=0$, $T(1)=1$, $T(2)=1$, $T(3)=0$, and $T(n+4)=T(n)$ for all $nge 0$. This is $1$ if the last two bits of $n$ (when expressed in binary) are different, and $0$ if they are the same.



Then, $T(lfloor n/2rfloor) = sum_{ktext{ is odd, } kle lfloor n/2rfloor}F(k)=sum_{ktext{ is odd, } 2kle n}F(2k)$, $T(lfloor n/4rfloor) = sum_{ktext{ is odd, } 4kle n}F(4k)$, and so on. Every integer is equal to $2^m k$ for some nonnegative $m$ and odd $k$. As such, we can take a sum, and get
$$S_n = T(n)+T(lfloor n/2rfloor)+T(lfloor n/4rfloor)+cdots = sum_{m=0}^{lfloor log_2 nrfloor}T(lfloor n/2^mrfloor)$$
Each term is $1$ if two particular adjacent bits of $n$ are different and zero if they're equal - the $1$ bit and the $2$ bit for $T(n)$, the $2$ bit and the $4$ bit for $T(lfloor n/2rfloor)$, the $4$ bit and the $8$ bit for $T(lfloor n/4rfloor)$, and so on.



Sum them up, and $S_n$ is the number of times the sequence of bits switches between $0$ and $1$. Among $m$-bit numbers, this can be as low as $1$ for $n=2^m-1$ (the first switch, from $0$ in the $2^m$ place to $1$ in the $2^{m-1}$ place, is always there) or as high as $m$ for $n=lfloor 2^{m+1}/3rfloor$.



So, there it is - an explicit form for $S_n$, and a sequence $1,2,5,10,21,42,85,dots$ for which $S_n$ goes to $infty$.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Awesome! Thank you!!
    $endgroup$
    – Hari Krishna P
    2 hours ago














5












5








5





$begingroup$

Let $T(n) = sum_{ktext{ is odd, } kle n}F(k)$. We can easily see that $T(0)=0$, $T(1)=1$, $T(2)=1$, $T(3)=0$, and $T(n+4)=T(n)$ for all $nge 0$. This is $1$ if the last two bits of $n$ (when expressed in binary) are different, and $0$ if they are the same.



Then, $T(lfloor n/2rfloor) = sum_{ktext{ is odd, } kle lfloor n/2rfloor}F(k)=sum_{ktext{ is odd, } 2kle n}F(2k)$, $T(lfloor n/4rfloor) = sum_{ktext{ is odd, } 4kle n}F(4k)$, and so on. Every integer is equal to $2^m k$ for some nonnegative $m$ and odd $k$. As such, we can take a sum, and get
$$S_n = T(n)+T(lfloor n/2rfloor)+T(lfloor n/4rfloor)+cdots = sum_{m=0}^{lfloor log_2 nrfloor}T(lfloor n/2^mrfloor)$$
Each term is $1$ if two particular adjacent bits of $n$ are different and zero if they're equal - the $1$ bit and the $2$ bit for $T(n)$, the $2$ bit and the $4$ bit for $T(lfloor n/2rfloor)$, the $4$ bit and the $8$ bit for $T(lfloor n/4rfloor)$, and so on.



Sum them up, and $S_n$ is the number of times the sequence of bits switches between $0$ and $1$. Among $m$-bit numbers, this can be as low as $1$ for $n=2^m-1$ (the first switch, from $0$ in the $2^m$ place to $1$ in the $2^{m-1}$ place, is always there) or as high as $m$ for $n=lfloor 2^{m+1}/3rfloor$.



So, there it is - an explicit form for $S_n$, and a sequence $1,2,5,10,21,42,85,dots$ for which $S_n$ goes to $infty$.






share|cite|improve this answer









$endgroup$



Let $T(n) = sum_{ktext{ is odd, } kle n}F(k)$. We can easily see that $T(0)=0$, $T(1)=1$, $T(2)=1$, $T(3)=0$, and $T(n+4)=T(n)$ for all $nge 0$. This is $1$ if the last two bits of $n$ (when expressed in binary) are different, and $0$ if they are the same.



Then, $T(lfloor n/2rfloor) = sum_{ktext{ is odd, } kle lfloor n/2rfloor}F(k)=sum_{ktext{ is odd, } 2kle n}F(2k)$, $T(lfloor n/4rfloor) = sum_{ktext{ is odd, } 4kle n}F(4k)$, and so on. Every integer is equal to $2^m k$ for some nonnegative $m$ and odd $k$. As such, we can take a sum, and get
$$S_n = T(n)+T(lfloor n/2rfloor)+T(lfloor n/4rfloor)+cdots = sum_{m=0}^{lfloor log_2 nrfloor}T(lfloor n/2^mrfloor)$$
Each term is $1$ if two particular adjacent bits of $n$ are different and zero if they're equal - the $1$ bit and the $2$ bit for $T(n)$, the $2$ bit and the $4$ bit for $T(lfloor n/2rfloor)$, the $4$ bit and the $8$ bit for $T(lfloor n/4rfloor)$, and so on.



Sum them up, and $S_n$ is the number of times the sequence of bits switches between $0$ and $1$. Among $m$-bit numbers, this can be as low as $1$ for $n=2^m-1$ (the first switch, from $0$ in the $2^m$ place to $1$ in the $2^{m-1}$ place, is always there) or as high as $m$ for $n=lfloor 2^{m+1}/3rfloor$.



So, there it is - an explicit form for $S_n$, and a sequence $1,2,5,10,21,42,85,dots$ for which $S_n$ goes to $infty$.







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered 3 hours ago









jmerryjmerry

14.4k1629




14.4k1629












  • $begingroup$
    Awesome! Thank you!!
    $endgroup$
    – Hari Krishna P
    2 hours ago


















  • $begingroup$
    Awesome! Thank you!!
    $endgroup$
    – Hari Krishna P
    2 hours ago
















$begingroup$
Awesome! Thank you!!
$endgroup$
– Hari Krishna P
2 hours ago




$begingroup$
Awesome! Thank you!!
$endgroup$
– Hari Krishna P
2 hours ago










Hari Krishna P is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Hari Krishna P is a new contributor. Be nice, and check out our Code of Conduct.













Hari Krishna P is a new contributor. Be nice, and check out our Code of Conduct.












Hari Krishna P 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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3150671%2fdoes-this-sum-go-infinity%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Callistus I

Tabula Rosettana

How to label and detect the document text images