aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-175/wambash/julia/ch-1.jl11
-rw-r--r--challenge-175/wambash/julia/ch-2.jl10
2 files changed, 21 insertions, 0 deletions
diff --git a/challenge-175/wambash/julia/ch-1.jl b/challenge-175/wambash/julia/ch-1.jl
new file mode 100644
index 0000000000..79c76f60d2
--- /dev/null
+++ b/challenge-175/wambash/julia/ch-1.jl
@@ -0,0 +1,11 @@
+using Lazy
+using Dates
+
+year = isassigned(ARGS) ? parse(Int,ARGS[1]) : 2022
+
+@>> 1:12 begin
+ map( m -> @lazy lastdayofmonth( Date(year,m)):Day(-1):Date(year,m) )
+ map( m -> filter( d -> dayofweek(d) == 7, m ) )
+ map(first)
+ foreach(println)
+end
diff --git a/challenge-175/wambash/julia/ch-2.jl b/challenge-175/wambash/julia/ch-2.jl
new file mode 100644
index 0000000000..2703b5dc7b
--- /dev/null
+++ b/challenge-175/wambash/julia/ch-2.jl
@@ -0,0 +1,10 @@
+#!/usr/bin/env julia
+
+using Primes
+using Lazy
+
+totientsum(x) = @>> x iterated(totient) takeuntil( ==(1) ) drop(1) sum
+
+k = isassigned(ARGS) ? parse(Int,ARGS[1]) : 20
+
+@>> Lazy.range(3,Inf,2) filter( x -> totientsum(x) == x) take(k) collect println