Skip to content

Commit

Permalink
add some pe examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ConorOBrien-Foxx committed Aug 29, 2018
1 parent a5ab960 commit 898e564
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pe/pe43.@
@@ -0,0 +1,8 @@
PE43 := (All@~`|#Primes@Size)@Behead@(N => Slices&3)

UniquePermutations := Unique@Permutations

all_pandigital := UniquePermutations[1234567890]
valid := PE43#`and#{#_ = 10} \ all_pandigital

Print[Sum[valid]]
9 changes: 9 additions & 0 deletions pe/pe46.@
@@ -0,0 +1,9 @@
OfOdd[x] := 2 * x + 1

IsSquare := Integral@Sqrt
PrimesUnder := Series&:Prime

GoldbachDecomposable[n] :=
Any[IsSquare <| Halve <| n - PrimesUnder[n]]

Print <| GenerateFirst[OfOdd, Not@GoldbachDecomposable #`and# IsComposite, 1]

0 comments on commit 898e564

Please sign in to comment.