June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -7,30 +7,29 @@ for 1 .. 1000000 -> $m {
|
|||
my $j = join '', $m.comb.sort;
|
||||
next if %seen{$j}:exists; # already tested a permutation
|
||||
%seen{$j} = '';
|
||||
my @seq := converging($m);
|
||||
my @seq = converging($m);
|
||||
my %elems;
|
||||
my $count;
|
||||
for @seq[] -> $value { last if ++%elems{$value} == 2; $count++; };
|
||||
if $longest == $count {
|
||||
@list.push($m);
|
||||
say "\b" x 20, "$count, $m"; # monitor progress
|
||||
}
|
||||
elsif $longest < $count {
|
||||
$longest = $count;
|
||||
@list = $m;
|
||||
say "\b" x 20, "$count, $m"; # monitor progress
|
||||
print "\b" x 20, "$count, $m"; # monitor progress
|
||||
}
|
||||
};
|
||||
|
||||
for @list -> $m {
|
||||
say "Seed Value(s): ", my $seeds = ~permutations($m).unique.grep( { .substr(0,1) != 0 } );
|
||||
my @seq := converging($m);
|
||||
say "\nSeed Value(s): ", my $seeds = ~permutations($m).unique.grep( { .substr(0,1) != 0 } );
|
||||
my @seq = converging($m);
|
||||
my %elems;
|
||||
my $count;
|
||||
for @seq[] -> $value { last if ++%elems{$value} == 2; $count++; };
|
||||
say "\nIterations: ", $count;
|
||||
say "\nSequence: (Only one shown per permutation group.)";
|
||||
.say for @seq[^$count], "\n";
|
||||
.say for |@seq[^$count], "\n";
|
||||
}
|
||||
|
||||
sub converging ($seed) { return $seed, -> $l { join '', map { $_.value.elems~$_.key }, $l.comb.classify({$^b}).sort: {-$^c.key} } ... * }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue