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.

Showing 1-10 of 41 results. Next

A000296 Set partitions without singletons: number of partitions of an n-set into blocks of size > 1. Also number of cyclically spaced (or feasible) partitions.

Original entry on oeis.org

1, 0, 1, 1, 4, 11, 41, 162, 715, 3425, 17722, 98253, 580317, 3633280, 24011157, 166888165, 1216070380, 9264071767, 73600798037, 608476008122, 5224266196935, 46499892038437, 428369924118314, 4078345814329009, 40073660040755337, 405885209254049952, 4232705122975949401
Offset: 0

Views

Author

Keywords

Comments

a(n+2) = p(n+1) where p(x) is the unique degree-n polynomial such that p(k) = A000110(k) for k = 0, 1, ..., n. - Michael Somos, Oct 07 2003
Number of complete rhyming schemes.
Whereas the Bell number B(n) (A000110(n)) is the number of terms in the polynomial that expresses the n-th moment of a probability distribution as a function of the first n cumulants, these numbers give the number of terms in the corresponding expansion of the central moment as a function of the first n cumulants. - Michael Hardy (hardy(AT)math.umn.edu), Jan 26 2005
a(n) is the number of permutations on [n] for which the left-to-right maxima coincide with the descents (entries followed by a smaller number). For example, a(4) counts 2143, 3142, 3241, 4123. - David Callan, Jul 20 2005
From Gus Wiseman, Feb 10 2019: (Start)
Also the number of stable partitions of an n-cycle, where a stable partition of a graph is a set partition of the vertex set such that no edge has both ends in the same block. A bijective proof is given in David Callan's article. For example, the a(5) = 11 stable partitions are:
{{1},{2},{3},{4},{5}}
{{1},{2},{3,5},{4}}
{{1},{2,4},{3},{5}}
{{1},{2,5},{3},{4}}
{{1,3},{2},{4},{5}}
{{1,4},{2},{3},{5}}
{{1},{2,4},{3,5}}
{{1,3},{2,4},{5}}
{{1,3},{2,5},{4}}
{{1,4},{2},{3,5}}
{{1,4},{2,5},{3}}
(End)
Also number of partitions of {1, 2, ..., n-1} with singletons. E.g., a(4) = 4: {1|2|3, 12|3, 13|2, 1|23}. Also number of cyclical adjacencies partitions of {1, 2, ..., n-1}. E.g., a(4) = 4: {12|3, 13|2, 1|23, 123}. The two partitions can be mapped by a Kreweras bijection. - Yuchun Ji, Feb 22 2021
Also the k-th central moment of a Poisson random variable with mean 1. a(n) = E[(X-1)^n, X~Poisson(1)]. - Thomas Dybdahl Ahle, Dec 14 2022

Examples

			a(4) = card({{{1, 2}, {3, 4}}, {{1, 4}, {2, 3}}, {{1, 3}, {2, 4}}, {{1, 2, 3, 4}}}) = 4.
		

References

  • Martin Gardner in Sci. Amer. May 1977.
  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.5 (p. 436).
  • G. Pólya and G. Szegő, Problems and Theorems in Analysis, Springer-Verlag, NY, 2 vols., 1972, Vol. 1, p. 228.
  • J. Riordan, A budget of rhyme scheme counts, pp. 455-465 of Second International Conference on Combinatorial Mathematics, New York, April 4-7, 1978. Edited by Allan Gewirtz and Louis V. Quintas. Annals New York Academy of Sciences, 319, 1979.
  • J. Shallit, A Triangle for the Bell numbers, in V. E. Hoggatt, Jr. and M. Bicknell-Johnson, A Collection of Manuscripts Related to the Fibonacci Sequence, 1980, pp. 69-71.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A diagonal of triangle in A106436.
Row sums of the triangle of associated Stirling numbers of second kind A008299. - Philippe Deléham, Feb 10 2005
Row sums of the triangle of basic multinomial coefficients A178866. - Johannes W. Meijer, Jun 21 2010
Row sums of A105794. - Peter Bala, Jan 14 2015
Row sums of A261139, main diagonal of A261137.
Column k=0 of A216963.
Column k=0 of A124323.

Programs

  • Magma
    [1,0] cat [ n le 1 select 1 else Bell(n)-Self(n-1) : n in [1..40]]; // Vincenzo Librandi, Jun 22 2015
    
  • Maple
    spec := [ B, {B=Set(Set(Z,card>1))}, labeled ]; [seq(combstruct[count](spec, size=n), n=0..30)];
    with(combinat): A000296 :=n->(-1)^n + add((-1)^(j-1)*bell(n-j),j=1..n): seq(A000295(n),n=0..30); # Emeric Deutsch, Oct 29 2006
    f:=exp(exp(x)-1-x): fser:=series(f, x=0, 31): 1, seq(n!*coeff(fser, x^n), n=1..23); # Zerinvary Lajos, Nov 22 2006
    G:={P=Set(Set(Atom,card>=2))}: combstruct[gfsolve](G,unlabeled,x): seq(combstruct[count]([P,G,labeled], size=i), i=0..23); # Zerinvary Lajos, Dec 16 2007
    # [a(0),a(1),..,a(n)]
    A000296_list := proc(n)
    local A, R, i, k;
    if n = 0 then return 1 fi;
    A := array(0..n-1);
    A[0] := 1; R := 1;
    for i from 0 to n-2 do
       A[i+1] := A[0] - A[i];
       A[i] := A[0];
       for k from i by -1 to 1 do
          A[k-1] := A[k-1] + A[k] od;
       R := R,A[i+1];
    od;
    R,A[0]-A[i] end:
    A000296_list(100);  # Peter Luschny, Apr 09 2011
  • Mathematica
    nn = 25; Range[0, nn]! CoefficientList[Series[Exp[Exp[x] - 1 - x], {x, 0, nn}], x]
    (* Second program: *)
    a[n_] := a[n] = If[n==0, 1, Sum[Binomial[n-1, i]*a[n-i-1], {i, 1, n-1}]]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Feb 06 2016, after Vladimir Kruchinin *)
    spsu[,{}]:={{}};spsu[foo,set:{i_,_}]:= Join@@Function[s,Prepend[#,s]&/@spsu[ Select[foo,Complement[#, Complement[set,s]]=={}&], Complement[set,s]]]/@Cases[foo,{i,_}];
    Table[Length[spsu[Select[Subsets[Range[n]],Select[Partition[Range[n],2,1,1], Function[ed,Complement[ed,#]=={}]]=={}&],Range[n]]],{n,8}] (* Gus Wiseman, Feb 10 2019 *)
    s = 1; Join[{1}, Table[s = BellB[n] - s, {n, 0, 25}]] (* Vaclav Kotesovec, Jun 20 2022 *)
  • Maxima
    a(n):=if n=0 then 1 else sum(binomial(n-1,i)*a(n-i-1),i,1,n-1); /* Vladimir Kruchinin, Feb 22 2015 */
    
  • PARI
    a(n) = if(n<2, n==0, subst( polinterpolate( Vec( serlaplace( exp( exp( x+O(x^n)/x )-1 ) ) ) ), x, n) )
    
  • Python
    from itertools import accumulate, islice
    def A000296_gen():
        yield from (1,0)
        blist, a, b = (1,), 0, 1
        while True:
            blist = list(accumulate(blist, initial = (b:=blist[-1])))
            yield (a := b-a)
    A000296_list = list(islice(A000296_gen(),20)) # Chai Wah Wu, Jun 22 2022

Formula

E.g.f.: exp(exp(x) - 1 - x).
B(n) = a(n) + a(n+1), where B = A000110 = Bell numbers [Becker].
Inverse binomial transform of Bell numbers (A000110).
a(n)= Sum_{k>=-1} (k^n/(k+1)!)/exp(1). - Vladeta Jovovic and Karol A. Penson, Feb 02 2003
a(n) = Sum_{k=0..n} ((-1)^(n-k))*binomial(n, k)*Bell(k) = (-1)^n + Bell(n) - A087650(n), with Bell(n) = A000110(n). - Wolfdieter Lang, Dec 01 2003
O.g.f.: A(x) = 1/(1-0*x-1*x^2/(1-1*x-2*x^2/(1-2*x-3*x^2/(1-... -(n-1)*x-n*x^2/(1- ...))))) (continued fraction). - Paul D. Hanna, Jan 17 2006
a(n) = Sum_{k = 0..n} {(-1)^(n-k) * Sum_{j = 0..k}((-1)^j * binomial(k,j) * (1-j)^n)/ k!} = sum over row n of A105794. - Tom Copeland, Jun 05 2006
a(n) = (-1)^n + Sum_{j=1..n} (-1)^(j-1)*B(n-j), where B(q) are the Bell numbers (A000110). - Emeric Deutsch, Oct 29 2006
Let A be the upper Hessenberg matrix of order n defined by: A[i, i-1] = -1, A[i,j] = binomial(j-1, i-1), (i <= j), and A[i, j] = 0 otherwise. Then, for n >= 2, a(n) = (-1)^(n)charpoly(A,1). - Milan Janjic, Jul 08 2010
From Sergei N. Gladkovskii, Sep 20 2012, Oct 11 2012, Dec 19 2012, Jan 15 2013, May 13 2013, Jul 20 2013, Oct 19 2013, Jan 25 2014: (Start)
Continued fractions:
G.f.: (2/E(0) - 1)/x where E(k) = 1 + 1/(1 + 2*x/(1 - 2*(k+1)*x/E(k+1))).
G.f.: 1/U(0) where U(k) = 1 - x*k - x^2*(k+1)/U(k+1).
G.f.: G(0)/(1+2*x) where G(k) = 1 - 2*x*(k+1)/((2*k+1)*(2*x*k-x-1) - x*(2*k+1)*(2*k+3)*(2*x*k-x-1)/(x*(2*k+3) - 2*(k+1)*(2*x*k-1)/G(k+1))).
G.f.: (G(0) - 1)/(x-1) where G(k) = 1 - 1/(1+x-k*x)/(1-x/(x-1/G(k+1))).
G.f.: 1 + x^2/(1+x)/Q(0) where Q(k) = 1-x-x/(1-x*(2*k+1)/(1-x-x/(1-x*(2*k+2)/Q(k+1)))).
G.f.: 1/(x*Q(0)) where Q(k) = 1 + 1/(x + x^2/(1 - x - (k+1)/Q(k+1))).
G.f.: -(1+(2*x+1)/G(0))/x where G(k) = x*k - x - 1 - (k+1)*x^2/G(k+1).
G.f.: T(0) where T(k) = 1 - x^2*(k+1)/( x^2*(k+1) - (1-x*k)*(1-x-x*k)/T(k+1)).
G.f.: (1 + x * Sum_{k>=0} (x^k / Product_{p=0..k}(1 - p*x))) / (1 + x). (End)
a(n) = Sum_{i=1..n-1} binomial(n-1,i)*a(n-i-1), a(0)=1. - Vladimir Kruchinin, Feb 22 2015
G.f. A(x) satisfies: A(x) = (1/(1 + x)) * (1 + x * A(x/(1 - x)) / (1 - x)). - Ilya Gutkovskiy, May 21 2021
a(n) ~ exp(n/LambertW(n) - n - 1) * n^(n-1) / (sqrt(1 + LambertW(n)) * LambertW(n)^(n-1)). - Vaclav Kotesovec, Jun 28 2022

Extensions

More terms, new description from Christian G. Bower, Nov 15 1999
a(23) corrected by Sean A. Irvine, Jun 22 2015

A001924 Apply partial sum operator twice to Fibonacci numbers.

Original entry on oeis.org

0, 1, 3, 7, 14, 26, 46, 79, 133, 221, 364, 596, 972, 1581, 2567, 4163, 6746, 10926, 17690, 28635, 46345, 75001, 121368, 196392, 317784, 514201, 832011, 1346239, 2178278, 3524546, 5702854, 9227431, 14930317, 24157781, 39088132, 63245948, 102334116, 165580101
Offset: 0

Views

Author

Keywords

Comments

Leading coefficients in certain rook polynomials (for n>=2; see p. 18 of the Riordan paper). - Emeric Deutsch, Mar 08 2004
(1, 3, 7, 14, ...) = row sums of triangle A141289. - Gary W. Adamson, Jun 22 2008
a(n) is the number of nonempty subsets of {1,2,...,n} such that the difference of successive elements is at most 2. See example below. Generally, the o.g.f. for the number of nonempty subsets of {1,2,...,n} such that the difference of successive elements is <= k is: x/((1-x)*(1-2*x+x^(k+1))). Cf. A000217 the case for k=1, A001477 the case for k=0 (counts singleton subsets). - Geoffrey Critzer, Feb 17 2012
-Fibonacci(n-2) = p(-1) where p(x) is the unique degree-n polynomial such that p(k) = a(k) for k = 0, 1, ..., n. - Michael Somos, Dec 31 2012
a(n) is the number of bit strings of length n+1 with the pattern 00 and without the pattern 011, see example. - John M. Campbell, Feb 10 2013
From Jianing Song, Apr 28 2025: (Start)
For n >= 2, a(n-2) is the number of subsets of {1,2,...,n} with 2 or more elements that contain no consecutive elements (i.e., such that the difference of successive elements is at least 2). Note that the number of such subsets with k elements is binomial(n+1-k,k), and Sum_{k=2..floor((n+1)/2)} binomial(n+1-k,k) = F(n+2) - binomial(n+1,0) - binomial(n,1) = F(n+2) - (n+1).
If subsets of {1,2,...,n} are required to contain no consecutive elements module n, then the result is A023548(n-3). (End)

Examples

			a(5) = 26 because there are 31 nonempty subsets of {1,2,3,4,5} but 5 of these have successive elements that differ by 3 or more: {1,4}, {1,5}, {2,5}, {1,2,5}, {1,4,5}. - _Geoffrey Critzer_, Feb 17 2012
From _John M. Campbell_, Feb 10 2013: (Start)
There are a(5) = 26 bit strings with the pattern 00 and without the pattern 011 of length 5+1:
   000000, 000001, 000010, 000100, 000101, 001000,
   001001, 001010, 010000, 010001, 010010, 010100,
   100000, 100001, 100010, 100100, 100101, 101000, 101001,
   110000, 110001, 110010, 110100, 111000, 111001, 111100.
(End)
		

References

  • J. Riordan, Discordant permutations, Scripta Math., 20 (1954), 14-23.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Right-hand column 4 of triangle A011794.
Cf. A065220.

Programs

  • GAP
    List([0..40], n-> Fibonacci(n+4) -n-3); # G. C. Greubel, Jul 08 2019
  • Haskell
    a001924 n = a001924_list !! n
    a001924_list = drop 3 $ zipWith (-) (tail a000045_list) [0..]
    -- Reinhard Zumkeller, Nov 17 2013
    
  • Magma
    [Fibonacci(n+4)-(n+3): n in [0..40]]; // Vincenzo Librandi, Jun 23 2016
    
  • Maple
    A001924:=-1/(z**2+z-1)/(z-1)**2; # Conjectured by Simon Plouffe in his 1992 dissertation.
    ##
    a:= n-> (<<0|1|0|0>, <0|0|1|0>, <0|0|0|1>, <1|-1|-2|3>>^n.
             <<0, 1, 3, 7>>)[1, 1]:
    seq(a(n), n=0..40);  # Alois P. Heinz, Oct 05 2012
  • Mathematica
    a[n_]:= Fibonacci[n+4] -3-n; Array[a, 40, 0]  (* Robert G. Wilson v *)
    LinearRecurrence[{3,-2,-1,1},{0,1,3,7},40] (* Harvey P. Dale, Jan 24 2015 *)
    Nest[Accumulate,Fibonacci[Range[0,40]],2] (* Harvey P. Dale, Jun 15 2016 *)
  • PARI
    a(n)=fibonacci(n+4)-n-3 \\ Charles R Greathouse IV, Feb 24 2011
    
  • Sage
    [fibonacci(n+4) -n-3 for n in (0..40)] # G. C. Greubel, Jul 08 2019
    

Formula

From Wolfdieter Lang: (Start)
G.f.: x/((1-x-x^2)*(1-x)^2).
Convolution of natural numbers n >= 1 with Fibonacci numbers F(k).
a(n) = Fibonacci(n+4) - (3+n). (End)
From Henry Bottomley, Jan 03 2003: (Start)
a(n) = a(n-1) + a(n-2) + n = a(n-1) + A000071(n+2).
a(n) = A001891(n) - a(n-1) = n + A001891(n-1).
a(n) = A065220(n+4) + 1 = A000126(n+1) - 1. (End)
a(n) = Sum_{k=0..n} Sum_{i=0..k} Fibonacci(i). - Benoit Cloitre, Jan 26 2003
a(n) = (sqrt(5)/2 + 1/2)^n*(7*sqrt(5)/10 + 3/2) + (3/2 - 7*sqrt(5)/10)*(sqrt(5)/2 - 1/2)^n*(-1)^n - n - 3. - Paul Barry, Mar 26 2003
a(n) = Sum_{k=0..n} Fibonacci(k)*(n-k). - Benoit Cloitre, Jun 07 2004
A107909(a(n)) = A000225(n) = 2^n - 1. - Reinhard Zumkeller, May 28 2005
a(n) - a(n-1) = A101220(1,1,n). - Ross La Haye, May 31 2006
F(n) + a(n-3) = A133640(n). - Gary W. Adamson, Sep 19 2007
a(n) = A077880(-3-n) = 2*a(n-1) - a(n-3) + 1. - Michael Somos, Dec 31 2012
INVERT transform is A122595. PSUM transform is A014162. PSUMSIGN transform is A129696. BINOMIAL transform of A039834 with 0,1 prepended is this sequence. - Michael Somos, Dec 31 2012
a(n) = A228074(n+1,3) for n > 1. - Reinhard Zumkeller, Aug 15 2013
a(n) = Sum_{k=0..n} Sum_{i=0..n} i * C(n-k,k-i). - Wesley Ivan Hurt, Sep 21 2017
E.g.f.: exp(x/2)*(15*cosh(sqrt(5)*x/2) + 7*sqrt(5)*sinh(sqrt(5)*x/2))/5 - exp(x)*(3 + x). - Stefano Spezia, Jun 25 2022

Extensions

Description improved by N. J. A. Sloane, Jan 01 1997

A001610 a(n) = a(n-1) + a(n-2) + 1, with a(0) = 0 and a(1) = 2.

Original entry on oeis.org

0, 2, 3, 6, 10, 17, 28, 46, 75, 122, 198, 321, 520, 842, 1363, 2206, 3570, 5777, 9348, 15126, 24475, 39602, 64078, 103681, 167760, 271442, 439203, 710646, 1149850, 1860497, 3010348, 4870846, 7881195, 12752042, 20633238, 33385281, 54018520
Offset: 0

Views

Author

Keywords

Comments

For prime p, p divides a(p-1). - T. D. Noe, Apr 11 2009 [This result follows immediately from the fact that A032190(n) = (1/n)*Sum_{d|n} a(d-1)*phi(n/d). - Petros Hadjicostas, Sep 11 2017]
Generalization. If a(0,x)=0, a(1,x)=2 and, for n>=2, a(n,x)=a(n-1,x)+x*a(n-2,x)+1, then we obtain a sequence of polynomials Q_n(x)=a(n,x) of degree floor((n-1)/2), such that p is prime iff all coefficients of Q_(p-1)(x) are multiple of p (sf. A174625). Thus a(n) is the sum of coefficients of Q_(n-1)(x). - Vladimir Shevelev, Apr 23 2010
Odd composite numbers n such that n divides a(n-1) are in A005845. - Zak Seidov, May 04 2010; comment edited by N. J. A. Sloane, Aug 10 2010
a(n) is the number of ways to modify a circular arrangement of n objects by swapping one or more adjacent pairs. E.g., for 1234, new arrangements are 2134, 2143, 1324, 4321, 1243, 4231 (taking 4 and 1 to be adjacent) and a(4) = 6. - Toby Gottfried, Aug 21 2011
For n>2, a(n) equals the number of Markov equivalence classes with skeleton the cycle on n+1 nodes. See Theorem 2.1 in the article by A. Radhakrishnan et al. below. - Liam Solus, Aug 23 2018
From Gus Wiseman, Feb 12 2019: (Start)
For n > 0, also the number of nonempty subsets of {1, ..., n + 1} containing no two cyclically successive elements (cyclically successive means 1 succeeds n + 1). For example, the a(5) = 17 stable subsets are:
{1}, {2}, {3}, {4}, {5}, {6},
{1,3}, {1,4}, {1,5}, {2,4}, {2,5}, {2,6}, {3,5}, {3,6}, {4,6},
{1,3,5}, {2,4,6}.
(End)
Also the rank of the n-Lucas cube graph. - Eric W. Weisstein, Aug 01 2023

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • GAP
    List([0..40], n-> Lucas(1,-1,n+1)[2] -1); # G. C. Greubel, Jul 12 2019
  • Haskell
    a001610 n = a001610_list !! n
    a001610_list =
       0 : 2 : map (+ 1) (zipWith (+) a001610_list (tail a001610_list))
    -- Reinhard Zumkeller, Aug 21 2011
    
  • Magma
    I:=[0,2]; [n le 2 select I[n] else Self(n-1)+Self(n-2)+1: n in [1..40]]; // Vincenzo Librandi, Mar 20 2015
    
  • Magma
    [Lucas(n+1) -1: n in [0..40]]; // G. C. Greubel, Jul 12 2019
    
  • Mathematica
    t = {0, 2}; Do[AppendTo[t, t[[-1]] + t[[-2]] + 1], {n, 2, 40}]; t
    RecurrenceTable[{a[n] == a[n - 1] +a[n - 2] +1, a[0] == 0, a[1] == 2}, a, {n, 0, 40}] (* Robert G. Wilson v, Apr 13 2013 *)
    CoefficientList[Series[x (2 - x)/((1 - x - x^2) (1 - x)), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 20 2015 *)
    Table[Fibonacci[n] + Fibonacci[n + 2] - 1, {n, 0, 40}] (* Eric W. Weisstein, Feb 13 2018 *)
    LinearRecurrence[{2, 0, -1}, {2, 3, 6}, 20] (* Eric W. Weisstein, Feb 13 2018 *)
    Table[LucasL[n] - 1, {n, 20}] (* Eric W. Weisstein, Aug 01 2023 *)
    LucasL[Range[20]] - 1 (* Eric W. Weisstein, Aug 01 2023 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; -1,0,2]^n*[0;2;3])[1,1] \\ Charles R Greathouse IV, Sep 08 2016
    
  • PARI
    vector(40, n, f=fibonacci; f(n+1)+f(n-1)-1) \\ G. C. Greubel, Jul 12 2019
    
  • Sage
    [lucas_number2(n+1,1,-1) -1 for n in (0..40)] # G. C. Greubel, Jul 12 2019
    

Formula

a(n) = A000204(n)-1 = A000032(n+1)-1 = A000071(n+1) + A000045(n).
G.f.: x*(2-x)/((1-x-x^2)*(1-x)) = (2*x-x^2)/(1-2*x+x^3). [Simon Plouffe in his 1992 dissertation]
a(n) = F(n) + F(n+2) - 1 where F(n) is the n-th Fibonacci number. - Zerinvary Lajos, Jan 31 2008
a(n) = A014217(n+1) - A000035(n+1). - Paul Curtz, Sep 21 2008
a(n) = Sum_{i=1..floor((n+1)/2)} ((n+1)/i)*C(n-i,i-1). In more general case of polynomials Q_n(x)=a(n,x) (see our comment) we have Q_n(x) = Sum_{i=1..floor((n+1)/2)}((n+1)/i)*C(n-i,i-1)*x^(i-1). - Vladimir Shevelev, Apr 23 2010
a(n) = Sum_{k=0..n-1} Lucas(k), where Lucas(n) = A000032(n). - Gary Detlefs, Dec 07 2010
a(0)=0, a(1)=2, a(2)=3; for n>=3, a(n) = 2*a(n-1) - a(n-3). - George F. Johnson, Jan 28 2013
For n > 1, a(n) = A048162(n+1) + 3. - Toby Gottfried, Apr 13 2013
For n > 0, a(n) = A169985(n + 1) - 1. - Gus Wiseman, Feb 12 2019

A052841 Expansion of e.g.f.: 1/(exp(x)*(2-exp(x))).

Original entry on oeis.org

1, 0, 2, 6, 38, 270, 2342, 23646, 272918, 3543630, 51123782, 811316286, 14045783798, 263429174190, 5320671485222, 115141595488926, 2657827340990678, 65185383514567950, 1692767331628422662, 46400793659664205566, 1338843898122192101558, 40562412499252036940910
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

From Michael Somos, Mar 04 2004: (Start)
Stirling transform of A005359(n)=[0,2,0,24,0,720,...] is a(n)=[0,2,6,38,270,...].
Stirling transform of -(-1)^n*A052657(n-1)=[0,0,2,-6,48,-240,...] is a(n-1)=[0,0,2,6,38,270,...].
Stirling transform of -(-1)^n*A052558(n-1)=[1,-1,4,-12,72,-360,...] is a(n-1)=[1,0,2,6,38,270,...].
Stirling transform of 2*A052591(n)=[2,4,24,96,...] is a(n+1)=[2,6,38,270,...].
(End)
Also the central moments of a Geometric(1/2) random variable (for example the number of coin tosses until the first head). - Svante Janson, Dec 10 2012
Also the number of ordered set partitions of {1..n} with no cyclical adjacencies (successive elements in the same block, where 1 is a successor of n). - Gus Wiseman, Feb 13 2019
Also the number of ordered set partitions of {1..n} with an even number of blocks. - Geoffrey Critzer, Jul 04 2020

Examples

			From _Gus Wiseman_, Feb 13 2019: (Start)
The a(4) = 38 ordered set partitions with no cyclical adjacencies:
  {{1}{2}{3}{4}}  {{1}{24}{3}}  {{13}{24}}
  {{1}{2}{4}{3}}  {{1}{3}{24}}  {{24}{13}}
  {{1}{3}{2}{4}}  {{13}{2}{4}}
  {{1}{3}{4}{2}}  {{13}{4}{2}}
  {{1}{4}{2}{3}}  {{2}{13}{4}}
  {{1}{4}{3}{2}}  {{2}{4}{13}}
  {{2}{1}{3}{4}}  {{24}{1}{3}}
  {{2}{1}{4}{3}}  {{24}{3}{1}}
  {{2}{3}{1}{4}}  {{3}{1}{24}}
  {{2}{3}{4}{1}}  {{3}{24}{1}}
  {{2}{4}{1}{3}}  {{4}{13}{2}}
  {{2}{4}{3}{1}}  {{4}{2}{13}}
  {{3}{1}{2}{4}}
  {{3}{1}{4}{2}}
  {{3}{2}{1}{4}}
  {{3}{2}{4}{1}}
  {{3}{4}{1}{2}}
  {{3}{4}{2}{1}}
  {{4}{1}{2}{3}}
  {{4}{1}{3}{2}}
  {{4}{2}{1}{3}}
  {{4}{2}{3}{1}}
  {{4}{3}{1}{2}}
  {{4}{3}{2}{1}}
(End)
		

Crossrefs

Main diagonal of A122101.
Inverse binomial transform of A000670.

Programs

  • Magma
    R:=PowerSeriesRing(Rationals(), 40);
    Coefficients(R!(Laplace( Exp(-x)/(2-Exp(x)) ))); // G. C. Greubel, Jun 11 2024
    
  • Maple
    spec := [S,{B=Prod(C,C),C=Set(Z,1 <= card),S=Sequence(B)},labeled]: seq(combstruct[count](spec,size=n), n=0..20);
    P := proc(n,x) option remember; if n = 0 then 1 else
    (n*x+2*(1-x))*P(n-1,x)+x*(1-x)*diff(P(n-1,x),x); expand(%) fi end:
    A052841 := n -> subs(x=2, P(n,x)):
    seq(A052841(n), n=0..21); # Peter Luschny, Mar 07 2014
    h := n -> add(combinat:-eulerian1(n, k)*2^k, k=0..n):
    a := n -> (h(n)+(-1)^n)/2: seq(a(n), n=0..21); # Peter Luschny, Sep 19 2015
    b := proc(n, m) option remember; if n = 0 then 1 else
         (m - 1)*b(n - 1, m) + (m + 1)*b(n - 1, m + 1) fi end:
    a := n -> b(n, 0): seq(a(n), n = 0..21); # Peter Luschny, Jun 23 2023
  • Mathematica
    a[n_] := If[n == 0, 1, (PolyLog[-n, 1/2]/2 + (-1)^n)/2]; (* or *)
    a[n_] := HurwitzLerchPhi[1/2, -n, -1]/2; Table[a[n], {n, 0, 21}] (* Jean-François Alcover, Feb 19 2016, after Vladeta Jovovic *)
    With[{nn=30},CoefficientList[Series[1/(Exp[x](2-Exp[x])),{x,0,nn}],x] Range[ 0,nn]!] (* Harvey P. Dale, Apr 08 2019 *)
  • PARI
    a(n)=if(n<0,0,n!*polcoeff(subst(1/(1-y^2),y,exp(x+x*O(x^n))-1),n))
    
  • PARI
    {a(n)=polcoeff(sum(m=0,n,(2*m)!*x^(2*m)/prod(k=1,2*m,1-k*x+x*O(x^n))),n)} /* Paul D. Hanna, Jul 20 2011 */
    
  • SageMath
    def A052841_list(prec):
        P. = PowerSeriesRing(QQ, prec)
        return P( exp(-x)/(2-exp(x)) ).egf_to_ogf().list()
    A052841_list(40) # G. C. Greubel, Jun 11 2024

Formula

O.g.f.: Sum_{n>=0} (2*n)! * x^(2*n) / Product_{k=1..2*n} (1-k*x). - Paul D. Hanna, Jul 20 2011
a(n) = (A000670(n) + (-1)^n)/2 = Sum_{k>=0} (k-1)^n/2^(k+1). - Vladeta Jovovic, Feb 02 2003
Also, a(n) = Sum_{k=0..[n/2]} (2k)!*Stirling2(n, 2k). - Ralf Stephan, May 23 2004
a(n) = D^n*(1/(1-x^2)) evaluated at x = 0, where D is the operator (1+x)*d/dx. Cf. A000670 and A005649. - Peter Bala, Nov 25 2011
E.g.f.: 1/(2*G(0)), where G(k) = 1 - 2^k/(2 - 4*x/(2*x - 2^k*(k+1)/G(k+1) )); (recursively defined continued fraction). - Sergei N. Gladkovskii, Dec 22 2012
a(n) ~ n!/(4*(log(2))^(n+1)). - Vaclav Kotesovec, Aug 10 2013
a(n) = (h(n)+(-1)^n)/2 where h(n) = Sum_{k=0..n} E(n,k)*2^k and E(n,k) the Eulerian numbers A173018 (see also A156365). - Peter Luschny, Sep 19 2015
a(n) = (-1)^n + Sum_{k=0..n-1} binomial(n,k) * a(k). - Ilya Gutkovskiy, Jun 11 2020

Extensions

Edited by N. J. A. Sloane, Sep 06 2013

A169985 Round phi^n to the nearest integer.

Original entry on oeis.org

1, 2, 3, 4, 7, 11, 18, 29, 47, 76, 123, 199, 322, 521, 843, 1364, 2207, 3571, 5778, 9349, 15127, 24476, 39603, 64079, 103682, 167761, 271443, 439204, 710647, 1149851, 1860498, 3010349, 4870847, 7881196, 12752043, 20633239, 33385282, 54018521, 87403803
Offset: 0

Views

Author

N. J. A. Sloane, Sep 26 2010

Keywords

Comments

Phi = (1+sqrt(5))/2, see A001622.
a(n) is the number of subsets of {1,2,...,n} with no two consecutive elements where n and 1 are considered to be consecutive. - Geoffrey Critzer, Sep 23 2013
Equals the Lucas sequence beginning at 1 (A000204) with 2 inserted between 1 and 3.
The Lucas sequence beginning at 2 (A000032) can be written as L(n) = phi^n + (-1/phi)^n. Since |(-1/phi)^n|<1/2 for n>1, this sequence is {L(n)} (with the first two terms switched). As a consequence, for n>1: a(n) is obtained by rounding phi^n up for even n and down for odd n; a(n) is also the nearest integer to 1/|phi^n - a(n)|. - Danny Rorabaugh, Apr 15 2015

Examples

			a(4) = 7 because we have: {}, {1}, {2}, {3}, {4}, {1,3}, {2,4}. - _Geoffrey Critzer_, Sep 23 2013
		

Crossrefs

Programs

  • GAP
    Concatenation([1,2], List([2..40], n-> Lucas(1,-1,n)[2] )); # G. C. Greubel, Jul 09 2019
    
  • Magma
    [Round(Sqrt(Fibonacci(2*n) + 2*Fibonacci(2*n-1))): n in [0..40]]; // Vincenzo Librandi, Apr 16 2015
    
  • Mathematica
    nn=34; CoefficientList[Series[(1+x-x^3)/(1-x-x^2),{x,0,nn}],x] (* Geoffrey Critzer, Sep 23 2013 *)
    Round[GoldenRatio^Range[0,40]] (* Harvey P. Dale, Jul 13 2014 *)
    Table[If[n<=1, n+1, LucasL[n]], {n, 0, 40}] (* G. C. Greubel, Jul 09 2019 *)
  • PARI
    my(x='x+O('x^40)); Vec((1+x-x^3)/(1-x-x^2)) \\ G. C. Greubel, Feb 13 2019
    
  • Python
    from gmpy2 import isqrt, fib2
    def A169985(n): return int((m:=isqrt(k:=(lambda x:(x[1]<<1)+x[0])(fib2(n<<1))))+(k-m*(m+1)>=1)) # Chai Wah Wu, Jun 19 2024
  • Sage
    [round(golden_ratio^n) for n in range(40)] # Danny Rorabaugh, Apr 16 2015
    

Formula

O.g.f.: (1 + x - x^3)/(1 - x - x^2). - Geoffrey Critzer, Sep 23 2013
a(n) = round(sqrt(F(2n) + 2*F(2n-1))), for n >= 0, allowing F(-1) = 1. Also phi^n -> sqrt(F(2n) + 2*F(2n-1)), within < 0.02% by n = 4, therefore converging rapidly. - Richard R. Forberg, Jun 23 2014
For k > 0, a(2k) = A169986(2k) and a(2k+1) = A014217(2k+1). - Danny Rorabaugh, Apr 15 2015
For n > 1, a(n) = A001610(n - 1) + 1. - Gus Wiseman, Feb 12 2019
a(n) = A000032(n) for n>=2. - G. C. Greubel, Jul 09 2019

A124323 Triangle read by rows: T(n,k) is the number of partitions of an n-set having k singleton blocks (0<=k<=n).

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 1, 3, 0, 1, 4, 4, 6, 0, 1, 11, 20, 10, 10, 0, 1, 41, 66, 60, 20, 15, 0, 1, 162, 287, 231, 140, 35, 21, 0, 1, 715, 1296, 1148, 616, 280, 56, 28, 0, 1, 3425, 6435, 5832, 3444, 1386, 504, 84, 36, 0, 1, 17722, 34250, 32175, 19440, 8610, 2772, 840, 120, 45, 0, 1
Offset: 0

Views

Author

Emeric Deutsch, Oct 28 2006

Keywords

Comments

Row sums are the Bell numbers (A000110). T(n,0)=A000296(n). T(n,k) = binomial(n,k)*T(n-k,0). Sum(k*T(n,k),k=0..n) = A052889(n) = n*B(n-1), where B(q) are the Bell numbers (A000110).
Exponential Riordan array [exp(exp(x)-1-x),x]. - Paul Barry, Apr 23 2009
Sum_{k=0..n} T(n,k)*2^k = A000110(n+1) is the number of binary relations on an n-set that are both symmetric and transitive. - Geoffrey Critzer, Jul 25 2014
Also the number of set partitions of {1, ..., n} with k cyclical adjacencies (successive elements in the same block, where 1 is a successor of n). Unlike A250104, we count {{1}} as having 1 cyclical adjacency. - Gus Wiseman, Feb 13 2019

Examples

			T(4,2)=6 because we have 12|3|4, 13|2|4, 14|2|3, 1|23|4, 1|24|3 and 1|2|34 (if we take {1,2,3,4} as our 4-set).
Triangle starts:
     1
     0    1
     1    0    1
     1    3    0    1
     4    4    6    0    1
    11   20   10   10    0    1
    41   66   60   20   15    0    1
   162  287  231  140   35   21    0    1
   715 1296 1148  616  280   56   28    0    1
  3425 6435 5832 3444 1386  504   84   36    0    1
From _Gus Wiseman_, Feb 13 2019: (Start)
Row n = 5 counts the following set partitions by number of singletons:
  {{1234}}    {{1}{234}}  {{1}{2}{34}}  {{1}{2}{3}{4}}
  {{12}{34}}  {{123}{4}}  {{1}{23}{4}}
  {{13}{24}}  {{124}{3}}  {{12}{3}{4}}
  {{14}{23}}  {{134}{2}}  {{1}{24}{3}}
                          {{13}{2}{4}}
                          {{14}{2}{3}}
... and the following set partitions by number of cyclical adjacencies:
  {{13}{24}}      {{1}{2}{34}}  {{1}{234}}  {{1234}}
  {{1}{24}{3}}    {{1}{23}{4}}  {{12}{34}}
  {{13}{2}{4}}    {{12}{3}{4}}  {{123}{4}}
  {{1}{2}{3}{4}}  {{14}{2}{3}}  {{124}{3}}
                                {{134}{2}}
                                {{14}{23}}
(End)
From _Paul Barry_, Apr 23 2009: (Start)
Production matrix is
0, 1,
1, 0, 1,
1, 2, 0, 1,
1, 3, 3, 0, 1,
1, 4, 6, 4, 0, 1,
1, 5, 10, 10, 5, 0, 1,
1, 6, 15, 20, 15, 6, 0, 1,
1, 7, 21, 35, 35, 21, 7, 0, 1,
1, 8, 28, 56, 70, 56, 28, 8, 0, 1 (End)
		

Crossrefs

A250104 is an essentially identical triangle, differing only in row 1.
For columns see A000296, A250105, A250106, A250107.

Programs

  • Maple
    G:=exp(exp(z)-1+(t-1)*z): Gser:=simplify(series(G,z=0,14)): for n from 0 to 11 do P[n]:=sort(n!*coeff(Gser,z,n)) od: for n from 0 to 11 do seq(coeff(P[n],t,k),k=0..n) od; # yields sequence in triangular form
    # Program from R. J. Mathar, Jan 22 2015:
    A124323 := proc(n,k)
        binomial(n,k)*A000296(n-k) ;
    end proc:
  • Mathematica
    Flatten[CoefficientList[Range[0,10]! CoefficientList[Series[Exp[x y] Exp[Exp[x] - x - 1], {x, 0,10}], x], y]] (* Geoffrey Critzer, Nov 24 2011 *)
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    Table[Length[Select[sps[Range[n]],Count[#,{}]==k&]],{n,0,9},{k,0,n}] (* _Gus Wiseman, Feb 13 2019 *)

Formula

T(n,k) = binomial(n,k)*[(-1)^(n-k)+sum((-1)^(j-1)*B(n-k-j), j=1..n-k)], where B(q) are the Bell numbers (A000110).
E.g.f.: G(t,z) = exp(exp(z)-1+(t-1)*z).
G.f.: 1/(1-xy-x^2/(1-xy-x-2x^2/(1-xy-2x-3x^2/(1-xy-3x-4x^2/(1-... (continued fraction). - Paul Barry, Apr 23 2009

A080107 Number of fixed points of permutation of SetPartitions under {1,2,...,n}->{n,n-1,...,1}. Number of symmetric arrangements of non-attacking rooks on upper half of n X n chessboard.

Original entry on oeis.org

1, 1, 2, 3, 7, 12, 31, 59, 164, 339, 999, 2210, 6841, 16033, 51790, 127643, 428131, 1103372, 3827967, 10269643, 36738144, 102225363, 376118747, 1082190554, 4086419601, 12126858113, 46910207114, 143268057587, 566845074703, 1778283994284, 7186474088735
Offset: 0

Views

Author

Wouter Meeussen, Mar 15 2003

Keywords

Comments

Even-numbered terms a(2k) are A002872: 2,7,31,164,999 ("Sorting numbers"); odd-numbered terms are its binomial transform, A080337. The symmetrical set partitions of {-n,...,-1,0,1,...,n} can be classified by the partition containing 0. Thus we get the sum over k of {n choose k} times the number of symmetrical set partitions of 2n-2k elements. - Don Knuth, Nov 23 2003
Number of partitions of n numbers that are symmetrical and cannot be nested (i.e., include a pattern of the form abab). - Douglas Boffey, May 21 2015
Number of achiral color patterns in a row or loop of length n. Two color patterns are equivalent if the colors are permuted. - Robert A. Russell, Apr 23 2018
Also the number of self-complementary set partitions of {1, ..., n}. The complement of a set partition pi of {1, ..., n} is defined as n + 1 - pi (elementwise) on page 3 of Callan. For example, the complement of {{1,5},{2},{3,6},{4}} is {{1,4},{2,6},{3},{5}}. - Gus Wiseman, Feb 13 2019

Examples

			Of the set partitions of 4, the following 7 are invariant under 1->4, 2->3, 3->2, 4->1: {{1,2,3,4}}, {{1,2},{3,4}}, {{1,4},{2,3}}, {{1,3},{2,4}}, {{1},{2,3},{4}}, {{1,4},{2},{3}}, {{1},{2},{3},{4}}, so a(4)=7.
For a(4)=7, the row patterns are AAAA, AABB, ABAB, ABBA, ABBC, ABCA, and ABCD (same as previous example).  The loop patterns are AAAA, AAAB, AABB, AABC, ABAB, ABAC, and ABCD. - _Robert A. Russell_, Apr 23 2018
From _Gus Wiseman_, Feb 13 2019: (Start)
The a(1) = 1 through a(5) = 12 self-complementary set partitions:
  {{1}}  {{12}}    {{123}}      {{1234}}        {{12345}}
         {{1}{2}}  {{13}{2}}    {{12}{34}}      {{1245}{3}}
                   {{1}{2}{3}}  {{13}{24}}      {{135}{24}}
                                {{14}{23}}      {{15}{234}}
                                {{1}{23}{4}}    {{1}{234}{5}}
                                {{14}{2}{3}}    {{12}{3}{45}}
                                {{1}{2}{3}{4}}  {{135}{2}{4}}
                                                {{14}{25}{3}}
                                                {{15}{24}{3}}
                                                {{1}{24}{3}{5}}
                                                {{15}{2}{3}{4}}
                                                {{1}{2}{3}{4}{5}}
(End)
		

References

  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.5 (p. 765).

Crossrefs

Programs

  • Mathematica
    < Range[n, 1, -1]]; t= 1 + RankSetPartition /@ t; t= ToCycles[t]; t= Cases[t, {_Integer}]; Length[t], {n, 7}]
    (* second program: *)
    QB[n_, q_] := QB[n, q] = Sum[QB[j, q] QBinomial[n-1, j, q], {j, 0, n-1}] // FunctionExpand // Simplify; QB[0, q_]=1; QB[1, q_]=1; Table[cc = CoefficientList[QB[n, q], q]; cc.Table[(-1)^(k+1), {k, 1, Length[cc]}], {n, 0, 30}] (* Jean-François Alcover, Feb 29 2016, after Paul D. Hanna *)
    (* Ach[n, k] is the number of achiral color patterns for a row or loop of n
      colors containing exactly k different colors *)
    Ach[n_, k_] := Ach[n, k] = If[n<2, Boole[n==k && n>=0],
      k Ach[n-2, k] + Ach[n-2, k-1] + Ach[n-2, k-2]]
    Table[Sum[Ach[n, k], {k, 0, n}], {n, 0, 30}] (* Robert A. Russell, Apr 23 2018 *)
    x[n_] := x[n] = If[n < 2, n+1, 2x[n-1] + (n-1)x[n-2]]; (* A005425 *)
    Table[Sum[StirlingS2[Ceiling[n/2], k] x[k-Mod[n, 2]], {k, 0, Ceiling[n/2]}],
      {n, 0, 30}] (* Robert A. Russell, Apr 27 2018, after Knuth reference *)

Formula

Knuth gives recurrences and generating functions.
a(n) = Sum_{k=0..t(n)} (-1)^k*A125810(n,k) where A125810 is a triangle of coefficients for a q-analog of the Bell numbers and t(n)=A125811(n)-1. - Paul D. Hanna, Jan 19 2009
From Robert A. Russell, Apr 23 2018: (Start)
a(n) = Sum_{k=0..n} Ach(n,k) where
Ach(n,k) = [n>1]*(k*Ach(n-2,k)+Ach(n-2,k-1)+Ach(n-2,k-2)) + [n<2]*[n==k]*[n>=0].
a(n) = 2*A103293(n+1) - A000110(n). (End)
a(n) = [n==0 mod 2]*Sum_{k=0..n/2} Stirling2(n/2, k)*A005425(k) + [n==1 mod 2] * Sum_{k=1..(n+1)/2} Stirling2((n+1)/2, k) * A005425(k-1). (from Knuth reference)
a(n) = 2*A084708(n) - A084423(n). - Robert A. Russell, Apr 27 2018

Extensions

Offset set to 0 by Alois P. Heinz, May 23 2015

A066982 a(n) = Lucas(n+1) - (n+1).

Original entry on oeis.org

1, 1, 3, 6, 12, 22, 39, 67, 113, 188, 310, 508, 829, 1349, 2191, 3554, 5760, 9330, 15107, 24455, 39581, 64056, 103658, 167736, 271417, 439177, 710619, 1149822, 1860468, 3010318, 4870815, 7881163, 12752009, 20633204, 33385246, 54018484, 87403765, 141422285
Offset: 1

Views

Author

Benoit Cloitre, Jan 27 2002

Keywords

Comments

From Gus Wiseman, Feb 12 2019: (Start)
Also the number of ways to split an (n + 1)-cycle into nonempty connected subgraphs with no singletons. For example, the a(1) = 1 through a(5) = 12 partitions are:
{{12}} {{123}} {{1234}} {{12345}} {{123456}}
{{12}{34}} {{12}{345}} {{12}{3456}}
{{14}{23}} {{123}{45}} {{123}{456}}
{{125}{34}} {{1234}{56}}
{{145}{23}} {{1236}{45}}
{{15}{234}} {{1256}{34}}
{{126}{345}}
{{1456}{23}}
{{156}{234}}
{{16}{2345}}
{{12}{34}{56}}
{{16}{23}{45}}
Also the number of non-singleton subsets of {1, ..., (n + 1)} with no cyclically successive elements (cyclically successive means 1 succeeds n + 1). For example, the a(1) = 1 through a(5) = 12 subsets are:
{} {} {} {} {}
{1,3} {1,3} {1,3}
{2,4} {1,4} {1,4}
{2,4} {1,5}
{2,5} {2,4}
{3,5} {2,5}
{2,6}
{3,5}
{3,6}
{4,6}
{1,3,5}
{2,4,6}
(End)

Crossrefs

Programs

  • GAP
    List([1..40], n-> Lucas(1,-1,n+1)[2] -n-1); # G. C. Greubel, Jul 09 2019
  • Magma
    [Lucas(n+1)-n-1: n in [1..40]]; // G. C. Greubel, Jul 09 2019
    
  • Mathematica
    a[1]=a[2]=1; a[n_]:= a[n] = a[n-1] +a[n-2] +n-2; Table[a[n], {n, 40}]
    LinearRecurrence[{3, -2, -1, 1}, {1, 1, 3, 6}, 40] (* Vladimir Joseph Stephan Orlovsky, Feb 13 2012 *)
    Table[LucasL[n+1]-n-1, {n, 40}] (* Vladimir Reshetnikov, Sep 15 2016 *)
    CoefficientList[Series[(1-2*x+2*x^2)/((1-x)^2*(1-x-x^2)), {x, 0, 40}], x] (* L. Edson Jeffery, Sep 28 2017 *)
  • PARI
    vector(40, n, my(f=fibonacci); f(n+2)+f(n)-n-1) \\ G. C. Greubel, Jul 09 2019
    
  • Sage
    [lucas_number2(n+1,1,-1) -n-1 for n in (1..40)] # G. C. Greubel, Jul 09 2019
    

Formula

a(1) = a(2) = 1, a(n + 2) = a(n + 1) + a(n) + n.
For n > 2, a(n) = floor(phi^(n+1) - (n+1)) + (1-(-1)^n)/2.
From Colin Barker, Jun 30 2012: (Start)
a(n) = 3*a(n-1) - 2*a(n-2) - a(n-3) + a(n-4).
G.f.: x*(1-2*x+2*x^2)/((1-x)^2*(1-x-x^2)). (End)
a(n) is the sum of the n-th antidiagonal of A352744 (assuming offset 0). - Peter Luschny, Nov 16 2023

Extensions

Corrected and extended by Harvey P. Dale, Feb 08 2002

A065220 a(n) = Fibonacci(n) - n.

Original entry on oeis.org

0, 0, -1, -1, -1, 0, 2, 6, 13, 25, 45, 78, 132, 220, 363, 595, 971, 1580, 2566, 4162, 6745, 10925, 17689, 28634, 46344, 75000, 121367, 196391, 317783, 514200, 832010, 1346238, 2178277, 3524545, 5702853, 9227430, 14930316, 24157780, 39088131, 63245947, 102334115, 165580100, 267914254
Offset: 0

Views

Author

Henry Bottomley, Oct 22 2001

Keywords

Comments

E(n) = Fib(n+4)-(n+4): cost of maximum height Huffman tree of size n for Fibonacci sequence (Fibonacci sequence is minimizing absolutely ordered sequence of Huffman tree). - Alex Vinokur (alexvn(AT)barak-online.net), Oct 26 2004

References

  • Vinokur A.B, Huffman trees and Fibonacci numbers, Kibernetika Issue 6 (1986) 9-12 (in Russian); English translation in Cybernetics 21, Issue 6 (1986), 692-696.

Crossrefs

Programs

  • GAP
    List([0..50], n-> Fibonacci(n) - n); # G. C. Greubel, Jul 09 2019
  • Haskell
    a065220 n = a065220_list !! n
    a065220_list = zipWith (-) a000045_list [0..]
    -- Reinhard Zumkeller, Nov 06 2012
    
  • Magma
    [Fibonacci(n) - n: n in [0..50]]; // G. C. Greubel, Jul 09 2019
    
  • Maple
    a[0]:=0:a[1]:=1:for n from 2 to 50 do a[n]:=a[n-1]+a[n-2] od: seq(a[n]-n, n=0..42); # Zerinvary Lajos, Mar 20 2008
  • Mathematica
    lst={};Do[f=Fibonacci[n]-n;AppendTo[lst,f],{n,0,5!}];lst (* Vladimir Joseph Stephan Orlovsky, Mar 21 2009 *)
    Table[Fibonacci[n]-n,{n,0,50}] (* or *) LinearRecurrence[{3,-2,-1,1},{0,0,-1,-1},50] (* Harvey P. Dale, May 29 2017 *)
  • PARI
    a(n) = { fibonacci(n) - n } \\ Harry J. Smith, Oct 14 2009
    
  • Sage
    [fibonacci(n) - n for n in (0..50)] # G. C. Greubel, Jul 09 2019
    

Formula

a(n) = A000045(n) - A001477(n) = A000126(n-3) - 2 = A001924(n-4) - 1.
a(n) = a(n-1) + a(n-2) + n - 3 = a(n-1) + A000071(n-2).
G.f.: x^2*(2x-1)/((1-x-x^2)*(1-x)^2).
a(n) = Sum_{i=0..n} (i - 2)*F(n-i) for F(n) the Fibonacci sequence A000045. - Greg Dresden, Jun 01 2022

A324011 Number of set partitions of {1, ..., n} with no singletons or cyclical adjacencies (successive elements in the same block, where 1 is a successor of n).

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 5, 14, 66, 307, 1554, 8415, 48530, 296582, 1913561, 12988776, 92467629, 688528288, 5349409512, 43270425827, 363680219762, 3170394634443, 28619600156344, 267129951788160, 2574517930001445, 25587989366964056, 261961602231869825
Offset: 0

Views

Author

Gus Wiseman, Feb 12 2019

Keywords

Comments

These set partitions are fixed points under Callan's bijection phi on set partitions.

Examples

			The a(4) = 1, a(6) = 5, and a(7) = 14 set partitions:
  {{13}{24}}  {{135}{246}}    {{13}{246}{57}}
              {{13}{25}{46}}  {{13}{257}{46}}
              {{14}{25}{36}}  {{135}{26}{47}}
              {{14}{26}{35}}  {{135}{27}{46}}
              {{15}{24}{36}}  {{136}{24}{57}}
                              {{136}{25}{47}}
                              {{14}{257}{36}}
                              {{14}{26}{357}}
                              {{146}{25}{37}}
                              {{146}{27}{35}}
                              {{15}{246}{37}}
                              {{15}{247}{36}}
                              {{16}{24}{357}}
                              {{16}{247}{35}}
		

Crossrefs

Cf. A000110, A000126, A000296 (singletons allowed, or adjacencies allowed), A001610, A124323, A169985, A261139, A324012, A324014, A324015.

Programs

  • Mathematica
    Table[Select[sps[Range[n]],And[Count[#,{_}]==0,Total[If[First[#]==1&&Last[#]==n,1,0]+Count[Subtract@@@Partition[#,2,1],-1]&/@#]==0]&]//Length,{n,0,10}]

Extensions

a(11)-a(26) from Alois P. Heinz, Feb 12 2019
Showing 1-10 of 41 results. Next