Combinations with repetitions/Square digit chain: Difference between revisions
Combinations with repetitions/Square digit chain (view source)
Revision as of 11:12, 23 December 2018
, 5 years ago→{{header|Perl 6}}: Possibly better work-around for uninitialized warnings
m (→{{header|Perl 6}}: minor update to working around warnings) |
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: Possibly better work-around for uninitialized warnings) |
||
Line 301:
my @ks = (7, 8, 11, 14, 17);
for @ks -> $k {
my @sums is default(0) = 1,0;
my $s;
for (1 .. $k) -> $n {
Line 309:
$s = $j²;
if ($s > $i) { last };
@sums[$i] += @sums[$i-$s];
}
|