diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2022-06-07 18:18:31 +0100 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2022-06-07 18:18:31 +0100 |
| commit | fe5f85a0913b16129fd528a9f43472c3012bd2de (patch) | |
| tree | 9cf6b6eecb431fc2e470d2cf8de9e48d1951bea3 | |
| parent | ac32e51ae34212cd68b2cfdd8f72f54681006e29 (diff) | |
| download | perlweeklychallenge-club-fe5f85a0913b16129fd528a9f43472c3012bd2de.tar.gz perlweeklychallenge-club-fe5f85a0913b16129fd528a9f43472c3012bd2de.tar.bz2 perlweeklychallenge-club-fe5f85a0913b16129fd528a9f43472c3012bd2de.zip | |
- Added guest contribution by Robert DiCicco.
| -rw-r--r-- | challenge-168/robert-dicicco/julia/ch-2.jl | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/challenge-168/robert-dicicco/julia/ch-2.jl b/challenge-168/robert-dicicco/julia/ch-2.jl new file mode 100644 index 0000000000..e486810da1 --- /dev/null +++ b/challenge-168/robert-dicicco/julia/ch-2.jl @@ -0,0 +1,45 @@ +#!julia.exe + +# AUTHOR: Robert DiCicco +# DATE: 2022-06-07 +# Challenge 168 Home Primes ( Julia ) + +using Primes + +results = [] + +function homeprime( hp ) + + temp = [] + + s = " " + + temp = factor(Array, hp) + + for i in 1:length(temp) + + s = s * repr(temp[i]) + + end + + return(parse(Int64, s)) + +end + +hp = 8 + +flag = 1 + +push!(results,hp) + +while flag > 0 + + retval = homeprime(hp) + + push!(results,retval) + + isprime(retval) ? (global flag = 0) : (global hp = retval) + +end + +println(results) |
