Patience, young “Padovan”Output the van der Corput sequenceGenerate n-ary numbersGenerate a Padovan SpiralGenerate an ASCII Padovan SpiralGolf a Custom Fibonacci SequenceImplement the Fibonacci sequence… Shifted to the rightDizzy integer enumerationModulus SummationFour Spiraling AxesIt's getting harder and harder to be composite these days

Is the language p and n are natural numbers and there's no prime number in [p,p+n] belongs to NP class?

Why don't electromagnetic waves interact with each other?

Why has Russell's definition of numbers using equivalence classes been finally abandoned? ( If it has actually been abandoned).

Why are only specific transaction types accepted into the mempool?

How old can references or sources in a thesis be?

Shell script not opening as desktop application

Patience, young "Padovan"

Why is the design of haulage companies so “special”?

declaring a variable twice in IIFE

What is the offset in a seaplane's hull?

How is it possible to have an ability score that is less than 3?

If Manufacturer spice model and Datasheet give different values which should I use?

Symplectic equivalent of commuting matrices

I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine

Is it possible to do 50 km distance without any previous training?

How to get the available space of $HOME as a variable in shell scripting?

Why is "Reports" in sentence down without "The"

I probably found a bug with the sudo apt install function

Motorized valve interfering with button?

Why is an old chain unsafe?

Copenhagen passport control - US citizen

Theorems that impeded progress

GPS Rollover on Android Smartphones

Why are 150k or 200k jobs considered good when there are 300k+ births a month?



Patience, young “Padovan”


Output the van der Corput sequenceGenerate n-ary numbersGenerate a Padovan SpiralGenerate an ASCII Padovan SpiralGolf a Custom Fibonacci SequenceImplement the Fibonacci sequence… Shifted to the rightDizzy integer enumerationModulus SummationFour Spiraling AxesIt's getting harder and harder to be composite these days













3












$begingroup$


Everyone knows the Fibonacci sequence:

You take a square, attach an equal square to it, then repeatedly attach a square whose side length is equal to the largest side length of the resulting rectangle.

The result is a beautiful spiral of squares whose sequence of numbers is the Fibonacci sequence:





But, what if we didn't want to use squares?



If we use equilateral triangles—instead of squares—in a similar fashion, we get an equally beautiful spiral of triangles and a new sequence: the Padovan sequence, aka A000931:





Task:



Given a positive integer, $N$, output $a_N$, the $N$th term in the Padovan sequence OR the first $N$ terms.



Assume that the first three terms of the sequence are all $1$. Thus, the sequence will start as follows:
$$
1,1,1,2,2,3,...
$$



Input:



  • Any positive integer $Nge0$


  • Invalid input does not have to be taken into account


Output:



  • The $N$th term in the Padovan sequence OR the first $N$ terms of the Padovan sequence.


  • If the first $N$ terms are printed out, the output can be whatever is convenient (list/array, multi-line string, etc.)


  • Can be either $0$-indexed or $1$-indexed


Test Cases:

(0-indexed, $N$th term)



Input | Output
--------------
0 | 1
1 | 1
2 | 1
4 | 2
6 | 4
14 | 37
20 | 200
33 | 7739


(0-indexed, first $N$ terms)



Input | Output
--------------
1 | 1
3 | 1,1,1
4 | 1,1,1,2
7 | 1,1,1,2,2,3,4
10 | 1,1,1,2,2,3,4,5,7,9
12 | 1,1,1,2,2,3,4,5,7,9,12,16


Rules:



  • This is code-golf: the fewer bytes, the better!


  • Standard loopholes are forbidden.










share|improve this question











$endgroup$











  • $begingroup$
    Sandbox post can be found here.
    $endgroup$
    – Tau
    45 mins ago






  • 1




    $begingroup$
    14 (0-indexed) is shown as outputting 28 while I believe it should yield 37
    $endgroup$
    – Jonathan Allan
    13 mins ago










  • $begingroup$
    @JonathanAllan yes, you are correct. I fixed the last two test cases for $N$th term but not that one. The post has been edited.
    $endgroup$
    – Tau
    11 mins ago















3












$begingroup$


Everyone knows the Fibonacci sequence:

You take a square, attach an equal square to it, then repeatedly attach a square whose side length is equal to the largest side length of the resulting rectangle.

The result is a beautiful spiral of squares whose sequence of numbers is the Fibonacci sequence:





But, what if we didn't want to use squares?



If we use equilateral triangles—instead of squares—in a similar fashion, we get an equally beautiful spiral of triangles and a new sequence: the Padovan sequence, aka A000931:





Task:



Given a positive integer, $N$, output $a_N$, the $N$th term in the Padovan sequence OR the first $N$ terms.



Assume that the first three terms of the sequence are all $1$. Thus, the sequence will start as follows:
$$
1,1,1,2,2,3,...
$$



Input:



  • Any positive integer $Nge0$


  • Invalid input does not have to be taken into account


Output:



  • The $N$th term in the Padovan sequence OR the first $N$ terms of the Padovan sequence.


  • If the first $N$ terms are printed out, the output can be whatever is convenient (list/array, multi-line string, etc.)


  • Can be either $0$-indexed or $1$-indexed


Test Cases:

(0-indexed, $N$th term)



Input | Output
--------------
0 | 1
1 | 1
2 | 1
4 | 2
6 | 4
14 | 37
20 | 200
33 | 7739


(0-indexed, first $N$ terms)



Input | Output
--------------
1 | 1
3 | 1,1,1
4 | 1,1,1,2
7 | 1,1,1,2,2,3,4
10 | 1,1,1,2,2,3,4,5,7,9
12 | 1,1,1,2,2,3,4,5,7,9,12,16


Rules:



  • This is code-golf: the fewer bytes, the better!


  • Standard loopholes are forbidden.










share|improve this question











$endgroup$











  • $begingroup$
    Sandbox post can be found here.
    $endgroup$
    – Tau
    45 mins ago






  • 1




    $begingroup$
    14 (0-indexed) is shown as outputting 28 while I believe it should yield 37
    $endgroup$
    – Jonathan Allan
    13 mins ago










  • $begingroup$
    @JonathanAllan yes, you are correct. I fixed the last two test cases for $N$th term but not that one. The post has been edited.
    $endgroup$
    – Tau
    11 mins ago













3












3








3





$begingroup$


Everyone knows the Fibonacci sequence:

You take a square, attach an equal square to it, then repeatedly attach a square whose side length is equal to the largest side length of the resulting rectangle.

The result is a beautiful spiral of squares whose sequence of numbers is the Fibonacci sequence:





But, what if we didn't want to use squares?



If we use equilateral triangles—instead of squares—in a similar fashion, we get an equally beautiful spiral of triangles and a new sequence: the Padovan sequence, aka A000931:





Task:



Given a positive integer, $N$, output $a_N$, the $N$th term in the Padovan sequence OR the first $N$ terms.



Assume that the first three terms of the sequence are all $1$. Thus, the sequence will start as follows:
$$
1,1,1,2,2,3,...
$$



Input:



  • Any positive integer $Nge0$


  • Invalid input does not have to be taken into account


Output:



  • The $N$th term in the Padovan sequence OR the first $N$ terms of the Padovan sequence.


  • If the first $N$ terms are printed out, the output can be whatever is convenient (list/array, multi-line string, etc.)


  • Can be either $0$-indexed or $1$-indexed


Test Cases:

(0-indexed, $N$th term)



Input | Output
--------------
0 | 1
1 | 1
2 | 1
4 | 2
6 | 4
14 | 37
20 | 200
33 | 7739


(0-indexed, first $N$ terms)



Input | Output
--------------
1 | 1
3 | 1,1,1
4 | 1,1,1,2
7 | 1,1,1,2,2,3,4
10 | 1,1,1,2,2,3,4,5,7,9
12 | 1,1,1,2,2,3,4,5,7,9,12,16


Rules:



  • This is code-golf: the fewer bytes, the better!


  • Standard loopholes are forbidden.










share|improve this question











$endgroup$




Everyone knows the Fibonacci sequence:

You take a square, attach an equal square to it, then repeatedly attach a square whose side length is equal to the largest side length of the resulting rectangle.

The result is a beautiful spiral of squares whose sequence of numbers is the Fibonacci sequence:





But, what if we didn't want to use squares?



If we use equilateral triangles—instead of squares—in a similar fashion, we get an equally beautiful spiral of triangles and a new sequence: the Padovan sequence, aka A000931:





Task:



Given a positive integer, $N$, output $a_N$, the $N$th term in the Padovan sequence OR the first $N$ terms.



Assume that the first three terms of the sequence are all $1$. Thus, the sequence will start as follows:
$$
1,1,1,2,2,3,...
$$



Input:



  • Any positive integer $Nge0$


  • Invalid input does not have to be taken into account


Output:



  • The $N$th term in the Padovan sequence OR the first $N$ terms of the Padovan sequence.


  • If the first $N$ terms are printed out, the output can be whatever is convenient (list/array, multi-line string, etc.)


  • Can be either $0$-indexed or $1$-indexed


Test Cases:

(0-indexed, $N$th term)



Input | Output
--------------
0 | 1
1 | 1
2 | 1
4 | 2
6 | 4
14 | 37
20 | 200
33 | 7739


(0-indexed, first $N$ terms)



Input | Output
--------------
1 | 1
3 | 1,1,1
4 | 1,1,1,2
7 | 1,1,1,2,2,3,4
10 | 1,1,1,2,2,3,4,5,7,9
12 | 1,1,1,2,2,3,4,5,7,9,12,16


Rules:



  • This is code-golf: the fewer bytes, the better!


  • Standard loopholes are forbidden.







code-golf number sequence






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 10 mins ago







Tau

















asked 45 mins ago









TauTau

786313




786313











  • $begingroup$
    Sandbox post can be found here.
    $endgroup$
    – Tau
    45 mins ago






  • 1




    $begingroup$
    14 (0-indexed) is shown as outputting 28 while I believe it should yield 37
    $endgroup$
    – Jonathan Allan
    13 mins ago










  • $begingroup$
    @JonathanAllan yes, you are correct. I fixed the last two test cases for $N$th term but not that one. The post has been edited.
    $endgroup$
    – Tau
    11 mins ago
















  • $begingroup$
    Sandbox post can be found here.
    $endgroup$
    – Tau
    45 mins ago






  • 1




    $begingroup$
    14 (0-indexed) is shown as outputting 28 while I believe it should yield 37
    $endgroup$
    – Jonathan Allan
    13 mins ago










  • $begingroup$
    @JonathanAllan yes, you are correct. I fixed the last two test cases for $N$th term but not that one. The post has been edited.
    $endgroup$
    – Tau
    11 mins ago















$begingroup$
Sandbox post can be found here.
$endgroup$
– Tau
45 mins ago




$begingroup$
Sandbox post can be found here.
$endgroup$
– Tau
45 mins ago




1




1




$begingroup$
14 (0-indexed) is shown as outputting 28 while I believe it should yield 37
$endgroup$
– Jonathan Allan
13 mins ago




$begingroup$
14 (0-indexed) is shown as outputting 28 while I believe it should yield 37
$endgroup$
– Jonathan Allan
13 mins ago












$begingroup$
@JonathanAllan yes, you are correct. I fixed the last two test cases for $N$th term but not that one. The post has been edited.
$endgroup$
– Tau
11 mins ago




$begingroup$
@JonathanAllan yes, you are correct. I fixed the last two test cases for $N$th term but not that one. The post has been edited.
$endgroup$
– Tau
11 mins ago










7 Answers
7






active

oldest

votes


















4












$begingroup$


Python 2, 30 bytes





f=lambda n:n<3or f(n-2)+f(n-3)


Try it online!



Returns the n'th term zero indexed. Outputs True for 1.






share|improve this answer











$endgroup$




















    3












    $begingroup$


    Oasis, 5 bytes



    nth term 0-indexed



    cd+1V


    Try it online!



    Explanation



     1V # a(0) = 1
    # a(1) = 1
    # a(2) = 1
    # a(n) =
    c # a(n-2)
    + # +
    d # a(n-3)





    share|improve this answer









    $endgroup$




















      2












      $begingroup$


      Wolfram Language (Mathematica), 33 bytes



      a@0=a@1=a@2=1;a@n_:=a[n-2]+a[n-3] 


      1-indexed, returns the nth term



      Try it online!






      share|improve this answer









      $endgroup$




















        2












        $begingroup$


        Python 2, 56 48 bytes





        f=lambda n,a=1,b=1,c=1:n>2and f(n-1,b,c,a+b)or c


        Try it online!



        Returns nth value, 0-indexed.






        share|improve this answer









        $endgroup$




















          2












          $begingroup$


          J, 26 bytes



          0.5<.@+1.04535%~1.32472^<:


          Try it online!



          Uses the closed form formula.






          share|improve this answer











          $endgroup$




















            2












            $begingroup$


            Jelly, 11 bytes



            5B+Ɲ2ị;Ʋ⁸¡Ḣ


            Try it online!



            0-indexed.





            share











            $endgroup$












            • $begingroup$
              Can you specify whether this answer is 0-indexed or 1-indexed?
              $endgroup$
              – Tau
              5 mins ago










            • $begingroup$
              @Tau It's 0-indexed. I've edited it in.
              $endgroup$
              – Erik the Outgolfer
              4 mins ago



















            1












            $begingroup$


            Jelly, 10 bytes



            ‘HŻcḤạ¥¥‘S


            A monadic Link accepting n (1-indexed) which yields P(n).



            Try it online!





            share









            $endgroup$













              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.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "200"
              ;
              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: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              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
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f182797%2fpatience-young-padovan%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              7 Answers
              7






              active

              oldest

              votes








              7 Answers
              7






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              4












              $begingroup$


              Python 2, 30 bytes





              f=lambda n:n<3or f(n-2)+f(n-3)


              Try it online!



              Returns the n'th term zero indexed. Outputs True for 1.






              share|improve this answer











              $endgroup$

















                4












                $begingroup$


                Python 2, 30 bytes





                f=lambda n:n<3or f(n-2)+f(n-3)


                Try it online!



                Returns the n'th term zero indexed. Outputs True for 1.






                share|improve this answer











                $endgroup$















                  4












                  4








                  4





                  $begingroup$


                  Python 2, 30 bytes





                  f=lambda n:n<3or f(n-2)+f(n-3)


                  Try it online!



                  Returns the n'th term zero indexed. Outputs True for 1.






                  share|improve this answer











                  $endgroup$




                  Python 2, 30 bytes





                  f=lambda n:n<3or f(n-2)+f(n-3)


                  Try it online!



                  Returns the n'th term zero indexed. Outputs True for 1.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 4 mins ago

























                  answered 19 mins ago









                  xnorxnor

                  93.3k18190448




                  93.3k18190448





















                      3












                      $begingroup$


                      Oasis, 5 bytes



                      nth term 0-indexed



                      cd+1V


                      Try it online!



                      Explanation



                       1V # a(0) = 1
                      # a(1) = 1
                      # a(2) = 1
                      # a(n) =
                      c # a(n-2)
                      + # +
                      d # a(n-3)





                      share|improve this answer









                      $endgroup$

















                        3












                        $begingroup$


                        Oasis, 5 bytes



                        nth term 0-indexed



                        cd+1V


                        Try it online!



                        Explanation



                         1V # a(0) = 1
                        # a(1) = 1
                        # a(2) = 1
                        # a(n) =
                        c # a(n-2)
                        + # +
                        d # a(n-3)





                        share|improve this answer









                        $endgroup$















                          3












                          3








                          3





                          $begingroup$


                          Oasis, 5 bytes



                          nth term 0-indexed



                          cd+1V


                          Try it online!



                          Explanation



                           1V # a(0) = 1
                          # a(1) = 1
                          # a(2) = 1
                          # a(n) =
                          c # a(n-2)
                          + # +
                          d # a(n-3)





                          share|improve this answer









                          $endgroup$




                          Oasis, 5 bytes



                          nth term 0-indexed



                          cd+1V


                          Try it online!



                          Explanation



                           1V # a(0) = 1
                          # a(1) = 1
                          # a(2) = 1
                          # a(n) =
                          c # a(n-2)
                          + # +
                          d # a(n-3)






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 33 mins ago









                          EmignaEmigna

                          47.4k433144




                          47.4k433144





















                              2












                              $begingroup$


                              Wolfram Language (Mathematica), 33 bytes



                              a@0=a@1=a@2=1;a@n_:=a[n-2]+a[n-3] 


                              1-indexed, returns the nth term



                              Try it online!






                              share|improve this answer









                              $endgroup$

















                                2












                                $begingroup$


                                Wolfram Language (Mathematica), 33 bytes



                                a@0=a@1=a@2=1;a@n_:=a[n-2]+a[n-3] 


                                1-indexed, returns the nth term



                                Try it online!






                                share|improve this answer









                                $endgroup$















                                  2












                                  2








                                  2





                                  $begingroup$


                                  Wolfram Language (Mathematica), 33 bytes



                                  a@0=a@1=a@2=1;a@n_:=a[n-2]+a[n-3] 


                                  1-indexed, returns the nth term



                                  Try it online!






                                  share|improve this answer









                                  $endgroup$




                                  Wolfram Language (Mathematica), 33 bytes



                                  a@0=a@1=a@2=1;a@n_:=a[n-2]+a[n-3] 


                                  1-indexed, returns the nth term



                                  Try it online!







                                  share|improve this answer












                                  share|improve this answer



                                  share|improve this answer










                                  answered 32 mins ago









                                  J42161217J42161217

                                  13.8k21253




                                  13.8k21253





















                                      2












                                      $begingroup$


                                      Python 2, 56 48 bytes





                                      f=lambda n,a=1,b=1,c=1:n>2and f(n-1,b,c,a+b)or c


                                      Try it online!



                                      Returns nth value, 0-indexed.






                                      share|improve this answer









                                      $endgroup$

















                                        2












                                        $begingroup$


                                        Python 2, 56 48 bytes





                                        f=lambda n,a=1,b=1,c=1:n>2and f(n-1,b,c,a+b)or c


                                        Try it online!



                                        Returns nth value, 0-indexed.






                                        share|improve this answer









                                        $endgroup$















                                          2












                                          2








                                          2





                                          $begingroup$


                                          Python 2, 56 48 bytes





                                          f=lambda n,a=1,b=1,c=1:n>2and f(n-1,b,c,a+b)or c


                                          Try it online!



                                          Returns nth value, 0-indexed.






                                          share|improve this answer









                                          $endgroup$




                                          Python 2, 56 48 bytes





                                          f=lambda n,a=1,b=1,c=1:n>2and f(n-1,b,c,a+b)or c


                                          Try it online!



                                          Returns nth value, 0-indexed.







                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered 22 mins ago









                                          Chas BrownChas Brown

                                          5,2091523




                                          5,2091523





















                                              2












                                              $begingroup$


                                              J, 26 bytes



                                              0.5<.@+1.04535%~1.32472^<:


                                              Try it online!



                                              Uses the closed form formula.






                                              share|improve this answer











                                              $endgroup$

















                                                2












                                                $begingroup$


                                                J, 26 bytes



                                                0.5<.@+1.04535%~1.32472^<:


                                                Try it online!



                                                Uses the closed form formula.






                                                share|improve this answer











                                                $endgroup$















                                                  2












                                                  2








                                                  2





                                                  $begingroup$


                                                  J, 26 bytes



                                                  0.5<.@+1.04535%~1.32472^<:


                                                  Try it online!



                                                  Uses the closed form formula.






                                                  share|improve this answer











                                                  $endgroup$




                                                  J, 26 bytes



                                                  0.5<.@+1.04535%~1.32472^<:


                                                  Try it online!



                                                  Uses the closed form formula.







                                                  share|improve this answer














                                                  share|improve this answer



                                                  share|improve this answer








                                                  edited 13 mins ago

























                                                  answered 23 mins ago









                                                  JonahJonah

                                                  2,5911017




                                                  2,5911017





















                                                      2












                                                      $begingroup$


                                                      Jelly, 11 bytes



                                                      5B+Ɲ2ị;Ʋ⁸¡Ḣ


                                                      Try it online!



                                                      0-indexed.





                                                      share











                                                      $endgroup$












                                                      • $begingroup$
                                                        Can you specify whether this answer is 0-indexed or 1-indexed?
                                                        $endgroup$
                                                        – Tau
                                                        5 mins ago










                                                      • $begingroup$
                                                        @Tau It's 0-indexed. I've edited it in.
                                                        $endgroup$
                                                        – Erik the Outgolfer
                                                        4 mins ago
















                                                      2












                                                      $begingroup$


                                                      Jelly, 11 bytes



                                                      5B+Ɲ2ị;Ʋ⁸¡Ḣ


                                                      Try it online!



                                                      0-indexed.





                                                      share











                                                      $endgroup$












                                                      • $begingroup$
                                                        Can you specify whether this answer is 0-indexed or 1-indexed?
                                                        $endgroup$
                                                        – Tau
                                                        5 mins ago










                                                      • $begingroup$
                                                        @Tau It's 0-indexed. I've edited it in.
                                                        $endgroup$
                                                        – Erik the Outgolfer
                                                        4 mins ago














                                                      2












                                                      2








                                                      2





                                                      $begingroup$


                                                      Jelly, 11 bytes



                                                      5B+Ɲ2ị;Ʋ⁸¡Ḣ


                                                      Try it online!



                                                      0-indexed.





                                                      share











                                                      $endgroup$




                                                      Jelly, 11 bytes



                                                      5B+Ɲ2ị;Ʋ⁸¡Ḣ


                                                      Try it online!



                                                      0-indexed.






                                                      share













                                                      share


                                                      share








                                                      edited 4 mins ago

























                                                      answered 8 mins ago









                                                      Erik the OutgolferErik the Outgolfer

                                                      33k429106




                                                      33k429106











                                                      • $begingroup$
                                                        Can you specify whether this answer is 0-indexed or 1-indexed?
                                                        $endgroup$
                                                        – Tau
                                                        5 mins ago










                                                      • $begingroup$
                                                        @Tau It's 0-indexed. I've edited it in.
                                                        $endgroup$
                                                        – Erik the Outgolfer
                                                        4 mins ago

















                                                      • $begingroup$
                                                        Can you specify whether this answer is 0-indexed or 1-indexed?
                                                        $endgroup$
                                                        – Tau
                                                        5 mins ago










                                                      • $begingroup$
                                                        @Tau It's 0-indexed. I've edited it in.
                                                        $endgroup$
                                                        – Erik the Outgolfer
                                                        4 mins ago
















                                                      $begingroup$
                                                      Can you specify whether this answer is 0-indexed or 1-indexed?
                                                      $endgroup$
                                                      – Tau
                                                      5 mins ago




                                                      $begingroup$
                                                      Can you specify whether this answer is 0-indexed or 1-indexed?
                                                      $endgroup$
                                                      – Tau
                                                      5 mins ago












                                                      $begingroup$
                                                      @Tau It's 0-indexed. I've edited it in.
                                                      $endgroup$
                                                      – Erik the Outgolfer
                                                      4 mins ago





                                                      $begingroup$
                                                      @Tau It's 0-indexed. I've edited it in.
                                                      $endgroup$
                                                      – Erik the Outgolfer
                                                      4 mins ago












                                                      1












                                                      $begingroup$


                                                      Jelly, 10 bytes



                                                      ‘HŻcḤạ¥¥‘S


                                                      A monadic Link accepting n (1-indexed) which yields P(n).



                                                      Try it online!





                                                      share









                                                      $endgroup$

















                                                        1












                                                        $begingroup$


                                                        Jelly, 10 bytes



                                                        ‘HŻcḤạ¥¥‘S


                                                        A monadic Link accepting n (1-indexed) which yields P(n).



                                                        Try it online!





                                                        share









                                                        $endgroup$















                                                          1












                                                          1








                                                          1





                                                          $begingroup$


                                                          Jelly, 10 bytes



                                                          ‘HŻcḤạ¥¥‘S


                                                          A monadic Link accepting n (1-indexed) which yields P(n).



                                                          Try it online!





                                                          share









                                                          $endgroup$




                                                          Jelly, 10 bytes



                                                          ‘HŻcḤạ¥¥‘S


                                                          A monadic Link accepting n (1-indexed) which yields P(n).



                                                          Try it online!






                                                          share











                                                          share


                                                          share










                                                          answered 1 min ago









                                                          Jonathan AllanJonathan Allan

                                                          53.7k535173




                                                          53.7k535173



























                                                              draft saved

                                                              draft discarded
















































                                                              If this is an answer to a challenge…



                                                              • …Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.


                                                              • …Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
                                                                Explanations of your answer make it more interesting to read and are very much encouraged.


                                                              • …Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.


                                                              More generally…



                                                              • …Please make sure to answer the question and provide sufficient detail.


                                                              • …Avoid asking for help, clarification or responding to other answers (use comments instead).




                                                              draft saved


                                                              draft discarded














                                                              StackExchange.ready(
                                                              function ()
                                                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f182797%2fpatience-young-padovan%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

                                                              बाताम इन्हें भी देखें सन्दर्भ दिक्चालन सूची1°05′00″N 104°02′0″E / 1.08333°N 104.03333°E / 1.08333; 104.033331°05′00″N 104°02′0″E / 1.08333°N 104.03333°E / 1.08333; 104.03333

                                                              Why is the 'in' operator throwing an error with a string literal instead of logging false?Why can't I use switch statement on a String?Python join: why is it string.join(list) instead of list.join(string)?Multiline String Literal in C#Why does comparing strings using either '==' or 'is' sometimes produce a different result?How to initialize an array's length in javascript?How can I print literal curly-brace characters in python string and also use .format on it?Why does ++[[]][+[]]+[+[]] return the string “10”?Why is char[] preferred over String for passwords?Why does this code using random strings print “hello world”?jQuery.inArray(), how to use it right?

                                                              How can we generalize the fact of finite dimensional vector space to an infinte dimensional case?$k[x]$-module and cyclic module over a finite dimensional vector spaceSubspace of a finite dimensional space is finite dimensionalIf V is an infinite-dimensional vector space, and S is an infinite-dimensional subspace of V, must the dimension of V/S be finite? ExplainWhy is an infinite dimensional space so different than a finite dimensional one?base for finite dimensional vector space is not infinite dimensional vector space?Any finite-dimensional vector space is the dual space of anotherHaving Trouble Understanding Meaning Of A Finite-Dimensional Vector SpaceProve that “Every subspaces of a finite-dimensional vector space is finite-dimensional”Ring as a finite dimensional Vector space over a field KQuestion regarding basis and dimension