Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Fibonacci sequence!

Name: Anonymous 2007-09-25 10:58 ID:ScErbbWX

I'll start:

0

Name: Anonymous 2007-09-25 19:12 ID:Heaven

19740274219868223167

Name: Anonymous 2007-09-25 19:12 ID:Heaven

31940434634990099905

Name: Anonymous 2007-09-25 19:12 ID:Heaven

51680708854858323072

Name: Anonymous 2007-09-25 19:12 ID:Heaven

83621143489848422977

Name: Anonymous 2007-09-25 19:13 ID:Heaven

135301852344706746049

Name: Anonymous 2007-09-25 19:13 ID:Heaven

218922995834555169026

Name: Anonymous 2007-09-25 19:13 ID:epKq6PAw

100 FIBGET
354224848179261915075

Name: Anonymous 2007-09-25 21:12 ID:y0pfxps4

Mathematicians need to GTFO of Computer Science. It's time to end the sacrilege NOW.

Name: Anonymous 2007-09-25 21:22 ID:eO8bs9Cv

>>168
Lol wut? Computer Science is based on maths.

Name: Anonymous 2007-09-25 21:40 ID:y0pfxps4

Computer Science is based on mathEMATICS, not on how naive mathEMATICIANS think.

Name: Anonymous 2007-09-25 21:55 ID:Xoy2huGp

>>168
people who know maths keep showing up idiots like you who dont

Name: Anonymous 2007-09-25 22:40 ID:y0pfxps4

>>171
'117' has marked you. [/thread]

Name: Anonymous 2007-09-25 23:14 ID:gvAqmBqR

1-n:0 1 0c:[n;c;>][$@+c;1+c:]#$@+.

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.

Name: Anonymous 2007-09-26 16:40 ID:yI81FEQu

>>98,166

same.... person....

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.

Name: Anonymous 2007-09-26 17:15 ID:RvvgSyj0

[@$0=$[%%\%]?~[1-\@$@+\]?%]i:
[1 0i;!]f:

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);
}

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.

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;
}

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

Name: Anonymous 2007-09-26 20:53 ID:62QMXBDg


let fibs = 0 : 1 : [a + b | (a, b) <- zip fibs (tail fibs)]

Anything else fails.

Name: Anonymous 2007-09-26 20:55 ID:Heaven

>>182
slow code is slow.
see >>180.
O(1) ftw.

Name: Anonymous 2007-09-26 20:57 ID:62QMXBDg

>>183
Except >>182 memoizes.

Name: Anonymous 2007-09-26 21:01 ID:Heaven

>>184
that doesn't make it anywhere near as fast as >>180.

Name: Anonymous 2007-09-27 0:48 ID:61wzrA9l

balls
      balls

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)

Name: Anonymous 2007-09-28 14:12 ID:prfu+IDU

>>182
What about:
    fibs = 0 : 1 : zipWith (+) fibs (tail fibs)

Name: Anonymous 2007-09-28 15:55 ID:Heaven

>>188
still slower than >>180

Name: Anonymous 2007-09-28 16:17 ID:Heaven

>>189
>>180 uses irrational numbers, so it's not very accurate.

Name: Anonymous 2007-09-28 16:23 ID:Heaven

It's also not an infinite list.

Name: Anonymous 2007-09-29 16:45 ID:bQYOIdUF

573147844013817084101

Name: Anonymous 2007-09-29 17:39 ID:qn8Hk8Yl

927372692193078999176

Name: BigMike !!U8o7BgwzSrVjbGp 2007-09-30 0:35 ID:Heaven

sage

Name: Anonymous 2007-09-30 6:30 ID:TdguRj7s

1500520536206896083277

Name: Anonymous 2007-09-30 7:31 ID:jb+HyrtW

2427893228399975082453

Name: Anonymous 2007-09-30 11:01 ID:Ktmehqtu

0

Name: Anonymous 2007-09-30 12:35 ID:XOlKgjzk

3928413764616871165730

Name: Anonymous 2007-09-30 18:47 ID:VoNO1Psw

[code]  __                                                         __
  \ \ ___                                                   / /
   \ \\  \                                                 / /
    \ \\  \                 __   __   __        _________ / /
     \ \>  \               /__) /__) /__)      /____    // /
      \    /_________ ________ _______   _________ /   // /
      /   //____    //___    //   _   ` /   _    //   // /
     /   /_____/   /    /   //   //   //   //___//   // /
    /             /    /   //   //   //   /     /    ~  ~\
   /____________.´    /   / `_______´/___/     /_______   \
            _________/   /                             \   \
           /            /                               \   \
          /____________/                                 \___\[/code]

Name: Anonymous 2007-09-30 19:00 ID:Zfk3Ya+F

6356306993006846248183

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List