Duffinian numbers: Difference between revisions
m
→{{header|FutureBasic}}
(Initial FutureBasic task solution added) |
|||
Line 694:
next
end fn = isPrime
local fn GCD( a as long, b as long ) as long
Line 702 ⟶ 701:
result = fn GCD( b mod a, a )
end fn = result
local fn SumDiv( num as NSUInteger ) as NSUInteger
Line 718 ⟶ 716:
result = sum + 1
end fn = result
local fn IsDuffinian( n as NSUInteger) as BOOL
BOOL result = NO
if ( fn IsPrime(n) == NO and fn GCD( fn SumDiv(n), n ) == 1 ) then exit fn = YES
end fn = result
local fn FindDuffinians
Line 757 ⟶ 749:
CFTimeInterval t
t = fn CACurrentMediaTime
fn FindDuffinians
Line 792 ⟶ 783:
Compute time: 2963.753 ms
</pre>
=={{header|Go}}==
|