Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,7 @@
program fib
args n
clear
qui set obs `n'
qui gen a=1
qui replace a=a[_n-1]+a[_n-2] in 3/l
end

View file

@ -0,0 +1,12 @@
program fib
args n
clear
qui set obs `n'
qui gen a=.
dyngen {
update a=a[_n-1]+a[_n-2], missval(1)
}
end
fib 10
list

View file

@ -0,0 +1,12 @@
. mata
: function fib(n) {
return((((1+sqrt(5))/2):^n-((1-sqrt(5))/2):^n)/sqrt(5))
}
: fib(0..10)
1 2 3 4 5 6 7 8 9 10 11
+--------------------------------------------------------+
1 | 0 1 1 2 3 5 8 13 21 34 55 |
+--------------------------------------------------------+
: end