Find square difference: Difference between revisions
Content added Content deleted
(Find square difference in Tiny BASIC) |
m (→{{header|Haskell}}: Trivial edit to a trivial problem) |
||
Line 329: | Line 329: | ||
-- Or, with redundant verbosity |
-- Or, with redundant verbosity |
||
g n = |
g n = i |
||
where |
|||
Just i = succ <$> findIndex (> n) [1, 3 ..] |
|||
in succ i |
|||
⚫ | |||
main = do |
|||
print $ f 1000 |
|||
⚫ | |||
{{Out}} |
{{Out}} |
||
<pre>501 |
<pre>501 |