From 278ed0eb1397c82b293f5c28fefbc449588ee678 Mon Sep 17 00:00:00 2001 From: Luis Mochan Date: Wed, 12 Jan 2022 09:40:14 -0600 Subject: Remove unneeded quotes --- challenge-147/wlmb/perl/ch-1.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenge-147/wlmb/perl/ch-1.pl b/challenge-147/wlmb/perl/ch-1.pl index 1fa2fbebe8..b2842052a4 100755 --- a/challenge-147/wlmb/perl/ch-1.pl +++ b/challenge-147/wlmb/perl/ch-1.pl @@ -7,7 +7,7 @@ use v5.12; use warnings; use PDL; use PDL::NiceSlice; -use POSIX qw(); # don't import to avoid name collisions with PDL +use POSIX (); # don't import to avoid name collisions with PDL use Text::Wrap qw(wrap $columns $break); die "Usage: ./ch-1.pl size_of_sieve number_of_truncatable_primes [base]\n" -- cgit From b6ae9e152d2745837702f9c9ee3e701f499d5f8e Mon Sep 17 00:00:00 2001 From: Luis Mochan Date: Wed, 12 Jan 2022 09:40:52 -0600 Subject: Change bigint to integer, and use explicit floor --- challenge-147/wlmb/perl/ch-2.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/challenge-147/wlmb/perl/ch-2.pl b/challenge-147/wlmb/perl/ch-2.pl index 88eecdda76..f2edfb1a85 100755 --- a/challenge-147/wlmb/perl/ch-2.pl +++ b/challenge-147/wlmb/perl/ch-2.pl @@ -5,12 +5,13 @@ # See https://wlmb.github.io/2022/01/10/PWC147/#task-2-pentagon-numbers use v5.12; use warnings; -use bigint; +use POSIX qw(floor); use Time::HiRes qw(time); die "Usage: ./ch-2.pl largest_index\n" unless @ARGV==1; my $N=shift; my $start=time(); +use integer; J: foreach my $j(2..$N){ my $p=$j*(3*$j-1)/2; @@ -21,10 +22,12 @@ J: last J if pentagonal($q+$p) && pentagonal($p-$q); } } +no integer; # don't truncate time say "Time: ", time()-$start; +use integer; sub pentagonal { my $p=24*shift()+1; - my $s=sqrt($p); + my $s=floor(sqrt($p)); return $s**2==$p && $s%6==5; } sub index_of { -- cgit From 2fde38fca4f71b4bd317284a52890f23af915417 Mon Sep 17 00:00:00 2001 From: Luis Mochan Date: Wed, 12 Jan 2022 09:41:24 -0600 Subject: Remove unneeded check --- challenge-147/wlmb/perl/ch-2a.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/challenge-147/wlmb/perl/ch-2a.pl b/challenge-147/wlmb/perl/ch-2a.pl index 038b9630d3..5dca4ebda9 100755 --- a/challenge-147/wlmb/perl/ch-2a.pl +++ b/challenge-147/wlmb/perl/ch-2a.pl @@ -14,8 +14,7 @@ my $N=shift; my $start=time(); my $n=zeroes(long, $N)->xvals+1; my $p=$n*(3*$n-1)/2; -my $check=pentagonal($p); -for my $i (2..$p->nelem){ +for my $i (1..$p->nelem){ my $pi=$p(($i-1)); my $pass=which(pentagonal($pi+$p) & pentagonal($pi-$p)); next unless $pass->nelem; -- cgit From 29a459894b7cbb34cd15139d513722fb08358166 Mon Sep 17 00:00:00 2001 From: Luis Mochan Date: Wed, 12 Jan 2022 09:41:48 -0600 Subject: Remove unneeded check --- challenge-147/wlmb/perl/ch-2b.pl | 1 - 1 file changed, 1 deletion(-) diff --git a/challenge-147/wlmb/perl/ch-2b.pl b/challenge-147/wlmb/perl/ch-2b.pl index c029154bc9..320dfedddc 100755 --- a/challenge-147/wlmb/perl/ch-2b.pl +++ b/challenge-147/wlmb/perl/ch-2b.pl @@ -14,7 +14,6 @@ my $N=shift; my $start=time(); my $n=zeroes(long, $N)->xvals+1; my $p=$n*(3*$n-1)/2; -my $check=pentagonal($p); my $pass=whichND(pentagonal($p+$p(*1)) & pentagonal($p-$p(*1))); die "No solution found. Try to increase the largest_index" unless $pass->dim(1)>0; my $ij=$pass(:,(0))+1; -- cgit From c0172138d989c46446d47a9e9303cb3594773fcf Mon Sep 17 00:00:00 2001 From: Flavio Poletti Date: Wed, 12 Jan 2022 20:52:01 +0100 Subject: Add polettix's solution to challenge-147 --- challenge-147/polettix/blog.txt | 1 + challenge-147/polettix/blog1.txt | 1 + challenge-147/polettix/perl/ch-1.pl | 40 +++++++++++++++++++ challenge-147/polettix/perl/ch-2.pl | 74 +++++++++++++++++++++++++++++++++++ challenge-147/polettix/raku/ch-1.raku | 54 +++++++++++++++++++++++++ challenge-147/polettix/raku/ch-2.raku | 51 ++++++++++++++++++++++++ 6 files changed, 221 insertions(+) create mode 100644 challenge-147/polettix/blog.txt create mode 100644 challenge-147/polettix/blog1.txt create mode 100644 challenge-147/polettix/perl/ch-1.pl create mode 100644 challenge-147/polettix/perl/ch-2.pl create mode 100644 challenge-147/polettix/raku/ch-1.raku create mode 100644 challenge-147/polettix/raku/ch-2.raku diff --git a/challenge-147/polettix/blog.txt b/challenge-147/polettix/blog.txt new file mode 100644 index 0000000000..4ad8c79ae3 --- /dev/null +++ b/challenge-147/polettix/blog.txt @@ -0,0 +1 @@ +https://github.polettix.it/ETOOBUSY/2022/01/12/pwc147-truncatable-prime/ diff --git a/challenge-147/polettix/blog1.txt b/challenge-147/polettix/blog1.txt new file mode 100644 index 0000000000..8cd6bee5f9 --- /dev/null +++ b/challenge-147/polettix/blog1.txt @@ -0,0 +1 @@ +https://github.polettix.it/ETOOBUSY/2022/01/13/pwc147-pentagon-numbers/ diff --git a/challenge-147/polettix/perl/ch-1.pl b/challenge-147/polettix/perl/ch-1.pl new file mode 100644 index 0000000000..61db33f1f5 --- /dev/null +++ b/challenge-147/polettix/perl/ch-1.pl @@ -0,0 +1,40 @@ +#!/usr/bin/env perl +use v5.24; +use warnings; +use experimental 'signatures'; +no warnings 'experimental::signatures'; + +say nth_left_truncatable($_) for 1 .. shift // 20; + +sub nth_left_truncatable ($nth) { + state $cache = [ grep { is_prime($_) && is_prime(substr $_, 1) } 10 .. 99 ]; + state $prefix = 1; + state $first_id = 0; + state $next_first_id = $cache->@*; + state $id = $first_id; + while ($cache->@* < $nth) { + my $candidate = $prefix . $cache->[$id++]; + push $cache->@*, $candidate if is_prime($candidate); + if (length($candidate) == length($cache->[$id])) { # toppled over! + if ($prefix < 9) { + ++$prefix; + } + else { + $prefix = 1; + ($first_id, $next_first_id) = ($next_first_id, $id); + } + $id = $first_id; # just reset the cursor + } + } + return $cache->[$nth - 1]; +} + +sub is_prime { # https://en.wikipedia.org/wiki/Primality_test + return if $_[0] < 2; + return 1 if $_[0] <= 3; + return unless ($_[0] % 2) && ($_[0] % 3); + for (my $i = 6 - 1; $i * $i <= $_[0]; $i += 6) { + return unless ($_[0] % $i) && ($_[0] % ($i + 2)); + } + return 1; +} diff --git a/challenge-147/polettix/perl/ch-2.pl b/challenge-147/polettix/perl/ch-2.pl new file mode 100644 index 0000000000..f895123c24 --- /dev/null +++ b/challenge-147/polettix/perl/ch-2.pl @@ -0,0 +1,74 @@ +#!/usr/bin/env perl +use v5.24; +use warnings; +use experimental 'signatures'; +no warnings 'experimental::signatures'; + +$|++; +my ($delta, $X, $Y, $sum) = lowest_difference_superpentagonals(); +say ''; +my @n = map { invert_pentagonal($_) } ($delta, $X, $Y, $sum); + +say "delta<$delta> ($n[0])"; +say " X<$X> ($n[1])"; +say " Y<$Y> ($n[2])"; +say " sum<$sum> ($n[3])"; + +say " Y - X - delta = @{[$Y - $X - $delta]}"; +say " Y + X - sum = @{[$Y + $X - $sum]}"; + +# +# X < Y are our candidates. +# delta = Y - X --> Y = X + delta +# sum = Y + X --> sum = 2X + delta +# +sub lowest_difference_superpentagonals { + my ($delta, $n_delta) = (0, 0); + my @upper; + while ('necessary') { + $delta += 3 * $n_delta++ + 1; # we have to find the minimum delta + print "\r$n_delta ($delta)"; + return @upper if @upper && $upper[0] <= $delta; + + # X = P(n_X) and P(n_X + 1) - X = 3 * n_X + 1 + # + # This means that delta MUST be greater than 3 * n_X + 1, otherwise + # it will not "allow" X to reach any of the following pentagonal + # number. This means: + # + # delta >= 3 * n_X + 1 => n_X <= (delta - 1) / 3 + my $max_n_X = int(($delta - 1) / 3); + + # X *might* be less than delta, of course, but we will check this + # on the way, so we will only consider values of X greater than that + my $X = $delta; + for my $n_X ($n_delta + 1 .. $max_n_X) { + $X += 3 * $n_X - 2; + my $Y = $X + $delta; # this does not change inverting roles + invert_pentagonal($Y) or next; + + # now let's consider delta < X --> $sum = $Y + $X + my $sum = $Y + $X; + return ($delta, $X, $Y, $sum) if invert_pentagonal($sum); + + # now let's consider X < delta and swap their roles... + $sum = $Y + $delta; + if (my $n_sum = invert_pentagonal($sum)) { + + # we just record that we have an upper limit for delta here, + # but still there might be some better delta in between + @upper = ($X, $delta, $Y, $sum) + if !@upper || $X < $upper[0]; + + say " current candidate @upper"; + } + } + } +} + +sub invert_pentagonal ($P) { + my $root = int sqrt(my $maybe_square = 1 + 24 * $P); + return unless $root * $root == $maybe_square; + return if ++$root % 6; + return $root / 6; +} diff --git a/challenge-147/polettix/raku/ch-1.raku b/challenge-147/polettix/raku/ch-1.raku new file mode 100644 index 0000000000..95499efd49 --- /dev/null +++ b/challenge-147/polettix/raku/ch-1.raku @@ -0,0 +1,54 @@ +#!/usr/bin/env raku +use v6; + +sub MAIN (Int:D $n = 20, :$exclusive = False) { + $exclusive ?? exclusive($n) !! constructive($n); +} + + +sub constructive ($n) { put nth-left-truncatable($_) for 1 .. $n } + +sub nth-left-truncatable ($nth) { + state @cache = (10..99).grep({ .is-prime && .substr(1, 1).is-prime }); + state $prefix = 1; + state $first-id = 0; + state $next-first-id = @cache.elems; + state $id = $first-id; + while @cache < $nth { # find moar! + my $candidate = ($prefix ~ @cache[$id++]).Int; + @cache.push($candidate) if $candidate.is-prime; + if $candidate.chars == @cache[$id].chars { # toppled over! + if $prefix < 9 { + ++$prefix; + } + else { + $prefix = 1; + ($first-id, $next-first-id) = ($next-first-id, $id); + } + $id = $first-id; # just reset the cursor + } + } + return @cache[$nth - 1]; +} + + +sub exclusive (Int:D $n is copy = 20) { + my $i = 9; + while $n > 0 { + next unless is-left-truncatable($i = $i + 2); + $i.put; + --$n; + } +} + +sub is-left-truncatable ($n) { + return False if $n < 10 || $n ~~ /0/; + return False unless $n.is-prime; + state %cache; + if %cache{$n}:!exists { + my $truncated = $n.substr(1); + return $truncated.is-prime if $truncated < 10; + %cache{$n} = is-left-truncatable($truncated); + } + return %cache{$n}; +} diff --git a/challenge-147/polettix/raku/ch-2.raku b/challenge-147/polettix/raku/ch-2.raku new file mode 100644 index 0000000000..4e71985319 --- /dev/null +++ b/challenge-147/polettix/raku/ch-2.raku @@ -0,0 +1,51 @@ +#!/usr/bin/env raku +use v6; +sub MAIN { + my ($delta, $X, $Y, $sum) = lowest-difference-superpentagonals(); + put ''; + my @n = ($delta, $X, $Y, $sum).map: { invert-pentagonal($_) }; + + put "delta<$delta> ({@n[0]})"; + put " X<$X> ({@n[1]})"; + put " Y<$Y> ({@n[2]})"; + put " sum<$sum> ({@n[3]})"; + + put " Y - X - delta = {$Y - $X - $delta}"; + put " Y + X - sum = {$Y + $X - $sum}"; +} + +sub lowest-difference-superpentagonals { + my ($delta, $n-delta) = 0, 0; + $n-delta = 1018; + $delta = $n-delta * (3 * $n-delta - 1) / 2; + my @upper; + loop { + $delta += 3 * $n-delta++ + 1; + print "\r$n-delta ($delta)"; + return @upper if @upper && @upper[0] <= $delta; + + my $max-n-X = (($delta - 1) / 3).Int; + my $X = $delta; + for $n-delta ^.. $max-n-X -> $n-X { + $X += 3 * $n-X - 2; + my $Y = $X + $delta; + invert-pentagonal($Y) or next; + + my $sum = $Y + $X; + return [$delta, $X, $Y, $sum] if invert-pentagonal($sum); + + $sum = $Y + $delta; + next unless invert-pentagonal($sum); + @upper = $X, $delta, $Y, $sum if (! @upper) || $X < @upper[0]; + put " current candidate {@upper}"; + } + } +} + +sub invert-pentagonal ($P) { + my $maybe-square = 1 + 24 * $P; + my $root = $maybe-square.sqrt.Int; + return unless $root * $root == $maybe-square; + return unless ++$root %% 6; + return $root / 6; +} -- cgit From 348e48485b23491bcf8ddec618b06bc09d133d4b Mon Sep 17 00:00:00 2001 From: "E. Choroba" Date: Wed, 12 Jan 2022 22:40:05 +0100 Subject: Solve 147: Truncatable Prime & Pentagon Numbers by E. Choroba --- challenge-147/e-choroba/perl/ch-1.pl | 58 ++++++++++++++++++++++++++++++++++++ challenge-147/e-choroba/perl/ch-2.pl | 32 ++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100755 challenge-147/e-choroba/perl/ch-1.pl create mode 100755 challenge-147/e-choroba/perl/ch-2.pl diff --git a/challenge-147/e-choroba/perl/ch-1.pl b/challenge-147/e-choroba/perl/ch-1.pl new file mode 100755 index 0000000000..699dec8487 --- /dev/null +++ b/challenge-147/e-choroba/perl/ch-1.pl @@ -0,0 +1,58 @@ +#!/usr/bin/perl +use warnings; +use strict; +use feature qw{ say }; + +use constant SIZE => 20; + +my @primes = (2, 3); +my %primes; +@primes{@primes} = (); +sub add_primes { + my ($top) = @_; + CANDIDATE: + for (my $candidate = $primes[-1] + 2; + $candidate <= $top; + $candidate += 2 + ) { + for my $prime (@primes) { + next CANDIDATE if 0 == $candidate % $prime; + last if $prime * $prime > $candidate; + } + push @primes, $candidate; + undef $primes{$candidate}; + } +} + +sub left_truncatable_primes { + my ($should_include_single_digit) = @_; + my $candidate = $should_include_single_digit ? 2 : 11; + my $step = $candidate % 2 + 1; + + my @left_truncatable; + CANDIDATE: + while (@left_truncatable < SIZE) { + add_primes($candidate); + if (exists $primes{$candidate}) { + next CANDIDATE unless -1 == index $candidate, '0'; + + for my $l (1 .. length($candidate) - 1) { + next CANDIDATE unless exists $primes{substr $candidate, $l} + } + push @left_truncatable, $candidate; + } + } continue { + $candidate += $step; + $step = 2; + } + return @left_truncatable +} + +for my $include_single_digit (1, 0) { + my @left_truncatable = left_truncatable_primes($include_single_digit); + + # Wikipedia includes single digit primes, Project Euler excludes them. + say +("don't ", "")[$include_single_digit], 'include single digit: '; + + say join ', ', @left_truncatable; +} diff --git a/challenge-147/e-choroba/perl/ch-2.pl b/challenge-147/e-choroba/perl/ch-2.pl new file mode 100755 index 0000000000..b1db853039 --- /dev/null +++ b/challenge-147/e-choroba/perl/ch-2.pl @@ -0,0 +1,32 @@ +#!/usr/bin/perl +use warnings; +use strict; +use feature qw{ say }; + +my @pentagon_numbers; +my %pentagon_numbers; +{ my $last = 0; + sub add_pentagon_number { + ++$last; + push @pentagon_numbers, $last * (3 * $last - 1) / 2; + undef $pentagon_numbers{ $pentagon_numbers[-1] }; + return $pentagon_numbers[-1] + } +} + +sub pentagon_numbers { + while (1) { + my $sum = add_pentagon_number(); + for my $p1 (@pentagon_numbers) { + last if $p1 * 2 > $sum; + + my $p2 = $sum - $p1; + next unless exists $pentagon_numbers{$p2} + && exists $pentagon_numbers{$p2 - $p1}; + + return $p1, $p2 + } + } +} + +say join ' ', pentagon_numbers(); -- cgit From cf5faf46272ecba05f23c25b07100fed810d8fa4 Mon Sep 17 00:00:00 2001 From: Conor Hoekstra Date: Wed, 12 Jan 2022 21:25:36 -0500 Subject: Week 147 solutions in APL --- challenge-147/conor-hoekstra/apl/ch-1.apl | 5 +++++ challenge-147/conor-hoekstra/apl/ch-2.apl | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 challenge-147/conor-hoekstra/apl/ch-1.apl create mode 100644 challenge-147/conor-hoekstra/apl/ch-2.apl diff --git a/challenge-147/conor-hoekstra/apl/ch-1.apl b/challenge-147/conor-hoekstra/apl/ch-1.apl new file mode 100644 index 0000000000..7048c0a180 --- /dev/null +++ b/challenge-147/conor-hoekstra/apl/ch-1.apl @@ -0,0 +1,5 @@ +isPrime ← 2≥(≢∘∪⍳∨⊢) +∊{⍵/⍨∧/isPrime∘⍎¨,\⍕⍵}¨⍳135 + +⍝ Output +1 2 3 5 7 11 13 17 19 23 29 31 37 53 59 71 73 79 113 131 diff --git a/challenge-147/conor-hoekstra/apl/ch-2.apl b/challenge-147/conor-hoekstra/apl/ch-2.apl new file mode 100644 index 0000000000..33d4f1f43d --- /dev/null +++ b/challenge-147/conor-hoekstra/apl/ch-2.apl @@ -0,0 +1,6 @@ +pentagon ← {2÷⍨⍵ׯ1+3×⍵} +isPentagon ← {(⌊=⊢){⍵/⍨0<⍵}6÷⍨1(+,-).5*⍨1+24×⍵} +p10000 ← pentagon ⍳10000 +is ← ⍸⊃∘.(+∧⍥isPentagon|∘-)⍨p10000 + +is⌷p10000 ⍝ 1560090 7042750 -- cgit From 383fe407f81a60e0e65d1672837c0a4c230b9ed0 Mon Sep 17 00:00:00 2001 From: Matthew Neleigh Date: Thu, 13 Jan 2022 03:17:25 -0500 Subject: new file: challenge-147/mattneleigh/perl/ch-1.pl new file: challenge-147/mattneleigh/perl/ch-2.pl --- challenge-147/mattneleigh/perl/ch-1.pl | 164 +++++++++++++++++++++++++++++++++ challenge-147/mattneleigh/perl/ch-2.pl | 112 ++++++++++++++++++++++ 2 files changed, 276 insertions(+) create mode 100755 challenge-147/mattneleigh/perl/ch-1.pl create mode 100755 challenge-147/mattneleigh/perl/ch-2.pl diff --git a/challenge-147/mattneleigh/perl/ch-1.pl b/challenge-147/mattneleigh/perl/ch-1.pl new file mode 100755 index 0000000000..dc4a5e2f18 --- /dev/null +++ b/challenge-147/mattneleigh/perl/ch-1.pl @@ -0,0 +1,164 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use English; + +################################################################################ +# Begin main execution +################################################################################ + +my $n = 20; +my @trunc_primes = calculate_left_truncatable_primes(20, 0); + +printf( + "\nThe first %d left-truncatable primes are: %s\n\n", + scalar(@trunc_primes), + join(", ", @trunc_primes) +); + +exit(0); +################################################################################ +# End main execution; subroutines follow +################################################################################ + + + +################################################################################ +# Calculate the first N left-truncatable prime numbers (see +# https://en.wikipedia.org/wiki/Truncatable_prime ) +# Takes two arguments: +# * The number N of left truncatable prime numbers desired +# * The maximum number to examine when calculating primes to evaluate for left- +# truncatability; if this argument is undefined or less than one, a default +# of 1000 will be used +# Returns on success: +# * A list of left-truncatable primes +# NOTE: If the maximum value to search (see arguments above) is too small to +# produce N left-truncatable primes, the list will have fewer than N members +# Returns on error: +# * undef if N is less than 1 +################################################################################ +sub calculate_left_truncatable_primes{ + my $n = int(shift()); + my $max = int(shift()); + + return(undef) + if($n < 1); + + if(!defined($max) || ($max < 1)){ + $max = 1000; + } + + my $primes = sieve_of_eratosthenes($max, 1); + my $i = 2; + my @trunc_primes; + + while((scalar(@trunc_primes) < $n) && ($i <= $max)){ + my $numstr = $i; + + unless($numstr =~ m/0/){ + # The number doesn't contain zero... + + # loop while $numstr is nonzero + # length and is prime + while(length($numstr) && (substr($$primes, $numstr, 1) eq "1")){ + if(length($numstr) == 1){ + # Got down to one digit and it's + # prime; $i was a left-truncable + # prime + push(@trunc_primes, $i); + } + + # Trim the string + $numstr = substr($numstr, 1); + } + } + + $i++; + } + + return(@trunc_primes); + +} + + + +################################################################################ +# Use the Sieve of Eratosthenes to find a quantity of prime numbers +# Takes one required argument and one optional argument: +# * A positive integer N (e.g. 20) +# * An optional value that, if present and evaluates as true, will instruct +# this function to return a stringified table of prime and non-prime values +# (see below) +# Returns on success: +# * A list of all prime numbers less than or equal to N (e.g. (2, 3, 5, 7, 11, +# 13, 17, 19)) if the second argument is missing or false +# -- OR -- +# * A ref to a string of ones and zeros representing a table of prime and +# non-prime numbers, respectively, from 0 to N, inclusive (e.g. +# $$ref == "001101010001010001010") if the second argument is present and +# true; this is used internally for sieving primes, and it may be of use to +# the caller if N is large, as it will take up far less memory than an array +# of the actual values +# Returns on error: +# * undef if N is not a positive integer +################################################################################ +sub sieve_of_eratosthenes{ + use POSIX; + + my $n = int(shift()); + my $return_table = shift(); + + return(undef) + unless($n > 0); + + my $max = floor(sqrt($n)); + my $i; + my $j; + my $k; + my $table; + my @primes; + + # Initialize the table to contain + # (mostly...) true values + $table = "00" . "1" x ($n - 1); + + # Loop over $i not exceeding the square + # root of $n + for($i = 2; $i <= $max; $i++){ + # If the $i'th cell is true, we haven't + # examined the multiples of $i yet + if(substr($table, $i, 1) eq "1"){ + $k = 0; + # Assignment in expression is deliberate + while(($j = $i ** 2 + $k++ * $i) <= $n){ + # $j is not prime; set its cell in the + # table to false + substr($table, $j, 1) = "0"; + } + } + } + + if($return_table){ + # Hand a ref to the completed table + # back to the caller + return(\$table); + + } else{ + # Build a list of indices for which + # the corresponding members of the + # table are true + for($i = 2; $i <= $n; $i++){ + push(@primes, $i) + if(substr($table, $i, 1) eq "1"); + } + + return(@primes); + + } + +} + + + diff --git a/challenge-147/mattneleigh/perl/ch-2.pl b/challenge-147/mattneleigh/perl/ch-2.pl new file mode 100755 index 0000000000..867ef0e56a --- /dev/null +++ b/challenge-147/mattneleigh/perl/ch-2.pl @@ -0,0 +1,112 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use English; + +################################################################################ +# Begin main execution +################################################################################ + +my $n = 2500; +my $i; +my $j; +my @pentagonal_list = (); +my %pentagonal_table = (); +my $done = 0; + +# Since we'll be dealing with sums, +# calculate twice the quantity of +# Pentagonal Numbers as the range we'll be +# scanning... +$i = 1; +for($i=1; $i<=($n * 2); $i++){ + # Store the Pentagonal Numbers from 1 to + # $n in a list, and do the same from 1 + # to $n * 2 in a hash to make a reverse + # lookup table + my $P = P($i); + + if($i <= $n){ + $pentagonal_list[$i] = $P; + } + $pentagonal_table{$P} = $i; +} + +for($i=1; $i<$n; $i++){ + for($j=$i+1; $j<=$n; $j++){ + if( + # If the sum is a Pentagonal + # Number... + $pentagonal_table{ + $pentagonal_list[$i] + $pentagonal_list[$j] + } + + # AND... + && + + # the difference is a Pentagonal + # Number... + $pentagonal_table{ + abs($pentagonal_list[$i] - $pentagonal_list[$j]) + } + ){ + # ...then we're done + $done = 1; + } + last if($done); + } + last if($done); +} + +# Uh oh... +if(!$done){ + warn("Qualifying Pentagonal Numbers not found with \$n = $n\n"); + exit(1); +} + +print("\nThe first two qualifying Pentagonal Numbers are:\n"); +printf( + "P(%d) + P(%d) = %d + %d = %d = P(%d)\n", + $i, $j, + $pentagonal_list[$i], $pentagonal_list[$j], + $pentagonal_list[$i] + $pentagonal_list[$j], + $pentagonal_table{$pentagonal_list[$i] + $pentagonal_list[$j]} +); +printf( + "P(%d) - P(%d) = |%d - %d| = %d = P(%d)\n\n", + $i, $j, + $pentagonal_list[$i], $pentagonal_list[$j], + abs($pentagonal_list[$i] - $pentagonal_list[$j]), + $pentagonal_table{abs($pentagonal_list[$i] - $pentagonal_list[$j])} +); + +exit(0); +################################################################################ +# End main execution; subroutines follow +################################################################################ + + + +################################################################################ +# Calculate the Nth Pentagonal Number (see +# https://en.wikipedia.org/wiki/Pentagonal_number ) +# Takes one argument: +# * The number N +# Returns on success: +# * The Nth Pentagonal Number +# Returns on error: +# * Undef if N is not 1 or larger +################################################################################ +sub P{ + my $n = int(shift()); + + return(undef) + if($n < 1); + + return($n * (3 * $n - 1) / 2); + +} + + + -- cgit From 52af0310f2a5236efe473139f6349a63d032c34b Mon Sep 17 00:00:00 2001 From: Matthew Neleigh Date: Thu, 13 Jan 2022 03:22:05 -0500 Subject: modified: challenge-147/mattneleigh/perl/ch-2.pl --- challenge-147/mattneleigh/perl/ch-2.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenge-147/mattneleigh/perl/ch-2.pl b/challenge-147/mattneleigh/perl/ch-2.pl index 867ef0e56a..b4ef6c6b05 100755 --- a/challenge-147/mattneleigh/perl/ch-2.pl +++ b/challenge-147/mattneleigh/perl/ch-2.pl @@ -60,7 +60,7 @@ for($i=1; $i<$n; $i++){ } # Uh oh... -if(!$done){ +unless($done){ warn("Qualifying Pentagonal Numbers not found with \$n = $n\n"); exit(1); } -- cgit From c2713a3b64e57e84181576dcbf37700b29e8ff65 Mon Sep 17 00:00:00 2001 From: E7-87-83 Date: Thu, 13 Jan 2022 16:37:08 +0800 Subject: CY's challenge: Task 1 in 10 languages; Progress: Day 1 Afternoon --- challenge-147/cheok-yin-fung/README.md | 13 ++++++ challenge-147/cheok-yin-fung/julia/ch-1.jl | 67 ++++++++++++++++++++++++++++++ challenge-147/cheok-yin-fung/perl/ch-1.pl | 60 ++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 challenge-147/cheok-yin-fung/README.md create mode 100644 challenge-147/cheok-yin-fung/julia/ch-1.jl create mode 100644 challenge-147/cheok-yin-fung/perl/ch-1.pl diff --git a/challenge-147/cheok-yin-fung/README.md b/challenge-147/cheok-yin-fung/README.md new file mode 100644 index 0000000000..fb4db4e925 --- /dev/null +++ b/challenge-147/cheok-yin-fung/README.md @@ -0,0 +1,13 @@ +This is the beginning of the semester of my PG dip in IT; and I have finished all exams and assignments from the previous semester. Somehow today I want to try to play with programming languages. While Mohammad has said, having fun is important in learning, now I try to do the Task 1 in different programming languages which I am fluent at least at the "sightseeing purpose", within 4 days. + +Target list: +awk bash C++ +Java Node.js Julia +LISP PHP Perl Smalltalk +Befunge-93 (if I have that mentality) + +Script done (last update: Thursday, January 13, 2022 08:34:23 UTC): +1. Julia +2. Perl + + diff --git a/challenge-147/cheok-yin-fung/julia/ch-1.jl b/challenge-147/cheok-yin-fung/julia/ch-1.jl new file mode 100644 index 0000000000..166fd13389 --- /dev/null +++ b/challenge-147/cheok-yin-fung/julia/ch-1.jl @@ -0,0 +1,67 @@ +# The Weekly Challenge 147 +# Task 1 Truncatable Prime +# Thursday, January 13, 2022 PM03:18:00 + + +left_trun_primes = [2, 3, 5, 7] +primes = [2, 3, 5, 7] +index_ltp = [1, 5] + + + +lastelement(array) = array[length(array)] +x_no_less_than_sqrt_y(x, y) = x ≤ √y + + +function grep(func, array) + ans = [] + for variable in array + if func(variable) + push!(ans, variable) + end + end + return Tuple(ans) +end + + +function is_prime(int) + no_less_than_sqrt(x) = x_no_less_than_sqrt_y(x, int) + relatively_small_primes = grep(no_less_than_sqrt , primes) + for p in relatively_small_primes + if int % p == 0 + return false + end + end + return true +end + + +function append_arr_of_ltp(digits) + k = 0 + for d = 1:9 + for ind = index_ltp[digits-1]:(index_ltp[digits]-1) + new_num = parse(Int64, string(d) * string(left_trun_primes[ind])) + if is_prime(new_num) + push!(left_trun_primes, new_num) + k += 1 + end + end + end + push!(index_ltp, lastelement(index_ltp) + k + 1) +end + + +function append_arr_of_primes(min,max) + for num = min:max + if is_prime(num) + push!(primes, num) + end + end +end + + + +append_arr_of_ltp(2) +append_arr_of_primes(10,sqrt(999)) +append_arr_of_ltp(3) +println(left_trun_primes[1:20]) diff --git a/challenge-147/cheok-yin-fung/perl/ch-1.pl b/challenge-147/cheok-yin-fung/perl/ch-1.pl new file mode 100644 index 0000000000..ff93203336 --- /dev/null +++ b/challenge-147/cheok-yin-fung/perl/ch-1.pl @@ -0,0 +1,60 @@ +# The Weekly Challenge 147 +# Task 1 Truncatable Prime +# Thursday, January 13, 2022 PM04:18:51 HKT + +use v5.12.0; +use warnings; + +my @ltp = (); +my @recent_ltp = (2,3,5,7); +my @new_ltp = (); + +my @prime = (2,3,5,7); + +sub is_prime { + my $t = $_[0]; + for (my $k = 0; defined($prime[$k]) && $prime[$k] <= sqrt($t) ;$k++) { + return 0 if $t % $prime[$k] == 0; + } + return 1; +} + + + +sub append_arr_of_primes { + my $max = $_[0]; + my @relatively_small_primes = grep { $_ <= sqrt($max) } @prime; + HERE: for my $can ($relatively_small_primes[-1]+1..$max) { + for my $p (@relatively_small_primes) { + next HERE if $can % $p == 0 + } + push @prime, $can; + } +} + + + +sub append_arr_of_ltp { + my $target_size = $_[0]; + if ($target_size <= (scalar @ltp + scalar @recent_ltp)) { + push @ltp, @recent_ltp; + return; + } + for my $d (1..9) { + for my $num (@recent_ltp) { + my $new_num = $d . $num; + push @new_ltp, $new_num if is_prime($new_num); + } + } + push @ltp, @recent_ltp; + @recent_ltp = @new_ltp; + @new_ltp = (); + append_arr_of_ltp($target_size); +} + + + +append_arr_of_primes(1000); +append_arr_of_ltp(20); +say $_ for @ltp[0..19]; + -- cgit From 415b77f3f489715d7888de8794affe9afe8d1ffb Mon Sep 17 00:00:00 2001 From: E7-87-83 Date: Thu, 13 Jan 2022 16:38:23 +0800 Subject: Purpose --- challenge-147/cheok-yin-fung/README | 13 +++++++++++++ challenge-147/cheok-yin-fung/README.md | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 challenge-147/cheok-yin-fung/README delete mode 100644 challenge-147/cheok-yin-fung/README.md diff --git a/challenge-147/cheok-yin-fung/README b/challenge-147/cheok-yin-fung/README new file mode 100644 index 0000000000..fb4db4e925 --- /dev/null +++ b/challenge-147/cheok-yin-fung/README @@ -0,0 +1,13 @@ +This is the beginning of the semester of my PG dip in IT; and I have finished all exams and assignments from the previous semester. Somehow today I want to try to play with programming languages. While Mohammad has said, having fun is important in learning, now I try to do the Task 1 in different programming languages which I am fluent at least at the "sightseeing purpose", within 4 days. + +Target list: +awk bash C++ +Java Node.js Julia +LISP PHP Perl Smalltalk +Befunge-93 (if I have that mentality) + +Script done (last update: Thursday, January 13, 2022 08:34:23 UTC): +1. Julia +2. Perl + + diff --git a/challenge-147/cheok-yin-fung/README.md b/challenge-147/cheok-yin-fung/README.md deleted file mode 100644 index fb4db4e925..0000000000 --- a/challenge-147/cheok-yin-fung/README.md +++ /dev/null @@ -1,13 +0,0 @@ -This is the beginning of the semester of my PG dip in IT; and I have finished all exams and assignments from the previous semester. Somehow today I want to try to play with programming languages. While Mohammad has said, having fun is important in learning, now I try to do the Task 1 in different programming languages which I am fluent at least at the "sightseeing purpose", within 4 days. - -Target list: -awk bash C++ -Java Node.js Julia -LISP PHP Perl Smalltalk -Befunge-93 (if I have that mentality) - -Script done (last update: Thursday, January 13, 2022 08:34:23 UTC): -1. Julia -2. Perl - - -- cgit From 1ce263c8f221f47a046997b665845dbe5680ed9e Mon Sep 17 00:00:00 2001 From: E7-87-83 Date: Thu, 13 Jan 2022 16:54:59 +0800 Subject: - --- challenge-147/cheok-yin-fung/README | 1 + 1 file changed, 1 insertion(+) create mode 100644 challenge-147/cheok-yin-fung/README diff --git a/challenge-147/cheok-yin-fung/README b/challenge-147/cheok-yin-fung/README new file mode 100644 index 0000000000..05c1883e53 --- /dev/null +++ b/challenge-147/cheok-yin-fung/README @@ -0,0 +1 @@ + Solutions by Cheok-Yin Fung. -- cgit From 70b4929f9c722f9b6a7e7566201e96c6df12fe25 Mon Sep 17 00:00:00 2001 From: E7-87-83 Date: Thu, 13 Jan 2022 17:35:47 +0800 Subject: typo --- challenge-068/cheok-yin-fung/smalltalk/ch-2.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenge-068/cheok-yin-fung/smalltalk/ch-2.st b/challenge-068/cheok-yin-fung/smalltalk/ch-2.st index f4010ea6b6..e8e7c12787 100644 --- a/challenge-068/cheok-yin-fung/smalltalk/ch-2.st +++ b/challenge-068/cheok-yin-fung/smalltalk/ch-2.st @@ -4,7 +4,7 @@ "Usage: gst -S ch-2.st" "written on 30th Jan 2021" "Smalltalk has built-in Linked List, -here is reventing the wheel." +here is reinventing the wheel." Object subclass: Node [ -- cgit From b356d5e48a115cbb5cd6cfa398cb637a9d63a30e Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Thu, 13 Jan 2022 10:08:36 +0000 Subject: - Added solutions by E. Choroba. --- stats/pwc-current.json | 239 ++-- stats/pwc-language-breakdown-summary.json | 66 +- stats/pwc-language-breakdown.json | 2080 ++++++++++++++--------------- stats/pwc-leaders.json | 742 +++++----- stats/pwc-summary-1-30.json | 94 +- stats/pwc-summary-121-150.json | 36 +- stats/pwc-summary-151-180.json | 92 +- stats/pwc-summary-181-210.json | 114 +- stats/pwc-summary-211-240.json | 42 +- stats/pwc-summary-241-270.json | 66 +- stats/pwc-summary-31-60.json | 48 +- stats/pwc-summary-61-90.json | 116 +- stats/pwc-summary-91-120.json | 42 +- stats/pwc-summary.json | 34 +- 14 files changed, 1913 insertions(+), 1898 deletions(-) diff --git a/stats/pwc-current.json b/stats/pwc-current.json index f162294167..c0987b08a2 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,91 +1,9 @@ { - "chart" : { - "type" : "column" - }, - "series" : [ - { - "data" : [ - { - "name" : "Alexander Karelas", - "drilldown" : "Alexander Karelas", - "y" : 1 - }, - { - "y" : 3, - "drilldown" : "Dave Jacoby", - "name" : "Dave Jacoby" - }, - { - "drilldown" : "James Smith", - "name" : "James Smith", - "y" : 3 - }, - { - "name" : "Luca Ferrari", - "drilldown" : "Luca Ferrari", - "y" : 7 - }, - { - "y" : 2, - "name" : "Mark Anderson", - "drilldown" : "Mark Anderson" - }, - { - "y" : 2, - "drilldown" : "Mohammad S Anwar", - "name" : "Mohammad S Anwar" - }, - { - "y" : 2, - "name" : "Niels van Dijke", - "drilldown" : "Niels van Dijke" - }, - { - "y" : 3, - "name" : "Peter Campbell Smith", - "drilldown" : "Peter Campbell Smith" - }, - { - "y" : 5, - "name" : "Roger Bell_West", - "drilldown" : "Roger Bell_West" - }, - { - "y" : 2, - "name" : "Simon Proctor", - "drilldown" : "Simon Proctor" - }, - { - "y" : 2, - "drilldown" : "Ulrich Rieke", - "name" : "Ulrich Rieke" - }, - { - "name" : "W. Luis Mochan", - "drilldown" : "W. Luis Mochan", - "y" : 3 - } - ], - "colorByPoint" : 1, - "name" : "The Weekly Challenge - 147" - } - ], - "legend" : { - "enabled" : 0 - }, - "subtitle" : { - "text" : "[Champions: 12] Last updated at 2022-01-12 14:16:56 GMT" - }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, "drilldown" : { "series" : [ { - "id" : "Alexander Karelas", "name" : "Alexander Karelas", + "id" : "Alexander Karelas", "data" : [ [ "Perl", @@ -95,7 +13,6 @@ }, { "id" : "Dave Jacoby", - "name" : "Dave Jacoby", "data" : [ [ "Perl", @@ -105,6 +22,17 @@ "Blog", 1 ] + ], + "name" : "Dave Jacoby" + }, + { + "name" : "E. Choroba", + "id" : "E. Choroba", + "data" : [ + [ + "Perl", + 2 + ] ] }, { @@ -118,12 +46,12 @@ 1 ] ], - "name" : "James Smith", - "id" : "James Smith" + "id" : "James Smith", + "name" : "James Smith" }, { - "id" : "Luca Ferrari", "name" : "Luca Ferrari", + "id" : "Luca Ferrari", "data" : [ [ "Raku", @@ -136,8 +64,8 @@ ] }, { - "id" : "Mark Anderson", "name" : "Mark Anderson", + "id" : "Mark Anderson", "data" : [ [ "Raku", @@ -146,8 +74,6 @@ ] }, { - "id" : "Mohammad S Anwar", - "name" : "Mohammad S Anwar", "data" : [ [ "Perl", @@ -157,21 +83,21 @@ "Raku", 1 ] - ] + ], + "id" : "Mohammad S Anwar", + "name" : "Mohammad S Anwar" }, { - "id" : "Niels van Dijke", - "name" : "Niels van Dijke", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "Niels van Dijke", + "name" : "Niels van Dijke" }, { - "name" : "Peter Campbell Smith", - "id" : "Peter Campbell Smith", "data" : [ [ "Perl", @@ -181,9 +107,12 @@ "Blog", 1 ] - ] + ], + "id" : "Peter Campbell Smith", + "name" : "Peter Campbell Smith" }, { + "id" : "Roger Bell_West", "data" : [ [ "Perl", @@ -198,20 +127,21 @@ 1 ] ], - "id" : "Roger Bell_West", "name" : "Roger Bell_West" }, { + "id" : "Simon Proctor", "data" : [ [ "Raku", 2 ] ], - "id" : "Simon Proctor", "name" : "Simon Proctor" }, { + "name" : "Ulrich Rieke", + "id" : "Ulrich Rieke", "data" : [ [ "Perl", @@ -221,11 +151,10 @@ "Raku", 1 ] - ], - "id" : "Ulrich Rieke", - "name" : "Ulrich Rieke" + ] }, { + "id" : "W. Luis Mochan", "data" : [ [ "Perl", @@ -236,29 +165,115 @@ 1 ] ], - "id" : "W. Luis Mochan", "name" : "W. Luis Mochan" } ] }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "subtitle" : { + "text" : "[Champions: 13] Last updated at 2022-01-13 10:07:02 GMT" + }, "plotOptions" : { "series" : { - "borderWidth" : 0, "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - } + "enabled" : 1, + "format" : "{point.y}" + }, + "borderWidth" : 0 } }, + "tooltip" : { + "headerFormat" : "{series.name}
", + "followPointer" : 1, + "pointFormat" : "{point.name}: {point.y:f}
" + }, + "legend" : { + "enabled" : 0 + }, + "chart" : { + "type" : "column" + }, "title" : { "text" : "The Weekly Challenge - 147" }, + "series" : [ + { + "name" : "The Weekly Challenge - 147", + "colorByPoint" : 1, + "data" : [ + { + "name" : "Alexander Karelas", + "y" : 1, + "drilldown" : "Alexander Karelas" + }, + { + "y" : 3, + "drilldown" : "Dave Jacoby", + "name" : "Dave Jacoby" + }, + { + "name" : "E. Choroba", + "y" : 2, + "drilldown" : "E. Choroba" + }, + { + "y" : 3, + "drilldown" : "James Smith", + "name" : "James Smith" + }, + { + "drilldown" : "Luca Ferrari", + "y" : 7, + "name" : "Luca Ferrari" + }, + { + "drilldown" : "Mark Anderson", + "y" : 2, + "name" : "Mark Anderson" + }, + { + "drilldown" : "Mohammad S Anwar", + "y" : 2, + "name" : "Mohammad S Anwar" + }, + { + "drilldown" : "Niels van Dijke", + "y" : 2, + "name" : "Niels van Dijke" + }, + { + "name" : "Peter Campbell Smith", + "drilldown" : "Peter Campbell Smith", + "y" : 3 + }, + { + "drilldown" : "Roger Bell_West", + "y" : 5, + "name" : "Roger Bell_West" + }, + { + "y" : 2, + "drilldown" : "Simon Proctor", + "name" : "Simon Proctor" + }, + { + "y" : 2, + "drilldown" : "Ulrich Rieke", + "name" : "Ulrich Rieke" + }, + { + "name" : "W. Luis Mochan", + "drilldown" : "W. Luis Mochan", + "y" : 3 + } + ] + } + ], "xAxis" : { "type" : "category" - }, - "tooltip" : { - "pointFormat" : "{point.name}: {point.y:f}
", - "headerFormat" : "{series.name}
", - "followPointer" : 1 } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 9d23194794..96b464e2cd 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,28 +1,21 @@ { - "title" : { - "text" : "The Weekly Challenge Contributions [2019 - 2021]" - }, - "tooltip" : { - "pointFormat" : "{point.y:.0f}" - }, - "xAxis" : { - "labels" : { - "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" - } - }, - "type" : "category" - }, - "legend" : { - "enabled" : "false" - }, "chart" : { "type" : "column" }, "series" : [ { - "name" : "Contributions", + "dataLabels" : { + "enabled" : "true", + "align" : "right", + "color" : "#FFFFFF", + "format" : "{point.y:.0f}", + "rotation" : -90, + "style" : { + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" + }, + "y" : 10 + }, "data" : [ [ "Blog", @@ -30,34 +23,41 @@ ], [ "Perl", - 7072 + 7074 ], [ "Raku", 4261 ] ], - "dataLabels" : { - "color" : "#FFFFFF", - "y" : 10, - "align" : "right", - "format" : "{point.y:.0f}", - "enabled" : "true", - "rotation" : -90, - "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" - } - } + "name" : "Contributions" } ], + "title" : { + "text" : "The Weekly Challenge Contributions [2019 - 2021]" + }, + "legend" : { + "enabled" : "false" + }, "subtitle" : { - "text" : "Last updated at 2022-01-12 14:16:56 GMT" + "text" : "Last updated at 2022-01-13 10:07:02 GMT" }, "yAxis" : { "min" : 0, "title" : { "text" : null } + }, + "tooltip" : { + "pointFormat" : "{point.y:.0f}" + }, + "xAxis" : { + "type" : "category", + "labels" : { + "style" : { + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" + } + } } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 2ab259bdc2..dab0b86cbb 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,781 +1,8 @@ { - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2022-01-12 14:16:56 GMT" - }, - "series" : [ - { - "data" : [ - { - "name" : "#001", - "drilldown" : "001", - "y" : 161 - }, - { - "y" : 125, - "drilldown" : "002", - "name" : "#002" - }, - { - "y" : 83, - "drilldown" : "003", - "name" : "#003" - }, - { - "drilldown" : "004", - "name" : "#004", - "y" : 99 - }, - { - "y" : 78, - "drilldown" : "005", - "name" : "#005" - }, - { - "drilldown" : "006", - "name" : "#006", - "y" : 58 - }, - { - "drilldown" : "007", - "name" : "#007", - "y" : 64 - }, - { - "y" : 78, - "name" : "#008", - "drilldown" : "008" - }, - { - "y" : 76, - "drilldown" : "009", - "name" : "#009" - }, - { - "drilldown" : "010", - "name" : "#010", - "y" : 65 - }, - { - "y" : 85, - "drilldown" : "011", - "name" : "#011" - }, - { - "name" : "#012", - "drilldown" : "012", - "y" : 89 - }, - { - "drilldown" : "013", - "name" : "#013", - "y" : 85 - }, - { - "drilldown" : "014", - "name" : "#014", - "y" : 101 - }, - { - "y" : 99, - "drilldown" : "015", - "name" : "#015" - }, - { - "drilldown" : "016", - "name" : "#016", - "y" : 71 - }, - { - "y" : 84, - "drilldown" : "017", - "name" : "#017" - }, - { - "y" : 81, - "name" : "#018", - "drilldown" : "018" - }, - { - "drilldown" : "019", - "name" : "#019", - "y" : 103 - }, - { - "y" : 101, - "name" : "#020", - "drilldown" : "020" - }, - { - "drilldown" : "021", - "name" : "#021", - "y" : 72 - }, - { - "drilldown" : "022", - "name" : "#022", - "y" : 68 - }, - { - "name" : "#023", - "drilldown" : "023", - "y" : 97 - }, - { - "y" : 75, - "name" : "#024", - "drilldown" : "024" - }, - { - "name" : "#025", - "drilldown" : "025", - "y" : 59 - }, - { - "drilldown" : "026", - "name" : "#026", - "y" : 74 - }, - { - "y" : 62, - "name" : "#027", - "drilldown" : "027" - }, - { - "name" : "#028", - "drilldown" : "028", - "y" : 82 - }, - { - "drilldown" : "029", - "name" : "#029", - "y" : 81 - }, - { - "y" : 119, - "drilldown" : "030", - "name" : "#030" - }, - { - "y" : 91, - "drilldown" : "031", - "name" : "#031" - }, - { - "drilldown" : "032", - "name" : "#032", - "y" : 96 - }, - { - "y" : 112, - "name" : "#033", - "drilldown" : "033" - }, - { - "y" : 66, - "drilldown" : "034", - "name" : "#034" - }, - { - "drilldown" : "035", - "name" : "#035", - "y" : 66 - }, - { - "y" : 68, - "name" : "#036", - "drilldown" : "036" - }, - { - "y" : 67, - "name" : "#037", - "drilldown" : "037" - }, - { - "y" : 68, - "name" : "#038", - "drilldown" : "038" - }, - { - "y" : 62, - "drilldown" : "039", - "name" : "#039" - }, - { - "y" : 73, - "drilldown" : "040", - "name" : "#040" - }, - { - "drilldown" : "041", - "name" : "#041", - "y" : 76 - }, - { - "y" : 92, - "drilldown" : "042", - "name" : "#042" - }, - { - "y" : 68, - "drilldown" : "043", - "name" : "#043" - }, - { - "y" : 85, - "drilldown" : "044", - "name" : "#044" - }, - { - "y" : 96, - "name" : "#045", - "drilldown" : "045" - }, - { - "y" : 87, - "name" : "#046", - "drilldown" : "046" - }, - { - "drilldown" : "047", - "name" : "#047", - "y" : 84 - }, - { - "name" : "#048", - "drilldown" : "048", - "y" : 108 - }, - { - "y" : 89, - "drilldown" : "049", - "name" : "#049" - }, - { - "drilldown" : "050", - "name" : "#050", - "y" : 98 - }, - { - "name" : "#051", - "drilldown" : "051", - "y" : 89 - }, - { - "name" : "#052", - "drilldown" : "052", - "y" : 91 - }, - { - "y" : 101, - "name" : "#053", - "drilldown" : "053" - }, - { - "y" : 103, - "name" : "#054", - "drilldown" : "054" - }, - { - "name" : "#055", - "drilldown" : "055", - "y" : 88 - }, - { - "y" : 95, - "name" : "#056", - "drilldown" : "056" - }, - { - "name" : "#057", - "drilldown" : "057", - "y" : 80 - }, - { - "y" : 69, - "drilldown" : "058", - "name" : "#058" - }, - { - "y" : 89, - "name" : "#059", - "drilldown" : "059" - }, - { - "y" : 85, - "name" : "#060", - "drilldown" : "060" - }, - { - "y" : 81, - "name" : "#061", - "drilldown" : "061" - }, - { - "name" : "#062", - "drilldown" : "062", - "y" : 58 - }, - { - "y" : 89, - "name" : "#063", - "drilldown" : "063" - }, - { - "y" : 80, - "name" : "#064", - "drilldown" : "064" - }, - { - "y" : 73, - "name" : "#065", - "drilldown" : "065" - }, - { - "y" : 84, - "drilldown" : "066", - "name" : "#066" - }, - { - "y" : 90, - "drilldown" : "067", - "name" : "#067" - }, - { - "drilldown" : "068", - "name" : "#068", - "y" : 75 - }, - { - "drilldown" : "069", - "name" : "#069", - "y" : 83 - }, - { - "y" : 93, - "drilldown" : "070", - "name" : "#070" - }, - { - "drilldown" : "071", - "name" : "#071", - "y" : 78 - }, - { - "name" : "#072", - "drilldown" : "072", - "y" : 112 - }, - { - "y" : 110, - "drilldown" : "073", - "name" : "#073" - }, - { - "y" : 115, - "drilldown" : "074", - "name" : "#074" - }, - { - "drilldown" : "075", - "name" : "#075", - "y" : 115 - }, - { - "y" : 101, - "name" : "#076", - "drilldown" : "076" - }, - { - "y" : 98, - "drilldown" : "077", - "name" : "#077" - }, - { - "y" : 127, - "drilldown" : "078", - "name" : "#078" - }, - { - "drilldown" : "079", - "name" : "#079", - "y" : 122 - }, - { - "drilldown" : "080", - "name" : "#080", - "y" : 127 - }, - { - "drilldown" : "081", - "name" : "#081", - "y" : 114 - }, - { - "y" : 114, - "name" : "#082", - "drilldown" : "082" - }, - { - "y" : 127, - "drilldown" : "083", - "name" : "#083" - }, - { - "name" : "#084", - "drilldown" : "084", - "y" : 119 - }, - { - "y" : 114, - "drilldown" : "085", - "name" : "#085" - }, - { - "drilldown" : "086", - "name" : "#086", - "y" : 104 - }, - { - "name" : "#087", - "drilldown" : "087", - "y" : 101 - }, - { - "name" : "#088", - "drilldown" : "088", - "y" : 121 - }, - { - "y" : 113, - "name" : "#089", - "drilldown" : "089" - }, - { - "y" : 113, - "drilldown" : "090", - "name" : "#090" - }, - { - "y" : 108, - "name" : "#091", - "drilldown" : "091" - }, - { - "y" : 98, - "name" : "#092", - "drilldown" : "092" - }, - { - "y" : 87, - "drilldown" : "093", - "name" : "#093" - }, - { - "y" : 87, - "drilldown" : "094", - "name" : "#094" - }, - { - "y" : 108, - "drilldown" : "095", - "name" : "#095" - }, - { - "drilldown" : "096", - "name" : "#096", - "y" : 108 - }, - { - "y" : 111, - "name" : "#097", - "drilldown" : "097" - }, - { - "y" : 108, - "drilldown" : "098", - "name" : "#098" - }, - { - "y" : 97, - "drilldown" : "099", - "name" : "#099" - }, - { - "name" : "#100", - "drilldown" : "100", - "y" : 120 - }, - { - "name" : "#101", - "drilldown" : "101", - "y" : 83 - }, - { - "y" : 90, - "name" : "#102", - "drilldown" : "102" - }, - { - "drilldown" : "103", - "name" : "#103", - "y" : 79 - }, - { - "y" : 85, - "drilldown" : "104", - "name" : "#104" - }, - { - "drilldown" : "105", - "name" : "#105", - "y" : 75 - }, - { - "y" : 97, - "drilldown" : "106", - "name" : "#106" - }, - { - "drilldown" : "107", - "name" : "#107", - "y" : 90 - }, - { - "y" : 94, - "drilldown" : "108", - "name" : "#108" - }, - { - "y" : 107, - "name" : "#109", - "drilldown" : "109" - }, - { - "name" : "#110", - "drilldown" : "110", - "y" : 108 - }, - { - "drilldown" : "111", - "name" : "#111", - "y" : 91 - }, - { - "name" : "#112", - "drilldown" : "112", - "y" : 92 - }, - { - "y" : 92, - "drilldown" : "113", - "name" : "#113" - }, - { - "y" : 108, - "drilldown" : "114", - "name" : "#114" - }, - { - "y" : 96, - "name" : "#115", - "drilldown" : "115" - }, - { - "name" : "#116", - "drilldown" : "116", - "y" : 95 - }, - { - "name" : "#117", - "drilldown" : "117", - "y" : 97 - }, - { - "y" : 83, - "name" : "#118", - "drilldown" : "118" - }, - { - "name" : "#119", - "drilldown" : "119", - "y" : 125 - }, - { - "y" : 116, - "name" : "#120", - "drilldown" : "120" - }, - { - "y" : 92, - "name" : "#121", - "drilldown" : "121" - }, - { - "y" : 110, - "drilldown" : "122", - "name" : "#122" - }, - { - "y" : 105, - "name" : "#123", - "drilldown" : "123" - }, - { - "name" : "#124", - "drilldown" : "124", - "y" : 85 - }, - { - "y" : 63, - "name" : "#125", - "drilldown" : "125" - }, - { - "y" : 113, - "name" : "#126", - "drilldown" : "126" - }, - { - "name" : "#127", - "drilldown" : "127", - "y" : 110 - }, - { - "name" : "#128", - "drilldown" : "128", - "y" : 71 - }, - { - "y" : 50, - "name" : "#129", - "drilldown" : "129" - }, - { - "y" : 73, - "drilldown" : "130", - "name" : "#130" - }, - { - "drilldown" : "131", - "name" : "#131", - "y" : 91 - }, - { - "y" : 78, - "drilldown" : "132", - "name" : "#132" - }, - { - "y" : 95, - "drilldown" : "133", - "name" : "#133" - }, - { - "drilldown" : "134", - "name" : "#134", - "y" : 94 - }, - { - "drilldown" : "135", - "name" : "#135", - "y" : 10