### ----------------------------------------------------
### -- OEIS
### -- Licenses: Artistic-2.0
### -- Authors: Tobias Boege
### -- File: t/data/Fibonacci-Search-all.txt
### ----------------------------------------------------
### -- Chunk 6 of 15
 fibonacci_sequence(0, 40)] # _Bruno Berselli_, Jun 26 2014
%o A000045 (Haskell)
%o A000045 -- Based on code from http://www.haskell.org/haskellwiki/The_Fibonacci_sequence
%o A000045 -- which also has other versions.
%o A000045 fib :: Int -> Integer
%o A000045 fib n = fibs !! n
%o A000045 .. where
%o A000045 .... fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
%o A000045 {- Example of use: map fib [0..38] _Gerald McGarvey_, Sep 29 2009 -}
%o A000045 (Julia)
%o A000045 function fib(n)
%o A000045    F = BigInt[1 1; 1 0]
%o A000045    Fn = F^n
%o A000045    Fn[2, 1]
%o A000045 end
%o A000045 println([fib(n) for n in 0:38]) # _Peter Luschny_, Feb 23 2017
%o A000045 (GAP)
%o A000045 Fib:=[0,1];; for n in [3..10^3] do Fib[n]:=Fib[n-1]+Fib[n-2]; od; Fib;  #  _Muniru A Asiru_, Sep 03 2017
%o A000045 (Scheme)
%o A000045 ;; The following definition uses macro definec for the memoization (caching) of the results. See http://oeis.org/wiki/Memoization#Scheme
%o A000045 (definec (A000045 n) (if (< n 2) n (+ (A000045 (- n 1)) (A000045 (- n 2))))) ;; _Antti Karttunen_, Oct 06 2017
%o A000045 (Scala) def fibonacci(n: BigInt): BigInt = {
%o A000045   val zero = BigInt(0)
%o A000045   def fibTail(n: BigInt, a: BigInt, b: BigInt): BigInt = n match {
%o A000045     case `zero` => a
%o A000045     case _ => fibTail(n - 1, b, a + b)
%o A000045   }
%o A000045   fibTail(n, 0, 1)
%o A000045 } // Based on "Case 3: Tail Recursion" from Carrasquel (2016) link
%o A000045 (0 to 49).map(fibonacci(_)) // _Alonso del Arte_, Apr 13 2019
%Y A000045 Cf. A039834 (signed Fibonacci numbers), A001690 (complement), A000213, A000288, A000322, A000383, A060455, A030186, A020695, A020701, A071679, A099731, A100492, A094216, A094638, A000108, A101399, A101400, A001611, A000071, A157725, A001911, A157726, A006327, A157727, A157728, A157729, A167616, A059929, A144152, A152063, A114690, A003893, A000032, A060441, A000930, A003269, A000957, A057078, A007317, A091867, A104597, A249548, A262342, A001060, A022095, A072649.
%Y A000045 First row of arrays A103323, A172236, A234357. Second row of arrays A099390, A048887, and A092921 (k-generalized Fibonacci numbers).
%Y A000045 Cf. A001175 (Pisano periods), A001177 (Entry points), A001176 (number of zeros in a fundamental period).
%Y A000045 Fibonacci-Pascal triangles: A027926, A036355, A037027, A074829, A105809, A109906, A111006, A114197, A162741, A228074.
%Y A000045 Boustrophedon transforms: A000738, A000744.
%Y A000045 Powers: A103323, A105317, A254719.
%Y A000045 Numbers of prime factors: A022307 and A038575.
%Y A000045 Cf. A163733.
%K A000045 nonn,core,nice,easy,hear
%O A000045 0,4
%A A000045 _N. J. A. Sloane_, 1964

%I A290689
%S A290689 1,1,1,2,3,5,8,13,21,34,55,88,143,229,370,592,955,1527,2457,3929
%N A290689 Number of transitive rooted trees with n nodes.
%C A290689 A rooted tree is transitive if every proper terminal subtree is also a branch of the root. First differs from A206139 at a(13) = 143.
%e A290689 The a(7) = 8 trees are: (o(oooo)), (oo(ooo)), (o(o)((o))), (o(o)(oo)), (ooo(oo)), (oo(o)(o)), (oooo(o)), (oooooo).
%t A290689 nn=18;
%t A290689 rtall[n_]:=If[n===1,{{}},Module[{cas},Union[Sort/@Join@@(Tuples[rtall/@#]&/@IntegerPartitions[n-1])]]];
%t A290689 Table[Length[Select[rtall[n],Complement[Union@@#,#]==={}&]],{n,nn}]
%Y A290689 Cf. A000081, A004111, A279861, A290822.
%K A290689 nonn,more
%O A290689 1,4
%A A290689 _Gus Wiseman_, Oct 19 2017
%E A290689 a(20) from _Robert Price_, Sep 13 2018

%I A027926
%S A027926 1,1,1,1,1,1,2,2,1,1,1,2,3,4,3,1,1,1,2,3,5,7,7,4,1,1,1,2,3,5,8,12,14,
%T A027926 11,5,1,1,1,2,3,5,8,13,20,26,25,16,6,1,1,1,2,3,5,8,13,21,33,46,51,41,
%U A027926 22,7,1,1,1,2,3,5,8,13,21,34,54,79,97,92,63,29
%N A027926 Triangular array T read by rows: T(n,0) = T(n,2n) = 1 for n >= 0; T(n,1) = 1 for n >= 1; T(n,k) = T(n-1,k-2) + T(n-1,k-1) for k = 2..2n-1, n >= 2.
%C A027926 T(n,k) = number of strings s(0),...,s(n) such that s(0)=0, s(n)=n-k and for 1<=i<=n, s(i)=s(i-1)+d, with d in {0,1,2} if i=0, in {0,2} if s(i)=2i, in {0,1,2} if s(i)=2i-1, in {0,1} if 0<=s(i)<=2i-2.
%C A027926 Can be seen as concatenation of triangles A104763 and A105809, with identifying column of Fibonacci numbers, see example. - _Reinhard Zumkeller_, Aug 15 2013
%H A027926 Reinhard Zumkeller, <a href="/A027926/b027926.txt">Rows n = 0..100 of table, flattened</a>
%H A027926 <a href="/index/Pas#Pascal">Index entries for triangles and arrays related to Pascal's triangle</a>
%F A027926 T(n, k)=sum(binomial(n-j, 2n-k-2j), j=0..floor[(2n-k+1)/2]). - _Len Smiley_, Oct 21 2001
%e A027926 .   0:                           1
%e A027926 .   1:                        1  1   1
%e A027926 .   2:                     1  1  2   2   1
%e A027926 .   3:                  1  1  2  3   4   3   1
%e A027926 .   4:               1  1  2  3  5   7   7   4   1
%e A027926 .   5:            1  1  2  3  5  8  12  14  11   5   1
%e A027926 .   6:          1 1  2  3  5  8 13  20  26  25  16   6   1
%e A027926 .   7:        1 1 2  3  5  8 13 21  33  46  51  41  22   7   1
%e A027926 .   8:      1 1 2 3  5  8 13 21 34  54  79  97  92  63  29   8  1
%e A027926 .   9:    1 1 2 3 5  8 13 21 34 55  88 133 176 189 155  92  37  9  1
%e A027926 .  10:  1 1 2 3 5 8 13 21 34 55 89 143 221 309 365 344 247 129 46 10  1
%e A027926 .
%e A027926 .   1:                           1
%e A027926 .   2:                        1  1
%e A027926 .   3:                     1  1  2
%e A027926 .   4:                  1  1  2  3
%e A027926 .   5:               1  1  2  3  5      columns = A000045, > 0
%e A027926 .   6:            1  1  2  3  5  8     +---------+
%e A027926 .   7:          1 1  2  3  5  8 13     | A104763 |
%e A027926 .   8:        1 1 2  3  5  8 13 21     +---------+
%e A027926 .   9:      1 1 2 3  5  8 13 21 34
%e A027926 .  10:    1 1 2 3 5  8 13 21 34 55
%e A027926 .  11:  1 1 2 3 5 8 13 21 34 55 89
%e A027926 .
%e A027926 .   0:                           1
%e A027926 .   1:                           1   1                +---------+
%e A027926 .   2:                           2   2   1            | A105809 |
%e A027926 .   3:                           3   4   3   1        +---------+
%e A027926 .   4:                           5   7   7   4   1
%e A027926 .   5:                           8  12  14  11   5   1
%e A027926 .   6:                          13  20  26  25  16   6   1
%e A027926 .   7:                          21  33  46  51  41  22   7   1
%e A027926 .   8:                          34  54  79  97  92  63  29   8  1
%e A027926 .   9:                          55  88 133 176 189 155  92  37  9  1
%e A027926 .  10:                          89 143 221 309 365 344 247 129 46 10  1
%p A027926 A027926 := proc(n,k)
%p A027926     add(binomial(n-j,2*n-k-2*j),j=0..(2*n-k+1)/2) ;
%p A027926 end proc: # _R. J. Mathar_, Apr 11 2016
%t A027926 z = 15; t[n_, 0] := 1; t[n_, k_] := 1 /; k == 2 n; t[n_, 1] := 1;
%t A027926 t[n_, k_] := t[n, k] = t[n - 1, k - 2] + t[n - 1, k - 1];
%t A027926 u = Table[t[n, k], {n, 0, z}, {k, 0, 2 n}];
%t A027926 TableForm[u] (* A027926 array *)
%t A027926 v = Flatten[u] (* A027926 sequence *)
%t A027926 (* _Clark Kimberling_, Aug 31 2014 *)
%o A027926 (PARI) {T(n, k) = if( k<0 || k>2*n, 0, if( k<=1 || k==2*n, 1, T(n-1, k-2) + T(n-1, k-1)))}; /* __Michael Somos_, Feb 26 1999 */
%o A027926 (PARI) {T(n, k) = if( k<0 || k>2*n, 0, sum( j=max(0, k-n), k\2, binomial(k-j, j)))}; /* _Michael Somos_ */
%o A027926 (Haskell)
%o A027926 a027926 n k = a027926_tabf !! n !! k
%o A027926 a027926_row n = a027926_tabf !! n
%o A027926 a027926_tabf = iterate (\xs -> zipWith (+)
%o A027926                                ([0] ++ xs ++ [0]) ([1,0] ++ xs)) [1]
%o A027926 -- Variant, cf. example:
%o A027926 a027926_tabf' = zipWith (++) a104763_tabl (map tail a105809_tabl)
%o A027926 -- _Reinhard Zumkeller_, Aug 15 2013
%Y A027926 Many columns of T are A000045 (Fibonacci sequence), also in T: A001924, A004006, A000071, A000124, A014162, A014166, A027927-A027933.
%Y A027926 Some other Fibonacci-Pascal triangles: A036355, A037027, A074829, A105809, A109906, A111006, A114197, A162741, A228074.
%K A027926 nonn,tabf
%O A027926 0,7
%A A027926 _Clark Kimberling_
%E A027926 Incorporates comments from _Michael Somos_.
%E A027926 Example extended by _Reinhard Zumkeller_, Aug 15 2013

%I A014260
%S A014260 0,1,1,2,3,5,8,13,21,52,64,89,135,233,764,1096,1563,8464,12115,16763,
%T A014260 67884,104645,153521,699922,825273,1055269,1427797,11053298,19030539,
%U A014260 108265550,201768641,257331442,404198544,648332296,1094223700
%N A014260 Iccanobif numbers: add a(n-1) to reversal of a(n-2).
%H A014260 Alois P. Heinz, <a href="/A014260/b014260.txt">Table of n, a(n) for n = 0..1000</a>
%p A014260 R:= n-> (s-> parse(cat(s[-i]$i=1..length(s))))(""||n):
%p A014260 a:= proc(n) option remember; `if`(n<2, n,
%p A014260        a(n-1) +R(a(n-2)))
%p A014260     end:
%p A014260 seq(a(n), n=0..50);  # _Alois P. Heinz_, Jun 18 2014
%t A014260 Clear[ Bif ]; Bif[ 0 ]=0; Bif[ 1 ]=1; Bif[ n_Integer ] := Bif[ n ]=Bif[ n-1 ]+Plus@@(IntegerDigits[ Bif[ n-2 ], 10 ]//(#*Array[ 10^#&, Length[ # ], 0 ])&); Array[ Bif, 40, 0 ]
%t A014260 nxt[{a_,b_}]:={b,IntegerReverse[a]+b}; NestList[nxt,{0,1},40][[All,1]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Jul 04 2018 *)
%Y A014260 Cf. A000045, A001129, A014258, A014259.
%Y A014260 See A000045 for the Fibonacci numbers.
%K A014260 base,nonn,easy
%O A014260 0,4
%A A014260 _N. J. A. Sloane_.

%I A181600
%S A181600 1,1,2,3,5,8,13,21,33,53,85,136,218,349,559,895,1434,2297,3679,5893,
%T A181600 9439,15119,24217,38790,62132,99520,159407,255331,408978,655083,
%U A181600 1049283,1680695,2692063,4312028,6906816,11063033,17720278,28383559,45463532,72821479
%N A181600 Expansion of 1/(1 - x - x^2 + x^8 - x^10).
%C A181600 Limiting ratio is 1.60176..., the largest real root of -1 + x^2 - x^8 - x^9 + x^10. Compare this constant to Lehmer's Salem constant A073011 and the golden mean.
%H A181600 G. C. Greubel, <a href="/A181600/b181600.txt">Table of n, a(n) for n = 0..1000</a>
%H A181600 <a href="/index/Rec#order_10">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,0,0,0,0,0,-1,0,1).
%F A181600 a(n) = a(n-1) + a(n-2) - a(n-8) + a(n-10). - _Franck Maminirina Ramaharo_, Oct 31 2018
%t A181600 CoefficientList[Series[1/(1 - x - x^2 + x^8 - x^10), {x, 0, 50}], x]
%t A181600 LinearRecurrence[{1, 1, 0, 0, 0, 0, 0, -1, 0, 1}, {1, 1, 2, 3, 5, 8, 13, 21, 33, 53}, 50] (* _Harvey P. Dale_, Aug 11 2015 *)
%o A181600 (PARI) Vec(1/(1 -x -x^2 +x^8 -x^10) + O(x^50)) \\ _G. C. Greubel_, Nov 16 2016
%o A181600 (MAGMA) m:=50; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(1/(1 -x-x^2+x^8-x^10))); // _G. C. Greubel_, Nov 03 2018
%Y A181600 Cf. A029826, A117791, A143419, A143438, A143472, A143619, A143644, A147663, A173908, A173911, A173924, A173925, A174522, A175740, A175772, A175773, A175782, A204631, A225391, A225393, A225394, A225482, A225499.
%K A181600 nonn,easy
%O A181600 0,3
%A A181600 _Roger L. Bagula_, May 06 2013

%I A212804
%S A212804 1,0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,
%T A212804 6765,10946,17711,28657,46368,75025,121393,196418,317811,514229,
%U A212804 832040,1346269,2178309,3524578,5702887,9227465,14930352,24157817,39088169,63245986,102334155,165580141,267914296,433494437,701408733,1134903170,1836311903,2971215073,4807526976
%N A212804 Expansion of (1-x)/(1-x-x^2).
%C A212804 A variant of the Fibonacci number A000045.
%C A212804 Number of compositions of n into parts >= 2. - _Joerg Arndt_, Aug 13 2012
%C A212804 From _Petros Hadjicostas_, Jan 08 2019: (Start)
%C A212804 For n >= 0, a(n) is the number of unmarked circular binary words (necklaces) of length n+1 with exactly one occurrence of the pattern 00 (provided we allow the strings of length 1, i.e., 0 and 1, to wrap around themselves on a circle to form strings of length 2). See the comments for array A320341.
%C A212804 Using MacMahon's bijection between necklaces and cyclic compositions, we conclude that a(n) is also the number of (unmarked) cyclic compositions of n+1 with exactly one 1.
%C A212804 Removing the single 1 from each cyclic composition of n+1, we get all linear compositions of n with each part >= 2, which is what is stated above by Joerg Arndt.
%C A212804 (End)
%H A212804 Vincenzo Librandi, <a href="/A212804/b212804.txt">Table of n, a(n) for n = 0..1000</a>
%H A212804 J. J. Madden, <a href="http://arxiv.org/abs/1707.04351">A generating function for the distribution of runs in binary words</a>, arXiv:1707.04351 [math.CO], 2017, Theorem 1.1, r=1 and k=0.
%H A212804 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (1,1).
%F A212804 G.f.: (1-x)/(1-x-x^2) = (1-x)*G(0)/(x*sqrt(5)) where G(k)= 1 -((-1)^k)*2^k/(a^k - b*x*a^k*2^k/(b*x*2^k - 2*((-1)^k)*c^k/G(k+1))) and a=3+sqrt(5), b=1+sqrt(5), c=3-sqrt(5); (continued fraction, 3rd kind, 3-step). - _Sergei N. Gladkovskii_, Jun 04 2012
%F A212804 G.f.: 1/(1-(Sum_{k>=2} x^k)). - _Joerg Arndt_, Aug 13 2012
%F A212804 a(n) = Fibonacci(n+1) - Fibonacci(n). - _Arkadiusz Wesolowski_, Oct 29 2012
%F A212804 G.f.: 1 - x*Q(0) where Q(k) = 1 - (1+x)/(1 - x/(x - 1/Q(k+1) )); (continued fraction). - _Sergei N. Gladkovskii_, Mar 06 2013
%F A212804 G.f.: 3*x^3/(3*x - Q(0)) - x^2 + 1, where Q(k) = 1 - 1/(4^k - x*16^k/(x*4^k - 1/(1 + 1/(2*4^k - 4*x*16^k/(2*x*4^k +1/Q(k+1)))))); (continued fraction). - _Sergei N. Gladkovskii_, May 21 2013
%F A212804 G.f.: G(0)*(1-x)/(2-x), where G(k)= 1 + 1/(1 - (x*(5*k-1))/((x*(5*k+4)) - 2/G(k+1))); (continued fraction). - _Sergei N. Gladkovskii_, Jun 15 2013
%F A212804 G.f.: 1 + Q(0)*x^2/2, where Q(k) = 1 + 1/(1 - x*(2*k+1 + x)/( x*(2*k+2 + x) + 1/Q(k+1) )); (continued fraction). - _Sergei N. Gladkovskii_, Aug 29 2013
