Closed form representation of recurrence relation 4












0














I want to find a closed form of the following recurrence relation:



$$
a_0=0; \
a_{n+1}=begin{cases}0, & exists kin mathbb{N}_0: n=frac12 k(k+1); \
a_n+1, & nexists k in mathbb{N}_0:n=frac12 k(k+1). end{cases}
$$



(In particular, this recurrence relation describes the sequence
$$
(0,0,1,0,1,2,0,1,2,3,0,1,2,ldots)
$$

.)



I was not successful in finding an adequate generating function as normal.
How can I proceed?










share|cite|improve this question
























  • I think you intended $a_n=a_{n-1}+1$ when $n$ is not a triangular number.
    – John Wayland Bales
    Nov 26 '18 at 19:48












  • @JohnWaylandBales You're correct! I'll edit my post.
    – Jean Paul
    Nov 26 '18 at 19:56










  • Look at the Mathematica section of oeis.org/A002262
    – John Wayland Bales
    Nov 26 '18 at 19:59










  • @JohnWaylandBales Could you elaborate on it further? I'm not sure about how to decipher that entry...
    – Jean Paul
    Nov 26 '18 at 20:25










  • I tried to decipher it but must have done it wrong, because it is not producing the right numbers. Perhaps someone who knows how to code in Mathematica can help.
    – John Wayland Bales
    Nov 26 '18 at 21:14
















0














I want to find a closed form of the following recurrence relation:



$$
a_0=0; \
a_{n+1}=begin{cases}0, & exists kin mathbb{N}_0: n=frac12 k(k+1); \
a_n+1, & nexists k in mathbb{N}_0:n=frac12 k(k+1). end{cases}
$$



(In particular, this recurrence relation describes the sequence
$$
(0,0,1,0,1,2,0,1,2,3,0,1,2,ldots)
$$

.)



I was not successful in finding an adequate generating function as normal.
How can I proceed?










share|cite|improve this question
























  • I think you intended $a_n=a_{n-1}+1$ when $n$ is not a triangular number.
    – John Wayland Bales
    Nov 26 '18 at 19:48












  • @JohnWaylandBales You're correct! I'll edit my post.
    – Jean Paul
    Nov 26 '18 at 19:56










  • Look at the Mathematica section of oeis.org/A002262
    – John Wayland Bales
    Nov 26 '18 at 19:59










  • @JohnWaylandBales Could you elaborate on it further? I'm not sure about how to decipher that entry...
    – Jean Paul
    Nov 26 '18 at 20:25










  • I tried to decipher it but must have done it wrong, because it is not producing the right numbers. Perhaps someone who knows how to code in Mathematica can help.
    – John Wayland Bales
    Nov 26 '18 at 21:14














0












0








0







I want to find a closed form of the following recurrence relation:



$$
a_0=0; \
a_{n+1}=begin{cases}0, & exists kin mathbb{N}_0: n=frac12 k(k+1); \
a_n+1, & nexists k in mathbb{N}_0:n=frac12 k(k+1). end{cases}
$$



(In particular, this recurrence relation describes the sequence
$$
(0,0,1,0,1,2,0,1,2,3,0,1,2,ldots)
$$

.)



I was not successful in finding an adequate generating function as normal.
How can I proceed?










share|cite|improve this question















I want to find a closed form of the following recurrence relation:



$$
a_0=0; \
a_{n+1}=begin{cases}0, & exists kin mathbb{N}_0: n=frac12 k(k+1); \
a_n+1, & nexists k in mathbb{N}_0:n=frac12 k(k+1). end{cases}
$$



(In particular, this recurrence relation describes the sequence
$$
(0,0,1,0,1,2,0,1,2,3,0,1,2,ldots)
$$

.)



I was not successful in finding an adequate generating function as normal.
How can I proceed?







real-analysis sequences-and-series limits recurrence-relations






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Nov 26 '18 at 19:57

























asked Nov 26 '18 at 19:25









Jean Paul

11




11












  • I think you intended $a_n=a_{n-1}+1$ when $n$ is not a triangular number.
    – John Wayland Bales
    Nov 26 '18 at 19:48












  • @JohnWaylandBales You're correct! I'll edit my post.
    – Jean Paul
    Nov 26 '18 at 19:56










  • Look at the Mathematica section of oeis.org/A002262
    – John Wayland Bales
    Nov 26 '18 at 19:59










  • @JohnWaylandBales Could you elaborate on it further? I'm not sure about how to decipher that entry...
    – Jean Paul
    Nov 26 '18 at 20:25










  • I tried to decipher it but must have done it wrong, because it is not producing the right numbers. Perhaps someone who knows how to code in Mathematica can help.
    – John Wayland Bales
    Nov 26 '18 at 21:14


















  • I think you intended $a_n=a_{n-1}+1$ when $n$ is not a triangular number.
    – John Wayland Bales
    Nov 26 '18 at 19:48












  • @JohnWaylandBales You're correct! I'll edit my post.
    – Jean Paul
    Nov 26 '18 at 19:56










  • Look at the Mathematica section of oeis.org/A002262
    – John Wayland Bales
    Nov 26 '18 at 19:59










  • @JohnWaylandBales Could you elaborate on it further? I'm not sure about how to decipher that entry...
    – Jean Paul
    Nov 26 '18 at 20:25










  • I tried to decipher it but must have done it wrong, because it is not producing the right numbers. Perhaps someone who knows how to code in Mathematica can help.
    – John Wayland Bales
    Nov 26 '18 at 21:14
















I think you intended $a_n=a_{n-1}+1$ when $n$ is not a triangular number.
– John Wayland Bales
Nov 26 '18 at 19:48






I think you intended $a_n=a_{n-1}+1$ when $n$ is not a triangular number.
– John Wayland Bales
Nov 26 '18 at 19:48














@JohnWaylandBales You're correct! I'll edit my post.
– Jean Paul
Nov 26 '18 at 19:56




@JohnWaylandBales You're correct! I'll edit my post.
– Jean Paul
Nov 26 '18 at 19:56












Look at the Mathematica section of oeis.org/A002262
– John Wayland Bales
Nov 26 '18 at 19:59




Look at the Mathematica section of oeis.org/A002262
– John Wayland Bales
Nov 26 '18 at 19:59












@JohnWaylandBales Could you elaborate on it further? I'm not sure about how to decipher that entry...
– Jean Paul
Nov 26 '18 at 20:25




@JohnWaylandBales Could you elaborate on it further? I'm not sure about how to decipher that entry...
– Jean Paul
Nov 26 '18 at 20:25












I tried to decipher it but must have done it wrong, because it is not producing the right numbers. Perhaps someone who knows how to code in Mathematica can help.
– John Wayland Bales
Nov 26 '18 at 21:14




I tried to decipher it but must have done it wrong, because it is not producing the right numbers. Perhaps someone who knows how to code in Mathematica can help.
– John Wayland Bales
Nov 26 '18 at 21:14










1 Answer
1






active

oldest

votes


















2














Adapting the Mathematica results from https://oeis.org/A002262, if we define



$$ m(k)=leftlfloor frac{sqrt{8k-7}-1}{2}rightrfloorquadtext{ for }kge1 $$



then



$$ a_k= k-m(k+1)cdotfrac{m(k+1)+1}{2}$$



This produces the sequence



$$ (0,0,1,0,1,2,0,1,2,3,0,1,2,3,4,0,1,2,3,4,5,0,ldots) $$






share|cite|improve this answer





















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


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3014798%2fclosed-form-representation-of-recurrence-relation-4%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









    2














    Adapting the Mathematica results from https://oeis.org/A002262, if we define



    $$ m(k)=leftlfloor frac{sqrt{8k-7}-1}{2}rightrfloorquadtext{ for }kge1 $$



    then



    $$ a_k= k-m(k+1)cdotfrac{m(k+1)+1}{2}$$



    This produces the sequence



    $$ (0,0,1,0,1,2,0,1,2,3,0,1,2,3,4,0,1,2,3,4,5,0,ldots) $$






    share|cite|improve this answer


























      2














      Adapting the Mathematica results from https://oeis.org/A002262, if we define



      $$ m(k)=leftlfloor frac{sqrt{8k-7}-1}{2}rightrfloorquadtext{ for }kge1 $$



      then



      $$ a_k= k-m(k+1)cdotfrac{m(k+1)+1}{2}$$



      This produces the sequence



      $$ (0,0,1,0,1,2,0,1,2,3,0,1,2,3,4,0,1,2,3,4,5,0,ldots) $$






      share|cite|improve this answer
























        2












        2








        2






        Adapting the Mathematica results from https://oeis.org/A002262, if we define



        $$ m(k)=leftlfloor frac{sqrt{8k-7}-1}{2}rightrfloorquadtext{ for }kge1 $$



        then



        $$ a_k= k-m(k+1)cdotfrac{m(k+1)+1}{2}$$



        This produces the sequence



        $$ (0,0,1,0,1,2,0,1,2,3,0,1,2,3,4,0,1,2,3,4,5,0,ldots) $$






        share|cite|improve this answer












        Adapting the Mathematica results from https://oeis.org/A002262, if we define



        $$ m(k)=leftlfloor frac{sqrt{8k-7}-1}{2}rightrfloorquadtext{ for }kge1 $$



        then



        $$ a_k= k-m(k+1)cdotfrac{m(k+1)+1}{2}$$



        This produces the sequence



        $$ (0,0,1,0,1,2,0,1,2,3,0,1,2,3,4,0,1,2,3,4,5,0,ldots) $$







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Nov 26 '18 at 22:03









        John Wayland Bales

        13.9k21237




        13.9k21237






























            draft saved

            draft discarded




















































            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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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.


            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%2f3014798%2fclosed-form-representation-of-recurrence-relation-4%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

            Plaza Victoria

            Puebla de Zaragoza

            Musa