Fibonacci sequence!
1
Name:
Anonymous
2007-09-25 10:58
ID:ScErbbWX
I'll start:
0
161
Name:
Anonymous
2007-09-25 19:12
ID:Heaven
19740274219868223167
162
Name:
Anonymous
2007-09-25 19:12
ID:Heaven
31940434634990099905
163
Name:
Anonymous
2007-09-25 19:12
ID:Heaven
51680708854858323072
164
Name:
Anonymous
2007-09-25 19:12
ID:Heaven
83621143489848422977
165
Name:
Anonymous
2007-09-25 19:13
ID:Heaven
135301852344706746049
166
Name:
Anonymous
2007-09-25 19:13
ID:Heaven
218922995834555169026
167
Name:
Anonymous
2007-09-25 19:13
ID:epKq6PAw
100 FIBGET
354224848179261915075
168
Name:
Anonymous
2007-09-25 21:12
ID:y0pfxps4
Mathematicians need to GTFO of Computer Science. It's time to end the sacrilege NOW.
169
Name:
Anonymous
2007-09-25 21:22
ID:eO8bs9Cv
>>168
Lol wut? Computer Science is based on maths.
170
Name:
Anonymous
2007-09-25 21:40
ID:y0pfxps4
Computer Science is based on mathEMATICS, not on how naive mathEMATICIANS think.
171
Name:
Anonymous
2007-09-25 21:55
ID:Xoy2huGp
>>168
people who know maths keep showing up idiots like you who dont
172
Name:
Anonymous
2007-09-25 22:40
ID:y0pfxps4
>>171
'117' has marked you. [/thread]
173
Name:
Anonymous
2007-09-25 23:14
ID:gvAqmBqR
1-n:0 1 0c:[n;c;>][$@+c;1+c:]#$@+.
174
Name:
Anonymous
2007-09-26 6:40
ID:CSzKjZzu
Computer Science, which is not a science and is not really about computers, is based on cudders.
175
Name:
Anonymous
2007-09-26 16:40
ID:yI81FEQu
>>98,166
same.... person....
176
Name:
Anonymous
2007-09-26 17:03
ID:SL7SqCEI
>>174
The aim of Computer Science is the merging of the emotive sentient existence with raw power, to that of a being which is limited neither by man's intellectual capacity nor by machine's capacity to feel. Math is but a means to one of the ends where and when it finds itself useful, but it has nothing to do with the overall purpose.
177
Name:
Anonymous
2007-09-26 17:15
ID:RvvgSyj0
[@$0=$[%%\%]?~[1-\@$@+\]?%]i:
[1 0i;!]f:
178
Name:
Anonymous
2007-09-26 20:33
ID:/0XrlAMP
unsigned long int fibo(int n){
if(n>2)
return n;
else
return fibo(n-1)+fibo(n-2);
}
179
Name:
Anonymous
2007-09-26 20:38
ID:SL7SqCEI
>>178
Recursion = Slow and Stack Overflow. Building a list is what you should do instead, and return the nth element of the list as requested.
180
Name:
Anonymous
2007-09-26 20:41
ID:Heaven
function fib(n){
var p=Math.sqrt(5);
return (Math.pow(1+p,n)-Math.pow(1-p,n))/Math.pow(2,n)*p;
}
181
Name:
Anonymous
2007-09-26 20:46
ID:H9oCa7Wv
function fibonacci(num)
local s1, s2 = 0, 1
for i = 2, num do
s1, s2 = s2, s1 + s2
end
return s1
end
--O(1) VROOOM VROOOM funrolloopssaaaa
182
Name:
Anonymous
2007-09-26 20:53
ID:62QMXBDg
let fibs = 0 : 1 : [a + b | (a, b) <- zip fibs (tail fibs)]
Anything else fails.
183
Name:
Anonymous
2007-09-26 20:55
ID:Heaven
>>182
slow code is slow.
see
>>180 .
O(1) ftw.
184
Name:
Anonymous
2007-09-26 20:57
ID:62QMXBDg
>>183
Except
>>182 memoizes.
185
Name:
Anonymous
2007-09-26 21:01
ID:Heaven
>>184
that doesn't make it anywhere near as fast as
>>180 .
186
Name:
Anonymous
2007-09-27 0:48
ID:61wzrA9l
balls
balls
187
Name:
Anonymous
2007-09-27 0:51
ID:61wzrA9l
((lambda (f n)
(cond ((= n 0) 1)
((= n 1) 1)
((> n 1) (+ (f f (- n 1)) (f f (- n 2))))))
(lambda (f n)
(cond ((= n 0) 1)
((= n 1) 1)
((> n 1) (+ (f f (- n 1)) (f f (- n 2))))))
>>187 )
188
Name:
Anonymous
2007-09-28 14:12
ID:prfu+IDU
>>182
What about:
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
189
Name:
Anonymous
2007-09-28 15:55
ID:Heaven
>>188
still slower than
>>180
190
Name:
Anonymous
2007-09-28 16:17
ID:Heaven
>>189
>>180 uses irrational numbers, so it's not very accurate.
191
Name:
Anonymous
2007-09-28 16:23
ID:Heaven
It's also not an infinite list.
192
Name:
Anonymous
2007-09-29 16:45
ID:bQYOIdUF
573147844013817084101
193
Name:
Anonymous
2007-09-29 17:39
ID:qn8Hk8Yl
927372692193078999176
194
Name:
BigMike
!!U8o7BgwzSrVjbGp
2007-09-30 0:35
ID:Heaven
sage
195
Name:
Anonymous
2007-09-30 6:30
ID:TdguRj7s
1500520536206896083277
196
Name:
Anonymous
2007-09-30 7:31
ID:jb+HyrtW
2427893228399975082453
197
Name:
Anonymous
2007-09-30 11:01
ID:Ktmehqtu
0
198
Name:
Anonymous
2007-09-30 12:35
ID:XOlKgjzk
3928413764616871165730
199
Name:
Anonymous
2007-09-30 18:47
ID:VoNO1Psw
[code] __ __
\ \ ___ / /
\ \\ \ / /
\ \\ \ __ __ __ _________ / /
\ \> \ /__) /__) /__) /____ // /
\ /_________ ________ _______ _________ / // /
/ //____ //___ // _ ` / _ // // /
/ /_____/ / / // // // //___// // /
/ / / // // // / / ~ ~\
/____________.´ / / `_______´/___/ /_______ \
_________/ / \ \
/ / \ \
/____________/ \___\[/code]
200
Name:
Anonymous
2007-09-30 19:00
ID:Zfk3Ya+F
6356306993006846248183
Newer Posts