Jump to content

Combinations with repetitions/Square digit chain: Difference between revisions

m
→‎{{header|Perl 6}}: Possibly better work-around for uninitialized warnings
m (→‎{{header|Perl 6}}: minor update to working around warnings)
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-$s]:exists or @sums[$i-$s] = 0; # ugly work around
@sums[$i] += @sums[$i-$s];
}
10,333

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.