Triangular numbers: Difference between revisions
Content added Content deleted
(J) |
m (→{{header|J}}: arrange "first 30" results in shorter rows) |
||
Line 81: | Line 81: | ||
<syntaxhighlight lang=J> tri=: [!+ |
<syntaxhighlight lang=J> tri=: [!+ |
||
2 tri i. |
2 tri 1+i.5 6 |
||
3 6 10 15 21 28 |
|||
1 3 6 10 15 21 28 36 45 55 66 78 91 105 120 136 153 171 190 210 231 253 276 300 325 351 378 406 435 465 |
|||
36 45 55 66 78 91 |
|||
105 120 136 153 171 190 |
|||
1 4 10 20 35 56 84 120 165 220 286 364 455 560 680 816 969 1140 1330 1540 1771 2024 2300 2600 2925 3276 3654 4060 4495 4960 |
|||
210 231 253 276 300 325 |
|||
⚫ | |||
351 378 406 435 465 496 |
|||
1 5 15 35 70 126 210 330 495 715 1001 1365 1820 2380 3060 3876 4845 5985 7315 8855 10626 12650 14950 17550 20475 23751 27405 31465 35960 40920 |
|||
3 tri 1+i.5 6 |
|||
4 10 20 35 56 84 |
|||
1 13 91 455 1820 6188 18564 50388 125970 293930 646646 1352078 2704156 5200300 9657700 17383860 30421755 51895935 86493225 141120525 225792840 354817320 548354040 834451800 1251677700 1852482996 2707475148 3910797436 5586853480 7898654920 |
|||
120 165 220 286 364 455 |
|||
</syntaxhighlight> |
|||
560 680 816 969 1140 1330 |
|||
1540 1771 2024 2300 2600 2925 |
|||
3276 3654 4060 4495 4960 5456 |
|||
⚫ | |||
5 15 35 70 126 210 |
|||
330 495 715 1001 1365 1820 |
|||
2380 3060 3876 4845 5985 7315 |
|||
8855 10626 12650 14950 17550 20475 |
|||
23751 27405 31465 35960 40920 46376 |
|||
12 tri 1+i.10 3 |
|||
13 91 455 |
|||
1820 6188 18564 |
|||
50388 125970 293930 |
|||
646646 1352078 2704156 |
|||
5200300 9657700 17383860 |
|||
30421755 51895935 86493225 |
|||
141120525 225792840 354817320 |
|||
548354040 834451800 1251677700 |
|||
1852482996 2707475148 3910797436 |
|||
5586853480 7898654920 11058116888</syntaxhighlight> |
|||
And, for the roots: |
And, for the roots: |
||
Line 105: | Line 125: | ||
5.39361e6 44356.2 4321 |
5.39361e6 44356.2 4321 |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
=={{header|Julia}}== |
=={{header|Julia}}== |