Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
16
Task/Van-Eck-sequence/Miranda/van-eck-sequence.miranda
Normal file
16
Task/Van-Eck-sequence/Miranda/van-eck-sequence.miranda
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
main :: [sys_message]
|
||||
main = [ Stdout (show list ++ "\n")
|
||||
| list <- [take 10 eck, take 10 (drop 990 eck)]
|
||||
]
|
||||
|
||||
eck :: [num]
|
||||
eck = 0 : map item [1..]
|
||||
where item n = find last (tl sofar)
|
||||
where sofar = reverse (take n eck)
|
||||
last = hd sofar
|
||||
|
||||
find :: *->[*]->num
|
||||
find i = find' 1
|
||||
where find' n [] = 0
|
||||
find' n (a:as) = n, if a = i
|
||||
= find' (n+1) as, otherwise
|
||||
Loading…
Add table
Add a link
Reference in a new issue