A132343 Output of Knuth's "man or boy" test for varying k.
1, 0, -2, 0, 1, 0, 1, -1, -10, -30, -67, -138, -291, -642, -1446, -3250, -7244, -16065, -35601, -78985, -175416, -389695, -865609, -1922362, -4268854, -9479595, -21051458, -46750171, -103821058, -230560902, -512016658, -1137056340, -2525108865, -5607619809
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- D. E. Knuth (Jul 1964). Man or boy?.
- Charles H. Lindsey (Dec 1988). Block Structure and Environments.
- A. G. Price, et al. (Jan 1965). Men only.
- Rosetta Code, Man or boy test.
- Eric M. Schmidt, Recurrences for the man or boy sequence.
- Index entries for linear recurrences with constant coefficients, signature (5,-10,11,-6,1).
Programs
-
Mathematica
CoefficientList[Series[(2 x^9 - 11 x^8 + 15 x^7 + x^6 - 16 x^5 + 13 x^4 + x^3 - 8 x^2 + 5 x - 1) / ((x - 1) (x^4 - 5 x^3 + 6 x^2 - 4 x + 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Jul 21 2013 *) Join[{1,0,-2,0,1},LinearRecurrence[{5,-10,11,-6,1},{0,1,-1,-10,-30},29]] (* Ray Chandler, Jul 15 2015 *)
-
PARI
Vec(O(x^66)+(2*x^9-11*x^8+15*x^7+x^6-16*x^5+13*x^4+x^3-8*x^2+5*x-1)/((x-1)*(x^4-5*x^3+6*x^2-4*x+1))) \\ Joerg Arndt, Jul 21 2013
Formula
a(5)=0, a(6)=1, a(7)=-1, a(8)=-10, a(9)=-30, a(n)=a(n-5)-6*a(n-4)+11*a(n-3)-10*a(n-2)+5*a(n-1) for n >= 10. - Markus Jarderot (mizardx(AT)gmail.com), Jun 05 2010
G.f.: (2*x^9-11*x^8+15*x^7+x^6-16*x^5+13*x^4+x^3-8*x^2+5*x-1) / ((x-1)*(x^4-5*x^3+6*x^2-4*x+1)). - Joerg Arndt, Jul 21 2013
Extensions
More terms from Eric M. Schmidt, Jul 20 2013
Comments