Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,22 @@
use strict;
use warnings;
use feature 'say';
sub generate_mc {
my($max) = @_;
my $index = 0;
my $test = 1;
my %sums = (2 => 1);
my @mc = 1;
while ($test++) {
my %these = %sums;
map { next if ++$these{$_ + $test} > 1 } @mc[0..$index], $test;
%sums = %these;
$index++;
return @mc if (push @mc, $test) > $max-1;
}
}
my @mian_chowla = generate_mc(100);
say "First 30 terms in the MianChowla sequence:\n", join(' ', @mian_chowla[ 0..29]),
"\nTerms 91 through 100:\n", join(' ', @mian_chowla[90..99]);