Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
least_divisor_function [2014/02/22 02:24]
nikolaj
least_divisor_function [2015/04/25 18:19]
nikolaj
Line 2: Line 2:
 ==== Function ==== ==== Function ====
  
-| @#FFBB00: $ \mathrm{ld}:​\mathbb N^+\to\{1\}\cup\mathrm{Prime\ number} ​ $ | +| @#FFBB00: definiendum ​| @#FFBB00: $ \mathrm{ld}:​\mathbb N^+\to\{1\}\cup\mathrm{Prime\ number} ​ $ | 
-| @#FFBB00: $ \mathrm{ld}(n):​=\mathrm{min}\left(\mathrm{divisors}(n)\right) ​ $ |+| @#FFBB00: definiendum ​| @#FFBB00: $ \mathrm{ld}(n):​=\mathrm{min}\left(\mathrm{divisors}(n)\right) ​ $ |
  
 ==== Discussion ==== ==== Discussion ====
 === Code === === Code ===
 +<code haskell>
 +divides :: Integral a => a -> a -> Bool
 +divides d n = rem n d == 0
 +</​code>​
 +
 <code haskell> <code haskell>
 ld :: Integral a => a -> a ld :: Integral a => a -> a
Line 15: Line 20:
       | k^2 > n     = n       | k^2 > n     = n
  | otherwise ​  = ldf (k+1) n  | otherwise ​  = ldf (k+1) n
 +</​code>​
 +
 +[[Set of divisors function]]:
 +<code haskell>
 +divides :: Integral a => a -> a -> Bool
 +divides d n = rem n d == 0
 </​code>​ </​code>​
 === Theorems === === Theorems ===
Link to graph
Log In
Improvements of the human condition