Amicable pairs: Difference between revisions

Content deleted Content added
Wherrera (talk | contribs)
m Julia version 1.0+ update
Wherrera (talk | contribs)
Line 2,364: Line 2,364:


'''Functions'''
'''Functions'''
<lang Julia>using Memoize, Primes, Printf
<lang Julia>using Primes, Printf


@memoize function pcontrib(p::Int64, a::Int64)
function pcontrib(p::Int64, a::Int64)
n = one(p)
n = one(p)
pcon = one(p)
pcon = one(p)
Line 2,376: Line 2,376:
end
end


@memoize function divisorsum(n::Int64)
function divisorsum(n::Int64)
dsum = one(n)
dsum = one(n)
for (p, a) in factor(n)
for (p, a) in factor(n)