cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A008466 a(n) = 2^n - Fibonacci(n+2).

This page as a plain text file.
%I A008466 #149 Aug 05 2025 03:41:54
%S A008466 0,0,1,3,8,19,43,94,201,423,880,1815,3719,7582,15397,31171,62952,
%T A008466 126891,255379,513342,1030865,2068495,4147936,8313583,16655823,
%U A008466 33358014,66791053,133703499,267603416,535524643,1071563515,2143959070,4289264409,8580707127
%N A008466 a(n) = 2^n - Fibonacci(n+2).
%C A008466 Toss a fair coin n times; a(n) is number of possible outcomes having a run of 2 or more heads.
%C A008466 Also the number of binary words of length n with at least two neighboring 1 digits. For example, a(4)=8 because 8 binary words of length 4 have two or more neighboring 1 digits: 0011, 0110, 0111, 1011, 1100, 1101, 1110, 1111 (cf. A143291). - _Alois P. Heinz_, Jul 18 2008
%C A008466 Equivalently, number of solutions (x_1, ..., x_n) to the equation x_1*x_2 + x_2*x_3 + x_3*x_4 + ... + x_{n-1}*x_n = 1 in base-2 lunar arithmetic. - _N. J. A. Sloane_, Apr 23 2011
%C A008466 Row sums of triangle A153281 = (1, 3, 8, 19, 43, ...). - _Gary W. Adamson_, Dec 23 2008
%C A008466 a(n-1) is the number of compositions of n with at least one part >= 3. - _Joerg Arndt_, Aug 06 2012
%C A008466 One less than the cardinality of the set of possible numbers of (leaf-) nodes of AVL trees with height n (cf. A143897, A217298). a(3) = 4-1, the set of possible numbers of (leaf-) nodes of AVL trees with height 3 is {5,6,7,8}. - _Alois P. Heinz_, Mar 20 2013
%C A008466 a(n) is the number of binary words of length n such that some prefix contains three more 1's than 0's or two more 0's than 1's. a(4) = 8 because we have: {0,0,0,0}, {0,0,0,1}, {0,0,1,0}, {0,0,1,1}, {0,1,0,0}, {1,0,0,0}, {1,1,1,0}, {1,1,1,1}. - _Geoffrey Critzer_, Dec 30 2013
%C A008466 With offset 0: antidiagonal sums of P(j,n) array of j-th partial sums of Fibonacci numbers. - _Luciano Ancora_, Apr 26 2015
%D A008466 W. Feller, An Introduction to Probability Theory and Its Applications, Vol. 1, 2nd ed. New York: Wiley, p. 300, 1968.
%D A008466 J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 14, Exercise 1.
%H A008466 Alois P. Heinz, <a href="/A008466/b008466.txt">Table of n, a(n) for n = 0..1000</a> (first 301 terms from T. D. Noe)
%H A008466 D. Applegate, M. LeBrun and N. J. A. Sloane, <a href="http://arxiv.org/abs/1107.1130">Dismal Arithmetic</a>, arXiv:1107.1130 [math.NT], 2001. [Note: we have now changed the name from "dismal arithmetic" to "lunar arithmetic" - the old name was too depressing]
%H A008466 Simon Cowell, <a href="http://arxiv.org/abs/1506.03580">A Formula for the Reliability of a d-dimensional Consecutive-k-out-of-n:F System</a>, arXiv preprint arXiv:1506.03580 [math.CO], 2015.
%H A008466 INRIA Algorithms Project, <a href="http://ecs.inria.fr/services/structure?nbr=1020">Encyclopedia of Combinatorial Structures 1020</a>
%H A008466 T. Langley, J. Liese, and J. Remmel, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL14/Langley/langley2.html">Generating Functions for Wilf Equivalence Under Generalized Factor Order</a>, J. Int. Seq. 14 (2011) # 11.4.2.
%H A008466 B. E. Merkel, <a href="http://rave.ohiolink.edu/etdc/view?acc_num=ucin1307442290">Probabilities of Consecutive Events in Coin Flipping</a>, Master's Thesis, Univ. Cincinatti, May 11 2011.
%H A008466 D. J. Persico and H. C. Friedman, <a href="http://dx.doi.org/10.1137/1004062">Another Coin Tossing Problem</a>, Problem 62-6, SIAM Review, 6 (1964), 313-314.
%H A008466 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Run.html">Run.</a>
%H A008466 <a href="/index/Di#dismal">Index entries for sequences related to dismal (or lunar) arithmetic</a>
%H A008466 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,-1,-2).
%F A008466 a(1)=0, a(2)=1, a(3)=3, a(n) = 3*a(n-1) - a(n-2) - 2*a(n-3). - _Miklos Kristof_, Nov 24 2003
%F A008466 G.f.: x^2/((1-2*x)*(1-x-x^2)). - _Paul Barry_, Feb 16 2004
%F A008466 From _Paul Barry_, May 19 2004: (Start)
%F A008466 Convolution of Fibonacci(n) and (2^n - 0^n)/2.
%F A008466 a(n) = Sum_{k=0..n} (2^k-0^k)*Fibonacci(n-k)/2.
%F A008466 a(n+1) = Sum_{k=0..n} Fibonacci(k)*2^(n-k).
%F A008466 a(n) = 2^n*Sum_{k=0..n} Fibonacci(k)/2^k. (End)
%F A008466 a(n) = a(n-1) + a(n-2) + 2^(n-2). - Jon Stadler (jstadler(AT)capital.edu), Aug 21 2006
%F A008466 a(n) = 2*a(n-1) + Fibonacci(n-1). - _Thomas M. Green_, Aug 21 2007
%F A008466 a(n) = term (1,3) in the 3 X 3 matrix [3,1,0; -1,0,1; -2,0,0]^n. - _Alois P. Heinz_, Jul 18 2008
%F A008466 a(n) = 2*a(n-1) - a(n-3) + 2^(n-3). - _Carmine Suriano_, Mar 08 2011
%e A008466 From _Gus Wiseman_, Jun 25 2020: (Start)
%e A008466 The a(2) = 1 through a(5) = 19 compositions of n + 1 with at least one part >= 3 are:
%e A008466   (3)  (4)    (5)      (6)
%e A008466        (1,3)  (1,4)    (1,5)
%e A008466        (3,1)  (2,3)    (2,4)
%e A008466               (3,2)    (3,3)
%e A008466               (4,1)    (4,2)
%e A008466               (1,1,3)  (5,1)
%e A008466               (1,3,1)  (1,1,4)
%e A008466               (3,1,1)  (1,2,3)
%e A008466                        (1,3,2)
%e A008466                        (1,4,1)
%e A008466                        (2,1,3)
%e A008466                        (2,3,1)
%e A008466                        (3,1,2)
%e A008466                        (3,2,1)
%e A008466                        (4,1,1)
%e A008466                        (1,1,1,3)
%e A008466                        (1,1,3,1)
%e A008466                        (1,3,1,1)
%e A008466                        (3,1,1,1)
%e A008466 (End)
%p A008466 a:= n-> (<<3|1|0>, <-1|0|1>, <-2|0|0>>^n)[1, 3]:
%p A008466 seq(a(n), n=0..50); # _Alois P. Heinz_, Jul 18 2008
%p A008466 # second Maple program:
%p A008466 with(combinat): F:=fibonacci; f:=n->add(2^(n-1-i)*F(i),i=0..n-1); [seq(f(n),n=0..50)]; # _N. J. A. Sloane_, Mar 31 2014
%t A008466 Table[2^n-Fibonacci[n+2],{n,0,20}] (* _Vladimir Joseph Stephan Orlovsky_, Jul 22 2008 *)
%t A008466 MMM = 30;
%t A008466 For[ M=2, M <= MMM, M++,
%t A008466 vlist = Array[x, M];
%t A008466 cl[i_] := And[ x[i], x[i+1] ];
%t A008466 cl2 = False; For [ i=1, i <= M-1, i++, cl2 = Or[cl2, cl[i]] ];
%t A008466 R[M] = SatisfiabilityCount[ cl2, vlist ] ]
%t A008466 Table[ R[M], {M,2,MMM}]
%t A008466 (* Find Boolean values of variables that satisfy the formula x1 x2 + x2 x3 + ... + xn-1 xn = 1; _N. J. A. Sloane_, Apr 23 2011 *)
%t A008466 LinearRecurrence[{3,-1,-2},{0,0,1},40] (* _Harvey P. Dale_, Aug 09 2013 *)
%t A008466 nn=33; a=1/(1-2x); b=1/(1-2x^2-x^4-x^6/(1-x^2));
%t A008466 CoefficientList[Series[b(a x^3/(1-x^2)+x^2a),{x,0,nn}],x] (* _Geoffrey Critzer_, Dec 30 2013 *)
%t A008466 Table[Length[Select[Join@@Permutations/@IntegerPartitions[n+1],Max@@#>2&]],{n,0,10}] (* _Gus Wiseman_, Jun 25 2020 *)
%o A008466 (PARI) a(n) = 2^n-fibonacci(n+2) \\ _Charles R Greathouse IV_, Feb 03 2014
%o A008466 (Magma) [2^n-Fibonacci(n+2): n in [0..40]]; // _Vincenzo Librandi_, Apr 27 2015
%o A008466 (SageMath) def A008466(n): return 2^n - fibonacci(n+2) # _G. C. Greubel_, Apr 23 2025
%Y A008466 Cf. A050227, A050231, A050232, A050233, A056986.
%Y A008466 Cf. A153281, A186244 (ternary words), A335457, A335458, A335516.
%Y A008466 The non-contiguous version is A335455.
%Y A008466 Row 2 of A340156. Column 3 of A109435.
%K A008466 nonn,nice,easy
%O A008466 0,4
%A A008466 _N. J. A. Sloane_, _I. J. Kennedy_, _Eric W. Weisstein_