[Question]
  [
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*:
![](https://i.stack.imgur.com/yYPNK.png)
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](https://oeis.org/A000931):
![](https://i.stack.imgur.com/qNdom.png)
**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 \$N\ge0\$
* 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
```
(1-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](/questions/tagged/code-golf "show questions tagged 'code-golf'"): the fewer bytes, the better!
* [Standard loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) are forbidden.
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 10 bytes
```
9s3’Ẓæ*³FṀ
```
[Try it online!](https://tio.run/##ASAA3/9qZWxsef//OXMz4oCZ4bqSw6YqwrNG4bmA//8xMP8zNA "Jelly – Try It Online")
1-indexed. Computes the largest element of: $$\begin{bmatrix}0&0&1 \\ 1&0&1 \\ 0&1&0\end{bmatrix}^n$$
where the binary matrix is conveniently computed as: $$\begin{bmatrix}\mathsf{isprime}(0)&\mathsf{isprime}(1)&\mathsf{isprime}(2) \\ \mathsf{isprime}(3)&\mathsf{isprime}(4)&\mathsf{isprime}(5) \\ \mathsf{isprime}(6)&\mathsf{isprime}(7)&\mathsf{isprime}(8)\end{bmatrix}$$
(this is a total coincidence.)
```
9s3         [[1,2,3],[4,5,6],[7,8,9]]    9 split 3
   ’        [[0,1,2],[3,4,5],[6,7,8]]    decrease
    Ẓ       [[0,0,1],[1,0,1],[0,1,0]]    isprime
     æ*³    [[0,0,1],[1,0,1],[0,1,0]]^n  matrix power by input
        FṀ                               flatten, maximum
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~10 9~~ 8 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
ŻṚm2Jc$S
```
A monadic Link accepting `n` (0-indexed) which yields `P(n)`.
**[Try it online!](https://tio.run/##y0rNyan8///o7oc7Z@UaeSWrBP///9/YGAA "Jelly – Try It Online")**
### How?
Implements \$P(n) = \sum\_{i=0}^{\lfloor\frac{n}2\rfloor}\binom{i+1}{n-2i}\$
```
ŻṚm2Jc$S - Link: integer, n       e.g. 20
Ż        - zero range                  [0, 1, 2, 3, 4, ..., 19, 20]
 Ṛ       - reverse                     [20, 19, ..., 4, 3, 2, 1, 0]
  m2     - modulo-slice with 2         [20, 18, 16, 14, 12, 10,  8,  6,  4,  2,  0]  <- n-2i
      $  - last two links as a monad:
    J    -   range of length           [ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11]  <- i+1
     c   -   left-choose-right         [ 0,  0,  0,  0,  0,  0,  0, 28,126, 45,  1]
       S - sum                         200
```
---
And [here](https://tio.run/##AR4A4f9qZWxsef//M@G4iuG5l1Lhuo7Cp8SL4oCY////MTU) is a "twofer"  
...a totally different method also for **8 bytes** (this one is 1-indexed, but much slower):
```
3ḊṗRẎ§ċ‘ - Link: n
3Ḋ       - 3 dequeued = [2,3]
   R     - range = [1,2,3,...,n]
  ṗ      -   Cartesian power         [[[2],[3]],[[2,2],[2,3],[3,2],[3,3]],[[2,2,2],...],...]
    Ẏ    - tighten                   [[2],[3],[2,2],[2,3],[3,2],[3,3],[2,2,2],...]
     §   - sums                      [ 2,  3,   4,    5,    5,    6,     6,...]
       ‘ - increment                 n+1
      ċ  - count occurrences         P(n)
```
[Answer]
# [Oasis](https://github.com/Adriandmen/Oasis), 5 bytes
**nth** term 0-indexed
```
cd+1V
```
[Try it online!](https://tio.run/##y08sziz@/z85Rdsw7P///4aWAA "Oasis – Try It Online")
**Explanation**
```
   1V   # a(0) = 1
        # a(1) = 1
        # a(2) = 1
        # a(n) =
c       #        a(n-2)
  +     #              +
 d      #               a(n-3)
```
[Answer]
# [Haskell](https://www.haskell.org/), 26 bytes
```
(l!!)
l=1:1:1:2:scanl(+)2l
```
[Try it online!](https://tio.run/##y0gszk7NyfmfZhvzXyNHUVGTK8fW0AoEjayKkxPzcjS0NY1y/ucmZuYp2CoUFGXmlSioKOQmFiikKUQb6OkZmsb@/5eclpOYXvxfN7mgAAA "Haskell – Try It Online") Outputs the n'th term zero-indexed.
I thought that the "obvious" recursive solution below would be unbeatable, but then I found this. It's similar to the classic golfy expression `l=1:scanl(+)1l` for the infinite Fibonacci list, but here the difference between adjacent elements is the term 4 positions back. We can more directly write `l=1:1:zipWith(+)l(0:l)`, but that's longer.
If this challenge allowed infinite list output, we could cut the first line and have 20 bytes.
**27 bytes**
```
f n|n<3=1|1>0=f(n-2)+f(n-3)
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P00hrybPxtjWsMbQzsA2TSNP10hTG0QZa/7PTczMU7BVKCjKzCtRUFHITSxQSFOINtDTMzSN/f8vOS0nMb34v25yQQEA "Haskell – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 30 bytes
```
f=lambda n:n<3or f(n-2)+f(n-3)
```
[Try it online!](https://tio.run/##K6gsycjPM/r/P802JzE3KSVRIc8qz8Y4v0ghTSNP10hTG0QZa/5PA4rkKWTmKRQl5qWnahiaalpxKRQUZeaVKOTpANVo/gcA "Python 2 – Try It Online")
Returns the n'th term zero indexed. Outputs `True` for 1.
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 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!](https://tio.run/##y00syUjNTSzJTE78/z/RwcA20cEQiI1sDa0THfLirWwTo/N0jWK1QZRx7P@Aosy8EgWHxGhDo9j//wE "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [Octave](https://www.gnu.org/software/octave/) / MATLAB, ~~35~~ 33 bytes
```
@(n)[1 filter(1,'cbaa'-98,2:n<5)]
```
Outputs the first *n* terms.
[Try it online!](https://tio.run/##y08uSSxL/Z9mq6en999BI08z2lAhLTOnJLVIw1BHPTkpMVFd19JCx8gqz8ZUM/Z/moahkeZ/AA "Octave – Try It Online")
### How it works
Anonymous function that implements a [recursive filter](https://en.wikipedia.org/wiki/Digital_filter).
`'cbaa'-98` is a shorter form to produce `[1 0 -1 -1]`.
`2:n<5` is a shorter form to produce `[1 1 1 0 0 ··· 0]` (*n*−1 terms).
`filter(1,[1 0 -1 -1],[1 1 1 0 0 ··· 0])` passes the input `[1 1 1 0 0 ··· 0]` through a discrete-time filter defined by a transfer function with numerator coefficient `1` and denominator coefficients `[1 0 -1 -1]`.
[Answer]
# [J](http://jsoftware.com/), 22 bytes
*-2 bytes thanks to ngn and Galen*
## closed form, 26 bytes
```
0.5<.@+1.04535%~1.32472^<:
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/DfRMbfQctA31DExMjU1V6wz1jI1MzI3ibKz@a3Jx@TnpKRjoZualpFakpnClJmfkK6QpZOoZGfwHAA "J – Try It Online")
## iterative, 22 bytes
```
(],1#._2 _3{ ::1])^:[#
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/NWJ1DJX14o0U4o2rFaysDGM146yilf9rcnH5OekpGOhm5qWkVqSmcKUmZ@Qr6Ogp2DikKRkoZOoZGfwHAA "J – Try It Online")
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), ~~47~~ 42 bytes
```
K`0¶1¶0
"$+"+`.+¶(.+)¶.+$
$&¶$.(*_$1*
6,G`
```
[Try it online!](https://tio.run/##K0otycxLNPz/3zvB4NA2w0PbDLiUVLSVtBP0tA9t09DT1jy0TU9bhUtF7dA2FT0NrXgVQy0uMx33hP//zQE "Retina – Try It Online") Outputs the first `n` terms on separate lines. Explanation:
```
K`0¶1¶0
```
Replace the input with the terms for `-2`, `-1` and `0`.
```
"$+"+`.+¶(.+)¶.+$
$&¶$.(*_$1*
```
Generate the next `n` terms using the recurrence relation. `*_` here is short for `$&*_` which converts the (first) number in the match to unary, while `$1*` is short for `$1*_` which converts the middle number to unary. The `$.(` returns the decimal sum of its unary arguments, i.e. the sum of the first and middle numbers.
```
6,G`
```
Discard the first six characters, i.e. the first three lines.
[Answer]
# [Perl 6](http://perl6.org/), 24 bytes
```
{(1,1,1,*+*+!*...*)[$_]}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/WsNQBwS1tLW0FbX09PS0NKNV4mNr/xcnVipoxBkZatrZ6aml/QcA "Perl 6 – Try It Online")
A pretty standard generated sequence, with each new element generated by the expression `* + * + !*`. That adds the third-previous element, the second-previous element, and the logical negation of the previous element, which is always `False`, which is numerically zero.
[Answer]
# [Cubix](https://github.com/ETHproductions/cubix), 20 bytes
This is 0 indexed and outputs the *N*th term
```
;@UOI010+p?/sqq;W.\(
```
[Try it online!](https://tio.run/##Sy5Nyqz4/9/aIdTf08DQQLvAXr@4sNA6XC9G4/9/QxMA "Cubix – Try It Online")
Wraps onto a cube with side length 2
```
    ; @
    U O
I 0 1 0 + p ? /
s q q ; W . \ (
    . .
    . .
```
[Watch it run](https://ethproductions.github.io/cubix/?code=ICAgIDsgQAogICAgVSBPCkkgMCAxIDAgKyBwID8gLwpzIHEgcSA7IFcgLiBcICgKICAgIC4gLgogICAgLiAuCg==&input=MTQ=&speed=20)
* `I010` - Initiates the stack
* `+p?` - Adds the top of stack, pulls the counter from the bottom of stack and tests
* `/;UO@` - If counter is 0, reflect onto top face, remove TOS, u-turn, output and halt
* `\(sqq;W` - If counter is positive, reflect, decrement counter, swap TOS, push top to bottom twice, remove TOS and shift lane back into the main loop.
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), ~~20~~ ~~18~~ 17 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319 "When can APL characters be counted as 1 byte each?")[SBCS](https://github.com/abrudz/SBCS ".dyalog files using a single byte character set")
This code is 1-indexed. It's the same number of bytes to get `n` items of the Padovan sequence, as you have to drop the last few extra members. It's also the same number of bytes to get 0-indexing.
**Edit:** -2 bytes thanks to ngn. -1 byte thanks to ngn
```
4⌷2(⊢,⍨2⌷+/)⍣⎕×⍳3
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///qKNdIe2/yaOe7UYaj7oW6TzqXWEE5Gjraz7qXfyob@rh6Y96NxuDlHGlPWqb8Ki3z/BRz1712mp1HXWgNAgXqT/q3aoO1AzSCOQnF6mnqSs86p2rUFKUmJKWp1CSrwCk/lcDlSkYPurdAmLopAGJ2kMrgKaDGMYGAA)
**Explanation**
```
4⌷2(⊢,⍨2⌷+/)⍣⎕×⍳3
  ⍺(. . . .)⍣⎕⍵   This format simply takes the input ⎕ and applies the function
                   inside the brackets (...) to its operands (here marked ⍵ and ⍺).
  2(. . .+/)⍣⎕×⍳3  In this case, our ⍵, the left argument, is the array 1 1 1,
                   where we save our results as the function is repeatedly applied
                   and our ⍺, 2, is our right argument and is immediately applied to +/,
                   so that we have 2+/ which will return the pairwise sums of our array.
       2⌷          We take the second pairwise sum, f(n-2) + f(n-3)
    ⊢,⍨            And add it to the head of our array.
4⌷                 When we've finished adding Padovan numbers to the end of our list,
                   the n-th Padovan number (1-indexed) is the 4th member of that list,
                   and so, we implicitly return that.
```
[Answer]
# [Python 2](https://docs.python.org/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!](https://tio.run/##DcgxDoAgDADA3Vd0hIgDjCb4EeNQwGoTLYSw@HpkuOXK1@4srnfyD74hIYhBb00YorerbA4lASlZRppocA46V4i9VJYGOynWQGMYWKCiXKeyTh9T/wE "Python 2 – Try It Online")
Returns nth value, 0-indexed.
[Answer]
# [K (ngn/k)](https://gitlab.com/n9n/k), ~~24~~ 20 bytes
-4 bytes thanks to ngn!
```
{$[x<3;1;+/o'x-2 3]}
```
[Try it online!](https://tio.run/##y9bNS8/7/z/NqlolusLG2NrQWls/X71C10jBOLb2f5q6gqKh0X8A "K (ngn/k) – Try It Online")
0-indexed, first N terms
[Answer]
# x86 32-bit machine code, 17 bytes
```
53 33 db f7 e3 43 83 c1 04 03 d8 93 92 e2 fa 5b c3
```
Disassembly:
```
00CE1250 53                   push        ebx  
00CE1251 33 DB                xor         ebx,ebx  
00CE1253 F7 E3                mul         eax,ebx  
00CE1255 43                   inc         ebx  
00CE1256 83 C1 04             add         ecx,4  
00CE1259 03 D8                add         ebx,eax  
00CE125B 93                   xchg        eax,ebx  
00CE125C 92                   xchg        eax,edx  
00CE125D E2 FA                loop        myloop (0CE1259h)  
00CE125F 5B                   pop         ebx  
00CE1260 C3                   ret
```
It is 0-indexed. The initialization is conveniently achieved by calculating eax \* 0. The 128-bit result is 0, and it goes in edx:eax.
At the beginning of each iteration, the order of the registers is ebx, eax, edx. I had to choose the right order to take advantage of the encoding for the `xchg eax` instruction - 1 byte.
I had to add 4 to the loop counter in order to let the output reach `eax`, which holds the function's return value in the `fastcall` convention.
I could use some other calling convention, which doesn't require saving and restoring `ebx`, but `fastcall` is fun anyway :)
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 7 bytes
Thanks to [Kevin](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen) for -1 byte!
```
Ì1λè₂₃+
```
[Try it online!](https://tio.run/##yy9OTMpM/f//cI/hud2HVzxqanrU1Kz9/7@xMQA "05AB1E – Try It Online")
### Previous version: [05AB1E](https://github.com/Adriandmen/05AB1E), 8 bytes
```
1Ð)λ£₂₃+
```
[Try it online!](https://tio.run/##yy9OTMpM/f/f8PAEzXO7Dy1@1NT0qKlZ@/9/I1MA "05AB1E – Try It Online")
Bear with me, I haven't golfed in a while. I wonder if there's a shorter substitute for `1Ð)` which works in this case (I've tried `1D)`, `3Å1` etc. but none of them save bytes). Outputs the first \$n\$ terms of the sequence. Or, without the `£`, it would output an infinite stream of the terms of the sequence.
```
1Ð)λ£₂₃+ | Full program.
1Ð)      | Initialize the stack with [1, 1, 1].
   λ     | Begin the recursive generation of a list: Starting from some base case,
         | this command generates an infinite list with the pattern function given.
    £    | Flag for λ. Instead of outputting an infinite stream, only print the first n.
     ₂₃+ | Add a(n-2) and a(n-3).
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 11 bytes
```
5B+Ɲ2ị;Ʋ⁸¡Ḣ
```
[Try it online!](https://tio.run/##ASAA3/9qZWxsef//NUIrxp0y4buLO8ay4oG4wqHhuKL///8zMw "Jelly – Try It Online")
0-indexed.
[Answer]
# [Lua](https://www.lua.org) 5.3, ~~49~~ 48 bytes
```
function f(n)return n<4 and 1or f(n-2)+f(n-3)end
```
[Try it online!](https://tio.run/##LYzBCgIxDETv/YrcbHAVd/WoH1PbFAIl0W57Wvz2mkWHgQzDy5QexshdYmMVyF6wUutVQO43CJJg1rrXpwWP@7kiSRpFYyiw0hsesH1cNoYtzhMsF0jqwNTCs9CZZaXavKGTzTCis3/nXpWl@R8SVWL4Iwcz4vgC "Lua – Try It Online")
Vanilla Lua doesn't have coercion of booleans to strings (even `tonumber(true)` returns `nil`), so you have to use a pseudo-ternary operator. This version is 1-indexed, like all of Lua. The `1or` part has to be changed to `1 or` in Lua 5.1, which has a different way of lexing numbers.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 26 bytes
```
f=->n{n<3?1:f[n-2]+f[n-3]}
```
[Try it online!](https://tio.run/##KypNqvz/P81W1y6vOs/G2N7QKi06T9coVhtEGcfW/tcw0NMzNtbUy00sqK6pqClQiK7QSYuuiAVKAQA "Ruby – Try It Online")
[Answer]
# JavaScript (ES6), 23 bytes
Implements the recursive definition of [A000931](https://oeis.org/A000931), but with \$a(0)=a(1)=a(2)=1\$, as specified in the challenge.
Returns the \$N\$th term, 0-indexed.
```
f=n=>n<3||f(n-2)+f(n-3)
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/f8/zTbP1i7PxrimJk0jT9dIUxtEGWv@T87PK87PSdXLyU/XSNMw0NTkQhUxxBAxwhAxwRAxwzQHU5ERpm3Gxpqa/wE "JavaScript (Node.js) – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-N`](https://codegolf.meta.stackexchange.com/a/14339/), 12 bytes
```
<3ªßUµ2 +ß´U
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LU4&code=PDOq31W1MiAr37RV&input=MTA)
[Answer]
# TI-BASIC (TI-84), 34 bytes
```
[[0,1,0][0,0,1][1,1,0]]^(Ans+5:Ans(1,1
```
0-indexed \$N\$th term of the sequence.
Input is in `Ans`.  
Output is in `Ans` and is automatically printed out.
~~I figured that enough time had passed, plus multiple answers had been posted, of which there were many which out-golfed this answer.~~
**Example:**
```
0
               0
prgmCDGFD
               1
9
               9
prgmCDGFD
               9
16
              16
prgmCDGFD
              65
```
**Explanation:**
```
[[0,1,0][0,0,1][1,1,0]]^(Ans+5:Ans(1,1      ;full program (example input: 6)
[[0,1,0][0,0,1][1,1,0]]                     ;generate the following matrix:
                                            ; [0 1 0]
                                            ; [0 0 1]
                                            ; [1 1 0]
                       ^(Ans+5              ;then raise it to the power of: input + 5
                                            ; [4  7 5]
                                            ; [5  9 7]
                                            ; [7 12 9]
                               Ans(1,1      ;get the top-left index and leave it in "Ans"
                                            ;implicitly print Ans
```
[Answer]
# Pyth, 16 bytes
```
L?<b3!b+y-b2y-b3
```
This defines the function `y`. [Try it here!](http://pyth.herokuapp.com/?code=L%3F%3Cb3%21b%2By-b2y-b3&input=25&debug=0)
Here's a more fun solution, though it's 9 bytes longer; bytes could be shaved though.
```
+l{sa.pMf.Am&>d2%d2T./QY!
```
This uses the definition given by David Callan on the OEIS page: "a(n) = number of compositions of n into parts that are odd and >= 3." [Try it here!](http://pyth.herokuapp.com/?code=%2Bl%7Bsa.pMf.Am%26%3Ed2%25d2T.%2FQY%21&input=25&debug=0) It takes input directly instead of defining a function.
[Answer]
# [Perl 5](https://www.perl.org/), 34 bytes
```
sub f{"@_"<3||f("@_"-2)+f("@_"-3)}
```
[Try it online!](https://tio.run/##K0gtyjH9/7@4NEkhrVrJIV7JxrimJk0DxNI10tSGsow1a/@rxNumaajEa/434DLkMuIy4TLjMjThMjLgMjb@l19QkpmfV/xftyAHAA "Perl 5 – Try It Online")
[Answer]
# Java, 41 bytes
Can't use a lambda (runtime error). Port of [this Javascript answer](https://codegolf.stackexchange.com/a/182807/84303)
```
int f(int n){return n<3?1:f(n-2)+f(n-3);}
```
[TIO](https://tio.run/##LYyxCoMwFEV3vyJjHkWhzVYL/YJOjqXDqxqJjU9JXoQS8u1phC73DIdzZ9yxnodP7i16Lx5oKFaekU0vsiEWWh5LEN3IwZGgm7qfr1pSfYHTAQVtylt421L8w301g1jKlezYGZqeL3STh1h1X8/j0qyBm60ItiS1VABtlVL@AQ)
[Answer]
# [R + pryr](https://www.r-project.org/), ~~38~~ 36 bytes
Zero-indexed recursive function.
```
f=pryr::f(`if`(n<3,1,f(n-2)+f(n-3)))
```
[Try it online!](https://tio.run/##K/r/P822oKiyyMoqTSMhMy1BI8/GWMdQJ00jT9dIUxtEGWtqav5P0zDQ5ErTMAQRRiDCBESYgcXATCOwvLGx5n8A "R – Try It Online")
Thanks to [@Giuseppe](https://codegolf.stackexchange.com/users/67312/giuseppe) for pointing out two obviously needless bytes.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~12~~ 9 bytes
Returns the `n`th term, 1-indexed.
```
@1gZÔä+}g
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QDFnWtTkK31n&input=MzQ)
```
@1gZÔä+}g     :Implicit input of integer U
        g     :Starting with the array [0,1] do the following U times, pushing the result to the array each time
@             :  Pass the array through the following function as Z
 1g           :    Get the element at 0-based index 1, with wrapping, from the following
   ZÔ         :    Reverse Z
     ä+       :    Get the sums of each consecutive pair of elements
       }      :  End function
              :Implicit output of the last element in the array
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 8 bytes
This implementation of the binomial formula: `a(n) = Sum_{k=0..floor(n/2)} binomial(k+1, n-2k)` is interestingly the same length as the [recursive solution](https://codegolf.stackexchange.com/a/182828/47066).
```
;Ý·-āscO
```
[Try it online!](https://tio.run/##yy9OTMpM/V9TVmmvpKBrp6BkX1n53/rw3EPbdY80Fif7/9f5b8BlyGXEZcJlxmVowmVkwGVsDAA "05AB1E – Try It Online")
**Explanation**
```
;Ý        # push [0 ... floor(input/2)]
  ·       # double each
   -      # subtract each from input
    ā     # push range [1 ... len(list)]
     s    # swap
      c   # choose
       O  # sum
```
[Answer]
# [C (clang)](http://clang.llvm.org/), ~~41~~ 33 bytes
```
a(i){return i<3?1:a(i-2)+a(i-3);}
```
[Try it online!](https://tio.run/##jdDNCoJAEADgcz7FYgQOrbE/opRSpw6degEv4lot2Ca2QmA@u41GdNTTzM5@DDOT@3mZmWvfZ56Gti5sUxuiE3ngO6z4AtZDkBB3/VKbvGxUQZKnVfqxue0dbSy5Z9p40DqLqsbnxXNPpmosSe2bnBv7S4@vqshtoVLjQvy3KzX@juGbIKCMZh4DyqclR8lnSYFSzJIBygComJYhyhBoMGPOoSnHrjKaMeqwv8ADCMamtZSopQQaRXKLvOs/ "C (clang) – Try It Online")
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~9~~ 8 bytes
```
↑ƒ(+ḋ7Ẋ+
```
[Try it online!](https://tio.run/##yygtzv7//1HbxGOTNLQf7ug2f7irS/v///@GRgA "Husk – Try It Online")
There ~~*might* be~~ is a shorter version using `fix`. -1 from Leo!
]