[Question]
  [
A [triangular number](https://en.wikipedia.org/wiki/Triangular_number) is a number that can be expressed as the sum of consecutive positive integers, starting at 1. They can also be expressed with the formula `n(n + 1) / 2`, where `n` is some positive integer.
A number's digitangular counterpart is calculated in the following way:
1. Split a number into an array of its digits e.g. `613 => [6 1 3]`
2. For each number in the array, calculate the `n`th triangular number; `[6 1 3] => [21 1 6]`
3. Sum the resultant array; `[21 1 6] => 28`
Your task is, given an integer `n`, repeatedly calculate `n`'s digitangular counterpart, until the result is equal to 1, then output all values that were calculated. You may output the values in any order, and with an optional inclusion of the original number at the start of the array. This is a [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so the shortest code wins.
## Test cases
```
23 => 9 45 25 18 37 34 16 22 6 21 4 10 1
72 => 31 7 28 39 51 16 22 6 21 4 10 1
55 => 30 6 21 4 10 1
78 => 64 31 7 28 39 51 16 22 6 21 4 10 1
613 => 28 39 51 16 22 6 21 4 10 1
8392 => 90 45 25 18 37 34 16 22 6 21 4 10 1
11111 => 5 15 16 22 6 21 4 10 1
8592025 => 117 30 6 21 4 10 1
999999999 => 405 25 18 37 34 16 22 6 21 4 10 1
```
  
[Answer]
# [Husk](https://github.com/barbuz/Husk), 6 bytes
```
U¬°(·πÅŒ£d
```
[Try it online!](https://tio.run/##yygtzv6vcGhbrsajpsZMzQqlQ9v@hx5aqPFwZ@O5xSn///83MuYyN@IyNeUyt@AyMzTmsjC2NOIyBAEuC1NLIwMjUy5LGAAA "Husk ‚Äì Try It Online")
### Explanation
```
U¬°(·πÅŒ£d
 ¬°(       Iterate the following function on the input:
     d       Split the number into digits
   ·πÅŒ£        Map each digit to its triangular number, then sum the results
U         Take the results of iteration until before the first repeated one
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~6~~ 5 bytes
```
Œî=SLO
```
[Try it online!](https://tio.run/##MzBNTDJM/f//3BTbYB////8tTC2NDIxMAQ "05AB1E ‚Äì Try It Online") Edit: Saved 1 byte thanks to @Emigna. Explanation:
```
Œî       Repeat until value doesn't change
 =      Print current value
  S     Split into characters
   L    Turn each character into range from 1 to N
    O   Sum
```
[Answer]
# J, ~~20~~ 19 bytes
```
(1#.2!1+,.&.":)^:a:
```
[Try it online!](https://tio.run/##jZDLCsIwEEX3fsVVQRrUkJlkmgf4K4KIRdz4/6uYVFsVtHoXAwdyuJO55Nxhp9HQUvOc1hu90ouk9umQZqfj@Yqmg2eFR7apECzBgwNshBCoBTPKIDiQAY2iyKsoAms@vvPhrSCgdX93tGTV0y30jxRsHP5UpEqIBk7AAiq6h3UTOtWoQe8JRZSpRolsuL9HbbxTUf23m8QhqgojwZkfW@Z8Aw)
Outputs the original number, too.
# Explanation
```
(1#.2!1+,.&.":)^:a:
               ^:a:  Apply until input converges, storing all results in an array
(1#.2!1+,.&.":)      Digitangular sum
        ,.&.":         Split to digits
          &.":           Convert to string, apply left function, then undo conversion
        ,.               Ravel items (make array of singleton arrays of items)
                         This ensures that when cast back to integers, the digits are split.
      1+               Add 1 to each
    2!                 Compute (n choose 2) on each (nth triangular number)
 1#.                   Sum (debase 1)
```
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), ~~23~~ ~~20~~ 17 bytes
*3 bytes saved thanks to @ngn*
```
{‚çµ‚à™‚ç®+/‚àä‚ç≥¬®‚çé¬®‚çï‚äÉ‚çµ}‚ç£‚â°
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///P@1R24TqR71bH3WsetS7Qlv/UUfXo97Nh1Y86u0DEVMfdTUDZWsf9S5@1LkQqFzByJgrTcHcCEgYmQIJM0MQ3xIGAA)
**How?**
`‚çµ‚à™‚ç®` - prepend current array to the
`+/` - sum of
`‚àä` - flattened
`‚ç≥¬®` - ranges of each
`‚çé¬®‚çï` - digit of the
`‚äÉ‚çµ` - previous value
`‚ç£‚â°` until convergence. The usage of `‚à™` (union) makes sure after the first 1 is joined, the next will be excluded due to set uniqueness, and the array will converge.
[Answer]
## Haskell, ~~51~~ ~~47~~ 46 bytes
```
f 1=[1]
f x=x:f(sum$do d<-show x;[1..read[d]])
```
[Try it online!](https://tio.run/##NcHRCsIgFADQ977iPvSwwU26ik0rP6EvEAnBycbmNmaRf2/00DmDz1M/z7VGIGPJHSIUU66xye90DCuE@ykP6wfKzRJje@@DDc61NflxAQPJb48nNNs@Li9gsQXLBXYcpcRO4YUEKqE50g8qqfmZS9R/rn4B "Haskell ‚Äì Try It Online")
```
f 1=[1]                     -- if x == 1, return the singleton list [1]
f x=                        -- else
         do d<-show x       --  for each char 'd' in the string representation of x
                            --    (using the list monad)
           [1..read[d]]     --  make a list of [1..d]
                            --    (the list monad concatenates all those lists into a single list)
        sum                 --  sum those numbers
      f                     --  call f on it
    x:                      --  and put x in front of it 
```
Edit: @H.PWiz saved a byte. Thanks!
[Answer]
# [Python 2](https://docs.python.org/2/), 62 bytes
```
f=lambda x:x<2and[1]or[x]+f(sum(-~int(i)*int(i)/2for i in`x`))
```
[Try it online!](https://tio.run/##NY1BCsIwFET3PcVfJhrR/FJtij1JCLRSg4E2LU2EuPHq8av0bYaZgZnlFR@zx5xtO/bTbeghNemKvR@0NPOqk9lbFp4TO7ydj8zx3V@OaOcVHDjfpY7zHO8hBmhBYyngggKqirQWcJYU1KWiSH4hUyk8IdVqwxTFtga/oaYAYlnpCyy95Q8 "Python 2 ‚Äì Try It Online")
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~43~~ 41 bytes
```
Echo@#>1&&#0[#.(#+1)/2&@IntegerDigits@#]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n1aaZ/vfNTkj30HZzlBNTdkgWllPQ1nbUFPfSM3BM68kNT21yCUzPbOk2EE5Vg2kPNrM0Dj2PwA "Wolfram Language (Mathematica) ‚Äì Try It Online")
## How it works
The expression `#.(#+1)/2&@IntegerDigits@#` gives the digitangular counterpart of `#`. We `Echo` the input, use short-circuit evaluation with `&&` to stop if we've reached `1`, and otherwise recurse on the digitangular counterpart.
---
*-2 bytes thanks to Martin Ender for the `.` trick: we don't have to use `Tr` to sum the digits if we replace the multiplication `#(#+1)/2` by the dot product `#.(#+1)/2`.*
[Answer]
## [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~49~~ ~~42~~ 39 bytes
*Thanks to Misha Lavrov for saving 3 bytes.*
```
#//.x_:>(y=IntegerDigits@Echo@x).++y/2&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78H1CUmVcSHaum4KCloPFfWV9fryLeyk6j0tYzryQ1PbXIJTM9s6TYwTU5I9@hQlNPQ1u7UlPfSO2/poK@g0K1kbGOgrmRjoKpKZC20FEwMwQKWBhbAoUMQQDIMbU0MjACSlvCQO1/AA "Wolfram Language (Mathematica) ‚Äì Try It Online") (TIO needs parentheses around the `++y` for some reason. In my local Mathematica installation it works without them, as it should.)
Prints each value on its own line, preceded by `>>`, and includes the starting number.
[Answer]
# [Ohm v2](https://github.com/nickbclifford/Ohm), ~~9~~ 7 bytes
```
¬∑Œ©}#Œ£Œ£u
```
[Try it online!](https://tio.run/##y8/INfr//9D2cytrlc8tPre49P9/cyMA "Ohm v2 ‚Äì Try It Online")
**Explanation**
```
          Implicit input as a string
¬∑Œ©        Evaluate until the result has already been seen, pushing intermediate results
  }       Split digits
   #      Range from 0 to N
    Œ£Œ£    Sum
      u   Convert to string
```
[Answer]
## [Retina](https://github.com/m-ender/retina), 21 bytes
```
;{:G`
.
$*1¬∂
1
$%`1
1
```
[Try it online!](https://tio.run/##K0otycxL/G@tquGe8N@62so9gUuPS0XL8NA2LkMuFdUEQy7D//@NjLnMjbhMTbnMLbjMDI25LIwtjbgMQYDLwtTSyMDIlMsSBgA "Retina ‚Äì Try It Online") (The outputs of the individual cases aren't well separated, but each output ends with a `1`.)
Prints each number on its own line, in order, including the starting number.
### Explanation
```
;{:G`
```
This is just some configuration of the program. `{` makes the program loop until it fails to change the result (which happens once we get to `1`), `:` prints number before each iteration, and `;` prevents the final result from being printed twice at the end of the program. The `G` is just my usual way of creating a no-op stage.
```
.
$*1¬∂
```
Convert each digit to unary and put it on its own line.
```
1
$%`1
```
Compute the triangular number on each line, by replacing each `1` with its prefix. We could also use `M!&`1+` here, which gives us all suffixes of each line.
```
1
```
Count all `1`s, which sums up all the triangular numbers and converts the result back to decimal.
[Answer]
# Ruby, ~~60 47~~ 42 bytes
-13 bytes by @JustinMariner
-5 bytes by @GB
```
->x{p x=x.digits.sum{|k|k*-~k/2}while x>1}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf166iukChwrZCLyUzPbOkWK@4NLe6JrsmW0u3LlvfqLY8IzMnVaHCzrD2f1q0maFx7H8A)
[Answer]
# [Befunge-93](https://github.com/catseye/Befunge-93), 51 bytes
```
p&>>:25*%:1+*2/v
  |:/*52p00+g00<
00<vp000_@#-1.::g
```
[Try it online!](https://tio.run/##S0pNK81LT/3/v0DNzs7KyFRL1cpQW8tIv4xLQaHGSl/L1KjAwEA73cDAhguIy4Acg3gHZV1DPSur9P//LYwtjQA "Befunge-93 ‚Äì Try It Online")
James Holderness cleverly reshaped my progarm into a 51-byte form. Thanks!
[Answer]
# [Pushy](https://github.com/FTcode/Pushy), ~~24~~ ~~22~~ ~~21~~ 17 bytes
```
[sL:R{;Svc^#&1=?i
```
**[Try it online!](https://tio.run/##Kygtzqj8/z@62McqqNo6uCw5TlnN0NY@8////5YwAAA "Pushy ‚Äì Try It Online")**
## Explanation
```
[sL:R{;Svc^#&1=?i
[           &1=?i   \ Loop until result == 1:
 s                  \   Split last result into digits
  L:  ;             \   For each digit n:
    R{              \       Push the range (1, n) inclusive
       S            \   Sum the ranges
        vc^         \   Delete all stack items, except the sum
           #        \   Print result
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~19~~ ~~17~~ 10 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
Doesn't include the input as the first element.
```
√Ü=√¨ c√≤ x√É√¢
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=xj3sIGPyIHjD4g&input=NjEzCi1R)
```
√Ü=√¨ c√≤ x√É√¢     :Implicit input of integer U
√Ü              :Map the range [0,U)
 =             :  Reassign to U
  √¨            :  Convert to digit array
    c          :  Flat map
     √≤         :    Range [0,digit]
       x       :  Reduce by addition
        √É      :End map
         √¢     :Deduplicate
```
[Answer]
# [R](https://www.r-project.org/), 70 bytes
```
f=function(n)"if"(n-1,c(n,f((d=n%/%10^(nchar(n):0)%%10)%*%(d+1)/2)),n)
```
[Try it online!](https://tio.run/##DcpBCoAgEAXQuwgD88tQC1oEXiUIZcjNBFLnn9w@XjeTLJ@Wtz3KCtfEsS7JF1YvzDUrBUrxZC331cc4ImgAaCKuc0JYAa8w4T1tsB8 "R ‚Äì Try It Online")
Returns the original value as well.
# [R](https://www.r-project.org/), 80 bytes
```
function(n){o={}
while(n-1){n=(d=n%/%10^(nchar(n):0)%%10)%*%(d+1)/2
o=c(o,n)}
o}
```
[Try it online!](https://tio.run/##DcpBCoAgEADAu6/osrBbiVnQIfIrQWhSELsQRQfx7dZ1mKvEatYlPuzvQxiZkriU1bsf54asLSV2GByDAdstyH5fr39NHcEPBDVgaCyZXonzKC1TVpJLxNEOVD4 "R ‚Äì Try It Online")
Does not return the original value.
[Answer]
# [Lua](https://www.lua.org), 91 bytes
```
function f(n)x=0 for d in((0|n)..""):gmatch"."do x=x+d*(d+1)/2 end print(x)c=x==1or f(x)end
```
[Try it online!](https://tio.run/##DcvRCsMgDEDRXwk@JSs4KxS2QT6mmNoJWxzFQh76787Hy@F@zrX3fGpqpSpkVDIOkOsBAkURw6XkvXP02r9rS2/nnVQwtkluKNNM9wibCvyOog2NEhvzPPY8YkDP@FieMcSF@h8 "Lua ‚Äì Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~20~~ 12 bytes
*Saved 2 bytes thanks to [caird coinheringaahing](https://codegolf.stackexchange.com/users/66833/caird-coinheringaahing)*
```
ŒîD,√æ‚Ç¨iLO}O}}
```
[Try it online!](https://tio.run/##MzBNTDJM/f//3BQXncP7HjWtyfTxr/Wvrf3/38LU0sjAyBQA "05AB1E ‚Äì Try It Online")
## Explanation
(old version)
```
Œî√æ‚Ç¨iD>*;}OD1‚Ä∫iD,}}1,  Main program
Œî                }    Repeat until there is no changes
 √æ                    Push digits of the input number
  ‚Ç¨i    }             Apply for each digit
    D>*;              Calculate the triangular number for given digit
         O            Sum all numbers
          D1‚Ä∫iD,}     Print if greater than 1
                  1,  Print 1 at the end
```
[Answer]
# JavaScript, ~~61~~ 57 bytes
```
f=a=>a-1?([...a+[]].map(b=>a+=b++*b/2,a=0),a)+' '+f(a):''
```
[Try it online!](https://tio.run/##RYzLDoIwEEX3foW7zlioUIKCSeVDkMWUh8EoJYD6@bUuoHd1cueeedCH5nrqxyUcTNNa2ylSVwrjAkohBPGyqsSLRtCu5UpzftBHGZCKMCDkbM94B4QXxuzT3BU42S3HydTtPIt5acx7Ed@pX1qAkpwXV2VUFew2MOcg14gQ4c650IFMcMWz3DBNfZtteIr9OEtyP4//8ac0l5H0H/I1iPYH "JavaScript (Node.js) ‚Äì Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 69 bytes
```
def f(x):
 while x>1:
  x=sum(-~int(z)*int(z)/2for z in`x`)
  print x
```
[Try it online!](https://tio.run/##K6gsycjPM/r/PyU1TSFNo0LTikuhPCMzJ1Whws4QyFaosC0uzdXQrcvMK9Go0tSCUPpGaflFClUKmXkJFQmaQFUFRUAJhYr/aRoWxpZGmv8B "Python 2 ‚Äì Try It Online")
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 18 bytes
```
Ôº∑‚äñÔº©Œ∏¬´‚âîÔº©Œ£‚≠ÜŒ∏Œ£‚Ä¶¬∑0Œ∫Œ∏Œ∏‚∏ø
```
[Try it online!](https://tio.run/##S85ILErOT8z5/788IzMnVUHDJTW5KDU3Na8kNUXDObG4RKNQU1NToZqL07G4ODM9DyIWXJqrEVxSlJmX7ptYoFGoowAS8MxLziktzixLDUrMS0/VUDJQ0lHI1gQBHYVCTWsuzgCgBpB5cKZSTJESkFf7/7@FqaWRgZHpf92yHAA "Charcoal ‚Äì Try It Online") Link is to verbose version of code. Explanation:
```
   Œ∏                Input
  Ôº©                 Cast to integer
 ‚äñ                  Decrement
Ôº∑   ¬´               Loop while not zero
         Œ∏          Current value
        ‚≠Ü           Map over characters and concatenate
             0      Literal character 0
              Œ∫     Current character
           ‚Ä¶¬∑       Inclusive range
          Œ£         Concatenate
       Œ£            Sum of digits
      Ôº©             Cast to string
     ‚âî         Œ∏    Assign back to value
                Œ∏   Output latest value
                 ‚∏ø  Move to start of next line
```
[Answer]
# [dc](https://www.gnu.org/software/bc/manual/dc-1.05/html_mono/dc.html), 62 bytes
```
?sj[0soljZ1-[dljr10r^/10%d1+*2/lo+sod1-r0<i]dsixlopdsj1<b]dsbx
```
[Try it online!](https://tio.run/##S0n@/9@@OCvaoDg/JyvKUDc6JSeryNCgKE7f0EA1xVBby0g/J1@7OD/FULfIwCYzNqU4syInvyClOMvQJgnIS6r4/9/M0BgA "dc ‚Äì Try It Online")
[Answer]
# [k](https://en.wikipedia.org/wiki/K_(programming_language)), 19 bytes
```
{+/(+/1+!"I"$)'$x}\
```
Unsurprisingly works similarly to the already posted APL and J solutions
```
               $x    cast x (implicit var of lambda) to string
   (         )'      apply composition (function train) to each character of string
    +/1+!"I"$        cast character to number, create list from 1 to n, sum it
 +/                  sum triangular numbers
{                }\  iterate lambda until result converges, appending each result
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 7 bytes
```
DRFS¬µ√êƒø
```
[Try it online!](https://tio.run/##y0rNyan8/98lyC340NbDE47s////v5ExAA "Jelly ‚Äì Try It Online")
* `DRFS¬µ√êƒø`: Full program / monadic link.
* `√êƒø`: Loop until results are no longer unique (if something other than 1 would occur twice, then the given input does not have a defined result, since it would never reach 1).
* `D`: Convert from integer to decimal.
* `R`: Range (1-indexed). Vectorizes.
* `F`: Flatten and `S`: Sum (`¬µ` just creates a new monadic chain)
[Answer]
# dc, 31 bytes
```
[[I~d1+*2/rd0<m+]dsmxpd1<f]dsfx
```
The function `m` computes the digitangular function of its input; `f` repeats this until the result reaches 1.
Note that we use the input radix to extract digits - this means it will work in any base system, not only decimal.
## Demo
```
for i in 23 72 55 78 613 8392 11111 8592025 999999999
    do echo $i '=>' $(dc -e $i'[[I~d1+*2/rd0<m+]dsmxpd1<f]dsfx')
done
```
```
23 => 9 45 25 18 37 34 16 22 6 21 4 10 1
72 => 31 7 28 39 51 16 22 6 21 4 10 1
55 => 30 6 21 4 10 1
78 => 64 31 7 28 39 51 16 22 6 21 4 10 1
613 => 28 39 51 16 22 6 21 4 10 1
8392 => 90 45 25 18 37 34 16 22 6 21 4 10 1
11111 => 5 15 16 22 6 21 4 10 1
8592025 => 117 30 6 21 4 10 1
999999999 => 405 25 18 37 34 16 22 6 21 4 10 1
```
[Answer]
# [Python 2](https://docs.python.org/2/), 76 bytes
```
f=lambda k,s=0:k+s<2and[1]or[k]*(s<1)+f(*[k/10,s,s+k%10*(k%10+1)/2][k<1::2])
```
[Try it online!](https://tio.run/##NYxBCoMwFET3nuJvCokGzP9iq0FPErKw2NCQNorJpqdPY6FvMcPMwOyf9NwC5Wzn1/K@rwt4EWepfBMnWsKq0WyH9qZmcULeWFZr36IUUcTGX1DW7NQGeUtG@wmVIsNzesQUYQZNnYAbCej74oOAK5Zi6MZS4UkJ/UiSyjz@MVVltwMcuAC/I1VBYT9cSGCZ4/kL "Python 2 ‚Äì Try It Online")
[Answer]
# [Neim](https://github.com/okx-code/Neim), 8 bytes
```
ÕªùêÇtùïïùê¨D√∑D
```
Explanation:
```
Õª             Start infinite loop
 ùêÇ            Split top of stack into each of its characters
  t           Push infinite list of triangular numbers
   ùïï          For each of the characters, get the nth element in the above list.
    ùê¨          Sum.
     D         Duplicate.
      √∑        If top of stack is equal to 1, break.
       D       Duplicate.
               Implicitly print all elements in the stack, concatenated.
```
[Try it online!](https://tio.run/##y0vNzP3//@zuD3MnNJV8mDt1KpCxxuXwdpf//80MjQE "Neim ‚Äì Try It Online")
[Formatted output](https://tio.run/##y0vNzP3//@zuD3MnNJV8mDt1KpCxxuXwdpf/mir/zQyNAQ "Neim ‚Äì Try It Online")
[Answer]
# [D](https://dlang.org/), 140 bytes
```
import std.algorithm,std.range,std.conv,std.stdio;void f(T)(T n){n=n.text.map!(u=>u.to!T-48+(u.to!T-48).iota.sum).sum;n.writeln;if(n-1)n.f;}
```
[Try it online!](https://tio.run/##PY1LCoNAEETX8RTjrpvEhnwWgcGcwgsM0TEDTrdoawLBs0/URRZVvLepqlMKsZdBzag1ua6VIegrnjYbHLfNTk/heYc1QewsoTYeKoTKMH65ZNLmoxRdn8NUPiZSyavidj/CH5GCqKNxiriVZXqvT03HNnjg4oxM3i5pn44uMKD5ZgcPlyvabEk/ "D ‚Äì Try It Online")
[Answer]
# PHP, 71+1 bytes
```
for(;1<$n="$s"?:$argn;print$s._)for($i=$s=0;$p--||~$p=$n[$i++];)$s+=$p;
```
Run as pipe with `-nR` or [try it online](http://sandbox.onlinephpfunctions.com/code/a743695711e6a1cdcb65b6a2b1b973c59ec27d67). (requires PHP 5.3 or later for the Elvis operator)
[Answer]
# [Add++](https://github.com/cairdcoinheringaahing/AddPlusPlus), 32 bytes
```
D,f,@,EDBFEREss
+?
y:1
W!,$f>x,O
```
[Try it online!](https://tio.run/##S0xJKSj4/99FJ03HQcfVxcnNNci1uJhL256r0sqQK1xRRyXNrkLH/////2aGxgA "Add++ ‚Äì Try It Online")
Doesn't output the first value
## How it works
```
D,f,@,   - Create a monadic function, f.
         - Example argument: [613]
      ED - Digits;   STACK = [[6 1 3]]
      BF - Flatten;  STACK = [6 1 3]
      ER - Range;    STACK = [[1 2 3 4 5 6] [1] [1 2 3]]
      Es - Sum each; STACK = [21 1 6]
      s  - Sum;      STACK = [28]
           f calculates n's digitangular counterpart
+?       - Take input;     x = 613; y = 0
y:1      - Set y to 1;     x = 613; y = 1
W!,      - While x != y...
   $f>x, -   Call f;       x =  28; y = 1
   O     -   Print x;
```
[Answer]
# [Perl 6](http://perl6.org/), 36 bytes
```
{$_,{sum map {sum 1..$_},.comb}...1}
```
[Try it online!](https://tio.run/##NcnBCoQgFEbhV/kJaSWX8YqlzNSriA3jaqQoZhHiszsV9K0OnOWzfruadrQRQ83Cy7z9ElJYcIUiEr5Ies9pKkSkSt3CjkZ4DCNyxHEbxHnFizV6hjHoLTqlYbVjqBOscfxgA3cbn/UP "Perl 6 ‚Äì Try It Online")
Includes the input number in the output list.
]