From fe5f85a0913b16129fd528a9f43472c3012bd2de Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Tue, 7 Jun 2022 18:18:31 +0100 Subject: - Added guest contribution by Robert DiCicco. --- challenge-168/robert-dicicco/julia/ch-2.jl | 45 ++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 challenge-168/robert-dicicco/julia/ch-2.jl 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) -- cgit