Finding the Floor Function Explicit Formula for a Sequence

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite
1












I have found come across two sequences that I know probably both have an explicit formula expressed in terms of the floor function, but I cannot quite figure it out.



$0,1,1,2,4,4,5,5,6,8,8,9,9,10,12,12$



$0,0,1,1,0,4,4,5,5,4,8,8,9,9,8,12$



(Note that the starting $0$ in both sequences is the $0$th term of both sequences.)



There is definitely a consistent pattern, but tricky to precisely describe. I have tried many possible formulas, graphed the sequences, and even referred to the OEIS, all to no avail. Any help would be appreciated!







share|cite|improve this question

















  • 2




    Where did you come across the sequences?
    – user202729
    Jul 22 at 6:43










  • I can only see one sequence here. Where is the other
    – Rakesh Bhatt
    Jul 22 at 6:49






  • 1




    There are $2$, look closely and you'll see the word "and" squeezed in between them. or if you did notice that, then perhaps you didn't notice that they are different by a few terms
    – john fowles
    Jul 22 at 6:50











  • Could you describe the patterns somehow? Or at least give many more terms for each one...
    – coffeemath
    Jul 22 at 6:57










  • Some observations about the first sequence. A number seems to repeat two times when it is $0pmod4$ or $1pmod4.$ Moreover, a number that is $2pmod4$ appears once, and after that appearance, $2$ is added to that number.
    – Flynn Rixona
    Jul 22 at 7:01














up vote
1
down vote

favorite
1












I have found come across two sequences that I know probably both have an explicit formula expressed in terms of the floor function, but I cannot quite figure it out.



$0,1,1,2,4,4,5,5,6,8,8,9,9,10,12,12$



$0,0,1,1,0,4,4,5,5,4,8,8,9,9,8,12$



(Note that the starting $0$ in both sequences is the $0$th term of both sequences.)



There is definitely a consistent pattern, but tricky to precisely describe. I have tried many possible formulas, graphed the sequences, and even referred to the OEIS, all to no avail. Any help would be appreciated!







share|cite|improve this question

















  • 2




    Where did you come across the sequences?
    – user202729
    Jul 22 at 6:43










  • I can only see one sequence here. Where is the other
    – Rakesh Bhatt
    Jul 22 at 6:49






  • 1




    There are $2$, look closely and you'll see the word "and" squeezed in between them. or if you did notice that, then perhaps you didn't notice that they are different by a few terms
    – john fowles
    Jul 22 at 6:50











  • Could you describe the patterns somehow? Or at least give many more terms for each one...
    – coffeemath
    Jul 22 at 6:57










  • Some observations about the first sequence. A number seems to repeat two times when it is $0pmod4$ or $1pmod4.$ Moreover, a number that is $2pmod4$ appears once, and after that appearance, $2$ is added to that number.
    – Flynn Rixona
    Jul 22 at 7:01












up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





I have found come across two sequences that I know probably both have an explicit formula expressed in terms of the floor function, but I cannot quite figure it out.



$0,1,1,2,4,4,5,5,6,8,8,9,9,10,12,12$



$0,0,1,1,0,4,4,5,5,4,8,8,9,9,8,12$



(Note that the starting $0$ in both sequences is the $0$th term of both sequences.)



There is definitely a consistent pattern, but tricky to precisely describe. I have tried many possible formulas, graphed the sequences, and even referred to the OEIS, all to no avail. Any help would be appreciated!







share|cite|improve this question













I have found come across two sequences that I know probably both have an explicit formula expressed in terms of the floor function, but I cannot quite figure it out.



$0,1,1,2,4,4,5,5,6,8,8,9,9,10,12,12$



$0,0,1,1,0,4,4,5,5,4,8,8,9,9,8,12$



(Note that the starting $0$ in both sequences is the $0$th term of both sequences.)



There is definitely a consistent pattern, but tricky to precisely describe. I have tried many possible formulas, graphed the sequences, and even referred to the OEIS, all to no avail. Any help would be appreciated!









share|cite|improve this question












share|cite|improve this question




share|cite|improve this question








edited Jul 22 at 6:57
























asked Jul 22 at 6:18









Flynn Rixona

1567




1567







  • 2




    Where did you come across the sequences?
    – user202729
    Jul 22 at 6:43










  • I can only see one sequence here. Where is the other
    – Rakesh Bhatt
    Jul 22 at 6:49






  • 1




    There are $2$, look closely and you'll see the word "and" squeezed in between them. or if you did notice that, then perhaps you didn't notice that they are different by a few terms
    – john fowles
    Jul 22 at 6:50











  • Could you describe the patterns somehow? Or at least give many more terms for each one...
    – coffeemath
    Jul 22 at 6:57










  • Some observations about the first sequence. A number seems to repeat two times when it is $0pmod4$ or $1pmod4.$ Moreover, a number that is $2pmod4$ appears once, and after that appearance, $2$ is added to that number.
    – Flynn Rixona
    Jul 22 at 7:01












  • 2




    Where did you come across the sequences?
    – user202729
    Jul 22 at 6:43










  • I can only see one sequence here. Where is the other
    – Rakesh Bhatt
    Jul 22 at 6:49






  • 1




    There are $2$, look closely and you'll see the word "and" squeezed in between them. or if you did notice that, then perhaps you didn't notice that they are different by a few terms
    – john fowles
    Jul 22 at 6:50











  • Could you describe the patterns somehow? Or at least give many more terms for each one...
    – coffeemath
    Jul 22 at 6:57










  • Some observations about the first sequence. A number seems to repeat two times when it is $0pmod4$ or $1pmod4.$ Moreover, a number that is $2pmod4$ appears once, and after that appearance, $2$ is added to that number.
    – Flynn Rixona
    Jul 22 at 7:01







2




2




Where did you come across the sequences?
– user202729
Jul 22 at 6:43




Where did you come across the sequences?
– user202729
Jul 22 at 6:43












I can only see one sequence here. Where is the other
– Rakesh Bhatt
Jul 22 at 6:49




I can only see one sequence here. Where is the other
– Rakesh Bhatt
Jul 22 at 6:49




1




1




There are $2$, look closely and you'll see the word "and" squeezed in between them. or if you did notice that, then perhaps you didn't notice that they are different by a few terms
– john fowles
Jul 22 at 6:50





There are $2$, look closely and you'll see the word "and" squeezed in between them. or if you did notice that, then perhaps you didn't notice that they are different by a few terms
– john fowles
Jul 22 at 6:50













Could you describe the patterns somehow? Or at least give many more terms for each one...
– coffeemath
Jul 22 at 6:57




Could you describe the patterns somehow? Or at least give many more terms for each one...
– coffeemath
Jul 22 at 6:57












Some observations about the first sequence. A number seems to repeat two times when it is $0pmod4$ or $1pmod4.$ Moreover, a number that is $2pmod4$ appears once, and after that appearance, $2$ is added to that number.
– Flynn Rixona
Jul 22 at 7:01




Some observations about the first sequence. A number seems to repeat two times when it is $0pmod4$ or $1pmod4.$ Moreover, a number that is $2pmod4$ appears once, and after that appearance, $2$ is added to that number.
– Flynn Rixona
Jul 22 at 7:01










2 Answers
2






active

oldest

votes

















up vote
2
down vote













Notice that the first difference sequence of both sequences have period $5$. Equivalently, there is a constant difference after every $5$ terms which is $4$ for both sequences. Another way to state this is that $, a_(n+5) = a(n) + 4 ,$ for all $n$ for both sequences. Thus,
$, a(n) = 4 lfloor n / 5rfloor + a(n pmod5) ,$
for both sequences. Options vary about how to deal with the $, a(n pmod5) ,$ expression in the formula. It is purely periodic so you could use a sum of sines and cosines. You could use something like $, (0,1,1,2,4)[n pmod5] ,$ with the understanding that the finite list is indexed from $0$ to $4$.



If $, a(n) ,$ and $, b(n) ,$ are the two sequences, notice that
$, a(n) + b(n) = 8 lfloor n / 5rfloor + (n pmod5). ,$






share|cite|improve this answer






























    up vote
    2
    down vote













    For the first series (ignoring 0 element):



    $$a_n=4left lfloorfracn-15right rfloor+1+left lfloorfraci3right rfloor+2left lfloorfraci4right rfloor$$



    ...where:



    $$i=n-5left lfloorfracn-15right rfloor$$



    You can create one monster expression if you like it so. Proof:



    In[24]:= a[n_] := Module[i, s,
    s = 4 Floor[(n - 1)/ 5] + 1;
    i = n - Floor[(n - 1)/5]*5;
    s += Floor[i/3];
    s += 2 Floor[i/4]
    ];
    Table[a[n], n, 1, 30]

    Out[25]= 1, 1, 2, 4, 4, 5, 5, 6, 8, 8, 9, 9, 10, 12, 12, 13, 13, 14,
    16, 16, 17, 17, 18, 20, 20, 21, 21, 22, 24, 24


    The second sequence (ignoring 0 elemenet):



    $$a_n=4left lfloorfracn-15right rfloor+left lfloorfraci2right rfloor-2left lfloorfraci4right rfloor+4left lfloorfraci5right rfloor$$



    ...where:



    $$i=n-5left lfloorfracn-15right rfloor$$



    Proof:



    In[26]:= a[n_] := Module[i, s,
    s = 4 Floor[(n - 1)/ 5];
    i = n - Floor[(n - 1)/5]*5;
    s += Floor[i/2];
    s -= 2 Floor[i/4];
    s += 4 Floor[i/5]
    ];
    Table[a[n], n, 1, 30]

    Out[27]= 0, 1, 1, 0, 4, 4, 5, 5, 4, 8, 8, 9, 9, 8, 12, 12, 13, 13,
    12, 16, 16, 17, 17, 16, 20, 20, 21, 21, 20, 24


    Done.






    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',
      convertImagesToLinks: true,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      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%2f2859147%2ffinding-the-floor-function-explicit-formula-for-a-sequence%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      2
      down vote













      Notice that the first difference sequence of both sequences have period $5$. Equivalently, there is a constant difference after every $5$ terms which is $4$ for both sequences. Another way to state this is that $, a_(n+5) = a(n) + 4 ,$ for all $n$ for both sequences. Thus,
      $, a(n) = 4 lfloor n / 5rfloor + a(n pmod5) ,$
      for both sequences. Options vary about how to deal with the $, a(n pmod5) ,$ expression in the formula. It is purely periodic so you could use a sum of sines and cosines. You could use something like $, (0,1,1,2,4)[n pmod5] ,$ with the understanding that the finite list is indexed from $0$ to $4$.



      If $, a(n) ,$ and $, b(n) ,$ are the two sequences, notice that
      $, a(n) + b(n) = 8 lfloor n / 5rfloor + (n pmod5). ,$






      share|cite|improve this answer



























        up vote
        2
        down vote













        Notice that the first difference sequence of both sequences have period $5$. Equivalently, there is a constant difference after every $5$ terms which is $4$ for both sequences. Another way to state this is that $, a_(n+5) = a(n) + 4 ,$ for all $n$ for both sequences. Thus,
        $, a(n) = 4 lfloor n / 5rfloor + a(n pmod5) ,$
        for both sequences. Options vary about how to deal with the $, a(n pmod5) ,$ expression in the formula. It is purely periodic so you could use a sum of sines and cosines. You could use something like $, (0,1,1,2,4)[n pmod5] ,$ with the understanding that the finite list is indexed from $0$ to $4$.



        If $, a(n) ,$ and $, b(n) ,$ are the two sequences, notice that
        $, a(n) + b(n) = 8 lfloor n / 5rfloor + (n pmod5). ,$






        share|cite|improve this answer

























          up vote
          2
          down vote










          up vote
          2
          down vote









          Notice that the first difference sequence of both sequences have period $5$. Equivalently, there is a constant difference after every $5$ terms which is $4$ for both sequences. Another way to state this is that $, a_(n+5) = a(n) + 4 ,$ for all $n$ for both sequences. Thus,
          $, a(n) = 4 lfloor n / 5rfloor + a(n pmod5) ,$
          for both sequences. Options vary about how to deal with the $, a(n pmod5) ,$ expression in the formula. It is purely periodic so you could use a sum of sines and cosines. You could use something like $, (0,1,1,2,4)[n pmod5] ,$ with the understanding that the finite list is indexed from $0$ to $4$.



          If $, a(n) ,$ and $, b(n) ,$ are the two sequences, notice that
          $, a(n) + b(n) = 8 lfloor n / 5rfloor + (n pmod5). ,$






          share|cite|improve this answer















          Notice that the first difference sequence of both sequences have period $5$. Equivalently, there is a constant difference after every $5$ terms which is $4$ for both sequences. Another way to state this is that $, a_(n+5) = a(n) + 4 ,$ for all $n$ for both sequences. Thus,
          $, a(n) = 4 lfloor n / 5rfloor + a(n pmod5) ,$
          for both sequences. Options vary about how to deal with the $, a(n pmod5) ,$ expression in the formula. It is purely periodic so you could use a sum of sines and cosines. You could use something like $, (0,1,1,2,4)[n pmod5] ,$ with the understanding that the finite list is indexed from $0$ to $4$.



          If $, a(n) ,$ and $, b(n) ,$ are the two sequences, notice that
          $, a(n) + b(n) = 8 lfloor n / 5rfloor + (n pmod5). ,$







          share|cite|improve this answer















          share|cite|improve this answer



          share|cite|improve this answer








          edited Jul 22 at 12:19


























          answered Jul 22 at 11:40









          Somos

          11.5k1933




          11.5k1933




















              up vote
              2
              down vote













              For the first series (ignoring 0 element):



              $$a_n=4left lfloorfracn-15right rfloor+1+left lfloorfraci3right rfloor+2left lfloorfraci4right rfloor$$



              ...where:



              $$i=n-5left lfloorfracn-15right rfloor$$



              You can create one monster expression if you like it so. Proof:



              In[24]:= a[n_] := Module[i, s,
              s = 4 Floor[(n - 1)/ 5] + 1;
              i = n - Floor[(n - 1)/5]*5;
              s += Floor[i/3];
              s += 2 Floor[i/4]
              ];
              Table[a[n], n, 1, 30]

              Out[25]= 1, 1, 2, 4, 4, 5, 5, 6, 8, 8, 9, 9, 10, 12, 12, 13, 13, 14,
              16, 16, 17, 17, 18, 20, 20, 21, 21, 22, 24, 24


              The second sequence (ignoring 0 elemenet):



              $$a_n=4left lfloorfracn-15right rfloor+left lfloorfraci2right rfloor-2left lfloorfraci4right rfloor+4left lfloorfraci5right rfloor$$



              ...where:



              $$i=n-5left lfloorfracn-15right rfloor$$



              Proof:



              In[26]:= a[n_] := Module[i, s,
              s = 4 Floor[(n - 1)/ 5];
              i = n - Floor[(n - 1)/5]*5;
              s += Floor[i/2];
              s -= 2 Floor[i/4];
              s += 4 Floor[i/5]
              ];
              Table[a[n], n, 1, 30]

              Out[27]= 0, 1, 1, 0, 4, 4, 5, 5, 4, 8, 8, 9, 9, 8, 12, 12, 13, 13,
              12, 16, 16, 17, 17, 16, 20, 20, 21, 21, 20, 24


              Done.






              share|cite|improve this answer



























                up vote
                2
                down vote













                For the first series (ignoring 0 element):



                $$a_n=4left lfloorfracn-15right rfloor+1+left lfloorfraci3right rfloor+2left lfloorfraci4right rfloor$$



                ...where:



                $$i=n-5left lfloorfracn-15right rfloor$$



                You can create one monster expression if you like it so. Proof:



                In[24]:= a[n_] := Module[i, s,
                s = 4 Floor[(n - 1)/ 5] + 1;
                i = n - Floor[(n - 1)/5]*5;
                s += Floor[i/3];
                s += 2 Floor[i/4]
                ];
                Table[a[n], n, 1, 30]

                Out[25]= 1, 1, 2, 4, 4, 5, 5, 6, 8, 8, 9, 9, 10, 12, 12, 13, 13, 14,
                16, 16, 17, 17, 18, 20, 20, 21, 21, 22, 24, 24


                The second sequence (ignoring 0 elemenet):



                $$a_n=4left lfloorfracn-15right rfloor+left lfloorfraci2right rfloor-2left lfloorfraci4right rfloor+4left lfloorfraci5right rfloor$$



                ...where:



                $$i=n-5left lfloorfracn-15right rfloor$$



                Proof:



                In[26]:= a[n_] := Module[i, s,
                s = 4 Floor[(n - 1)/ 5];
                i = n - Floor[(n - 1)/5]*5;
                s += Floor[i/2];
                s -= 2 Floor[i/4];
                s += 4 Floor[i/5]
                ];
                Table[a[n], n, 1, 30]

                Out[27]= 0, 1, 1, 0, 4, 4, 5, 5, 4, 8, 8, 9, 9, 8, 12, 12, 13, 13,
                12, 16, 16, 17, 17, 16, 20, 20, 21, 21, 20, 24


                Done.






                share|cite|improve this answer

























                  up vote
                  2
                  down vote










                  up vote
                  2
                  down vote









                  For the first series (ignoring 0 element):



                  $$a_n=4left lfloorfracn-15right rfloor+1+left lfloorfraci3right rfloor+2left lfloorfraci4right rfloor$$



                  ...where:



                  $$i=n-5left lfloorfracn-15right rfloor$$



                  You can create one monster expression if you like it so. Proof:



                  In[24]:= a[n_] := Module[i, s,
                  s = 4 Floor[(n - 1)/ 5] + 1;
                  i = n - Floor[(n - 1)/5]*5;
                  s += Floor[i/3];
                  s += 2 Floor[i/4]
                  ];
                  Table[a[n], n, 1, 30]

                  Out[25]= 1, 1, 2, 4, 4, 5, 5, 6, 8, 8, 9, 9, 10, 12, 12, 13, 13, 14,
                  16, 16, 17, 17, 18, 20, 20, 21, 21, 22, 24, 24


                  The second sequence (ignoring 0 elemenet):



                  $$a_n=4left lfloorfracn-15right rfloor+left lfloorfraci2right rfloor-2left lfloorfraci4right rfloor+4left lfloorfraci5right rfloor$$



                  ...where:



                  $$i=n-5left lfloorfracn-15right rfloor$$



                  Proof:



                  In[26]:= a[n_] := Module[i, s,
                  s = 4 Floor[(n - 1)/ 5];
                  i = n - Floor[(n - 1)/5]*5;
                  s += Floor[i/2];
                  s -= 2 Floor[i/4];
                  s += 4 Floor[i/5]
                  ];
                  Table[a[n], n, 1, 30]

                  Out[27]= 0, 1, 1, 0, 4, 4, 5, 5, 4, 8, 8, 9, 9, 8, 12, 12, 13, 13,
                  12, 16, 16, 17, 17, 16, 20, 20, 21, 21, 20, 24


                  Done.






                  share|cite|improve this answer















                  For the first series (ignoring 0 element):



                  $$a_n=4left lfloorfracn-15right rfloor+1+left lfloorfraci3right rfloor+2left lfloorfraci4right rfloor$$



                  ...where:



                  $$i=n-5left lfloorfracn-15right rfloor$$



                  You can create one monster expression if you like it so. Proof:



                  In[24]:= a[n_] := Module[i, s,
                  s = 4 Floor[(n - 1)/ 5] + 1;
                  i = n - Floor[(n - 1)/5]*5;
                  s += Floor[i/3];
                  s += 2 Floor[i/4]
                  ];
                  Table[a[n], n, 1, 30]

                  Out[25]= 1, 1, 2, 4, 4, 5, 5, 6, 8, 8, 9, 9, 10, 12, 12, 13, 13, 14,
                  16, 16, 17, 17, 18, 20, 20, 21, 21, 22, 24, 24


                  The second sequence (ignoring 0 elemenet):



                  $$a_n=4left lfloorfracn-15right rfloor+left lfloorfraci2right rfloor-2left lfloorfraci4right rfloor+4left lfloorfraci5right rfloor$$



                  ...where:



                  $$i=n-5left lfloorfracn-15right rfloor$$



                  Proof:



                  In[26]:= a[n_] := Module[i, s,
                  s = 4 Floor[(n - 1)/ 5];
                  i = n - Floor[(n - 1)/5]*5;
                  s += Floor[i/2];
                  s -= 2 Floor[i/4];
                  s += 4 Floor[i/5]
                  ];
                  Table[a[n], n, 1, 30]

                  Out[27]= 0, 1, 1, 0, 4, 4, 5, 5, 4, 8, 8, 9, 9, 8, 12, 12, 13, 13,
                  12, 16, 16, 17, 17, 16, 20, 20, 21, 21, 20, 24


                  Done.







                  share|cite|improve this answer















                  share|cite|improve this answer



                  share|cite|improve this answer








                  edited Jul 22 at 13:05


























                  answered Jul 22 at 12:01









                  Oldboy

                  2,6101316




                  2,6101316






















                       

                      draft saved


                      draft discarded


























                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2859147%2ffinding-the-floor-function-explicit-formula-for-a-sequence%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Comments

                      Popular posts from this blog

                      What is the equation of a 3D cone with generalised tilt?

                      Color the edges and diagonals of a regular polygon

                      Relationship between determinant of matrix and determinant of adjoint?