O'Halloran numbers: Difference between revisions

Content added Content deleted
m (→‎{{header|J}}: slightly cleaner)
Line 63: Line 63:
=={{header|J}}==
=={{header|J}}==
<syntaxhighlight lang=J> require'stats'
<syntaxhighlight lang=J> require'stats'
2*(3}.i.501)-.+/1 */\.(|:3 comb 502)-i:1
2*(3}.i.501)-.+/1 */\.(|:3 comb 42)-i:1
8 12 20 36 44 60 84 116 140 156 204 260 380 420 660 924</syntaxhighlight>
8 12 20 36 44 60 84 116 140 156 204 260 380 420 660 924</syntaxhighlight>


Here, we use [[Combinations_with_repetitions#J|combinations with repetitions]] to generate the various cuboid side lengths. Then we multiply all three pairs of these side length combinations and sum the pairs. Then we remove these sums from the sequence 3..500, and finally we multiply the remaining 16 values by 2.
Here, we use [[Combinations_with_repetitions#J|combinations with repetitions]] to generate the various relevant cuboid side lengths. Then we multiply all three pairs of these side length combinations and sum the pairs. Then we remove these sums from the sequence 3..500, and finally we multiply the remaining 16 values by 2.


=={{header|Julia}}==
=={{header|Julia}}==