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-5 of 5 results.

A212804 Expansion of (1 - x)/(1 - x - x^2).

Original entry on oeis.org

1, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 832040, 1346269, 2178309, 3524578, 5702887, 9227465, 14930352, 24157817, 39088169, 63245986, 102334155, 165580141, 267914296, 433494437, 701408733, 1134903170, 1836311903, 2971215073, 4807526976
Offset: 0

Views

Author

N. J. A. Sloane, May 27 2012, following a suggestion from R. K. Guy

Keywords

Comments

A variant of the Fibonacci number A000045.
Number of compositions of n into parts >= 2. - Joerg Arndt, Aug 13 2012
From Petros Hadjicostas, Jan 08 2019: (Start)
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.
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.
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. (End)

Examples

			From _Petros Hadjicostas_, Jan 08 2019: (Start)
For n = 6, we have a(6) = 5. The binary necklaces of length n+1 = 7 with exactly one occurrence of 00 are as follows: 0011111, 0010111, 0011011, 0011101, and 0010101.
The corresponding cyclic compositions of n+1 = 7 with exactly one 1 (under MacMahon's bijection) are as follows: 1+6, 1+2+4, 1+3+3, 1+4+2, 1+2+2+2.
Of course, removing the 1 from the cyclic composition, we get a (linear) composition of n = 6 with parts >= 2 (as stated above by _Joerg Arndt_): 6, 2+4, 3+3, 4+2, 2+2+2. (For linear compositions, 2+4 is not the same as 4+2.) (End)
		

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 84.

Crossrefs

Cf. A000045, A105809 (alternating row sums).
Column k=1 of A320341.

Programs

Formula

G.f.: 1/(1 - (Sum_{k >= 2} x^k)). - Joerg Arndt, Aug 13 2012
a(n) = Fibonacci(n+1) - Fibonacci(n). - Arkadiusz Wesolowski, Oct 29 2012
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
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
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
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
a(n) = Sum_{k=0..n} (C(k, n-k) - C(k, n-k-1)). - Peter Luschny, Oct 01 2014
a(n) = (2^(-1-n)*((1 - sqrt(5))^n*(1 + sqrt(5)) + (-1 + sqrt(5))*(1 + sqrt(5))^n))/sqrt(5). - Colin Barker, Sep 25 2016
a(n) = A000045(n-1), n >= 1. - R. J. Mathar, Apr 14 2018
E.g.f.: exp((1 - sqrt(5))*x/2)*(3 + sqrt(5) + 2*exp(sqrt(5)*x))/(5 + sqrt(5)). - Stefano Spezia, Mar 09 2025

A000358 Number of binary necklaces of length n with no subsequence 00, excluding the necklace "0".

Original entry on oeis.org

1, 2, 2, 3, 3, 5, 5, 8, 10, 15, 19, 31, 41, 64, 94, 143, 211, 329, 493, 766, 1170, 1811, 2787, 4341, 6713, 10462, 16274, 25415, 39651, 62075, 97109, 152288, 238838, 375167, 589527, 927555, 1459961, 2300348, 3626242, 5721045, 9030451, 14264309, 22542397, 35646312, 56393862, 89264835, 141358275
Offset: 1

Views

Author

Keywords

Comments

a(n) is also the number of inequivalent compositions of n into parts 1 and 2 where two compositions are considered to be equivalent if one is a cyclic rotation of the other. a(6)=5 because we have: 2+2+2, 2+2+1+1, 2+1+2+1, 2+1+1+1+1, 1+1+1+1+1+1. - Geoffrey Critzer, Feb 01 2014
Moebius transform is A006206. - Michael Somos, Jun 02 2019

Examples

			G.f. = x + 2*x^2 + 2*x^3 + 3*x^4 + 3*x^5 + 5*x^6 + 5*x^7 + 8*x^8 + 10*x^9 + ... - _Michael Somos_, Jun 02 2019
Binary necklaces are: 1; 01, 11; 011, 111; 0101, 0111, 1111; 01010, 01011, 01111. - _Michael Somos_, Jun 02 2019
		

References

  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 499.
  • T. Helleseth and A. Kholosha, Bent functions and their connections to combinatorics, in Surveys in Combinatorics 2013, edited by Simon R. Blackburn, Stefanie Gerke, Mark Wildon, Camb. Univ. Press, 2013.

Crossrefs

Column k=0 of A320341.

Programs

  • Maple
    A000358 := proc(n) local sum; sum := 0; for d in divisors(n) do sum := sum + phi(n/d)*(fibonacci(d+1)+fibonacci(d-1)) od; RETURN(sum/n); end;
    with(combstruct); spec := {A=Union(zero,Cycle(one),Cycle(Prod(zero,Sequence(one,card>0)))),one=Atom,zero=Atom}; seq(count([A,spec,unlabeled],size=i),i=1..30);
  • Mathematica
    nn=48;Drop[Map[Total,Transpose[Map[PadRight[#,nn]&,Table[ CoefficientList[ Series[CycleIndex[CyclicGroup[n],s]/.Table[s[i]->x^i+x^(2i),{i,1,n}],{x,0,nn}],x],{n,0,nn}]]]],1] (* Geoffrey Critzer, Feb 01 2014 *)
    max = 50; B[x_] := x*(1+x); A = Sum[EulerPhi[k]/k*Log[1/(1-B[x^k])], {k, 1, max}]/x + O[x]^max; CoefficientList[A, x] (* Jean-François Alcover, Feb 08 2016, after Joerg Arndt *)
    Table[1/n * Sum[EulerPhi[n/d] Total@ Map[Fibonacci, d + # & /@ {-1, 1}], {d, Divisors@ n}], {n, 47}] (* Michael De Vlieger, Dec 28 2016 *)
    a[ n_] := If[ n < 1, 0, DivisorSum[n, EulerPhi[n/#] LucasL[#] &]/n]; (* Michael Somos, Jun 02 2019 *)
  • PARI
    N=66;  x='x+O('x^N);
    B(x)=x*(1+x);
    A=sum(k=1, N, eulerphi(k)/k*log(1/(1-B(x^k))));
    Vec(A)
    /* Joerg Arndt, Aug 06 2012 */
    
  • PARI
    {a(n) = if( n<1, 0, sumdiv(n, d, eulerphi(n/d) * (fibonacci(d+1) + fibonacci(d-1)))/n)}; /* Michael Somos, Jun 02 2019 */
    
  • Python
    from sympy import totient, lucas, divisors
    def A000358(n): return (n&1^1)+sum(totient(n//k)*(lucas(k)-((k&1^1)<<1)) for k in divisors(n,generator=True))//n # Chai Wah Wu, Sep 23 2023

Formula

a(n) = (1/n) * Sum_{ d divides n } totient(n/d) [ Fib(d-1)+Fib(d+1) ].
G.f.: Sum_{k>=1} phi(k)/k * log( 1/(1-B(x^k)) ) where B(x)=x*(1+x). - Joerg Arndt, Aug 06 2012
a(n) ~ ((1+sqrt(5))/2)^n / n. - Vaclav Kotesovec, Sep 12 2014
a(n) = Sum_{0 <= i <= ceiling((n-1)/2)} [ (1/(n - i)) * Sum_{d|gcd(i, n-i)} phi(d) * binomial((n - i)/d, i/d) ]. (This is DeFord's formula for the number of distinct Lucas tilings of a 1 X n bracelet up to symmetry, even though in the paper he refers to sequence A032192(n) = a(n) - 1.) - Petros Hadjicostas, Jun 07 2019

A105422 Triangle read by rows: T(n,k) is the number of compositions of n having exactly k parts equal to 1.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 1, 2, 0, 1, 2, 2, 3, 0, 1, 3, 5, 3, 4, 0, 1, 5, 8, 9, 4, 5, 0, 1, 8, 15, 15, 14, 5, 6, 0, 1, 13, 26, 31, 24, 20, 6, 7, 0, 1, 21, 46, 57, 54, 35, 27, 7, 8, 0, 1, 34, 80, 108, 104, 85, 48, 35, 8, 9, 0, 1, 55, 139, 199, 209, 170, 125, 63, 44, 9, 10, 0, 1, 89, 240, 366, 404, 360
Offset: 0

Views

Author

Emeric Deutsch, Apr 07 2005

Keywords

Comments

T(n,k) is also the number of length n bit strings beginning with 0 having k singletons. Example: T(4,2)=3 because we have 0010, 0100 and 0110. - Emeric Deutsch, Sep 21 2008
The cyclic version of this array is A320341(n,k), which counts the (unmarked) cyclic compositions of n with exactly k parts equal to 1, with a minor exception for k=0. The sequence (A320341(n, k=0) - 1: n >= 1) counts the (unmarked) cyclic compositions of n with no parts equal to 1. - Petros Hadjicostas, Jan 08 2019
Also the convolution triangle of Fibonacci(n-2). # Peter Luschny, Oct 07 2022
T(n,k) is the number of length n+1 bit strings beginning and ending with 0 having k length 2 substrings 00. This is equivalent to the compositions interpretation because each m part corresponds to a length m+1 bit string beginning with 0 and ending with the next 0 bit. Thus a substring 00 corresponds to a 1 part. Example: T(4,2)=3 because we have 00010 for 112, 00100 for 121 and 01000 for 211. - Michael Somos, Sep 24 2024
In the Baccherini et al. 2008 link on page 81: "Bloom[3] studies the number of singles in all the 2^n n-length bit strings, where a single is any isolated 1 or 0, i.e., any run of length 1. Let R_{n,k} be the number of n-length bit strings beginning with 0 and having k singles." Here T(n,k) = R_{n,k}. This combinatorial interpretation is equivalent to my previous comment since a part of size k corresponds to run of k identical bits and also to a length k+1 bit string with 0s only at the beginning and end. - Michael Somos, Sep 25 2024

Examples

			T(6,2) = 9 because we have (1,1,4), (1,4,1), (4,1,1), (1,1,2,2), (1,2,1,2), (1,2,2,1), (2,1,1,2), (2,1,2,1) and (2,2,1,1).
Triangle begins:
00:    1;
01:    0,   1;
02:    1,   0,   1;
03:    1,   2,   0,   1;
04:    2,   2,   3,   0,   1;
05:    3,   5,   3,   4,   0,   1;
06:    5,   8,   9,   4,   5,   0,   1;
07:    8,  15,  15,  14,   5,   6,   0,   1;
08:   13,  26,  31,  24,  20,   6,   7,   0,  1;
09:   21,  46,  57,  54,  35,  27,   7,   8,  0,  1;
10:   34,  80, 108, 104,  85,  48,  35,   8,  9,  0,  1;
11:   55, 139, 199, 209, 170, 125,  63,  44,  9, 10,  0,  1;
12:   89, 240, 366, 404, 360, 258, 175,  80, 54, 10, 11,  0, 1;
13:  144, 413, 666, 780, 725, 573, 371, 236, 99, 65, 11, 12, 0, 1;
...
		

Crossrefs

Column 0 yields A000045 (the Fibonacci numbers). Column 1 yields A006367. Column 2 yields A105423. Row sums yield A011782. Cyclic version is A320341.
T(2n,n) gives A222763.

Programs

  • Maple
    G:=(1-z)/(1-z-z^2-t*z+t*z^2): Gser:=simplify(series(G,z=0,15)): P[0]:=1: for n from 1 to 14 do P[n]:=coeff(Gser,z^n) od: for n from 0 to 13 do seq(coeff(t*P[n],t^k),k=1..n+1) od; # yields sequence in triangular form
    # second Maple program:
    T:= proc(n) option remember; local j; if n=0 then 1
          else []; for j to n do zip((x, y)-> x+y, %,
          [`if`(j=1, 0, [][]), T(n-j)], 0) od; %[] fi
        end:
    seq(T(n), n=0..20);  # Alois P. Heinz, Nov 05 2012
    # Uses function PMatrix from A357368. Adds a row above and a column to the left.
    PMatrix(10, n -> combinat:-fibonacci(n-2)); # Peter Luschny, Oct 07 2022
  • Mathematica
    nn = 10; a = x/(1 - x) - x + y x;
    CoefficientList[CoefficientList[Series[1/(1 - a), {x, 0, nn}], x], y] // Flatten (* Geoffrey Critzer, Dec 23 2011 *)
    T[ n_, k_] := Which[k<0 || k>n, 0, n<2, Boole[n==k], True, T[n, k] =  T[n-1, k] + T[n-1, k-1] + T[n-2, k] - T[n-2, k-1] ]; (* Michael Somos, Sep 24 2024 *)
  • PARI
    {T(n, k) = if(k<0 || k>n, 0, n<2, n==k, T(n-1, k) + T(n-1, k-1) + T(n-2, k) - T(n-2, k-1) )}; /* Michael Somos, Sep 24 2024 */

Formula

G.f.: (1-z)/(1 - z - z^2 - tz + tz^2).
T(n,k) = T(n-1,k) + T(n-2,k) + T(n-1,k-1) - T(n-2,k-1), T(0,0)=1, T(1,0)=0. - Philippe Deléham, Nov 18 2009
If the triangle's columns are transposed into rows, then T(n,k) can be interpreted as the number of compositions of n+k having exactly k 1's. Then g.f.: ((1-x)/(1-x-x^2))^(k-1) and T(n,k) = T(n-2,k) + T(n-1,k) - T(n-1, k-1) + T(n, k-1). Also, Sum_{j=1..n} T(n-j, j) = 2^(n-1), the number of compositions of n. - Gregory L. Simay, Jun 28 2019

A119458 Triangle read by rows: T(n,k) is the number of (marked) circular binary words of length n having k occurrences of 00 (0 <= k <= n).

Original entry on oeis.org

1, 1, 1, 3, 0, 1, 4, 3, 0, 1, 7, 4, 4, 0, 1, 11, 10, 5, 5, 0, 1, 18, 18, 15, 6, 6, 0, 1, 29, 35, 28, 21, 7, 7, 0, 1, 47, 64, 60, 40, 28, 8, 8, 0, 1, 76, 117, 117, 93, 54, 36, 9, 9, 0, 1, 123, 210, 230, 190, 135, 70, 45, 10, 10, 0, 1, 199, 374, 440, 396, 286, 187, 88, 55, 11, 11, 0, 1
Offset: 0

Views

Author

Emeric Deutsch, May 20 2006

Keywords

Comments

Sum of entries in row n is 2^n (A000079).
In Carlitz and Scoville (p. 252) the first term is 2.
From Petros Hadjicostas, Jan 05 2019: (Start)
Note that T(n,k) is the number of marked circular binary words of length n having k occurrences of 00 (0 <= k <= n). Let W(n,k) be the number of binary necklaces (= unmarked circular binary words) of length n with exactly k occurrences of the pattern 00 provided wrapping around the circle is allowed when n=1. More precisely, when n=1, we allow the string to wrap around itself on the circle to form a circular string of length 2. We have W(n, k) = A320341(n, k) for 0 <= k <= n.
Fortunately, since T(n=1, k=0) = 1 = T(n=1, k=1), the author of the sequence (indirectly) assumes that the string 0 has one occurrence of the pattern 00 (if allowed to wrap around itself on the circle only once), while the string 1 has zero occurrences of the pattern 00.
It makes sense to define T(n,k) = 0 when k > n. Note that G(z,t) = Sum_{n,k >=0} T(n,k)*z^n*t^k = 1 - z*(d(1-A(z,t))/dz)/(1-A(z,t)), where A(z,t) = z*(t+1) + z^2*(1-t) is the "Flajolet-Soria polynomial (g.f.)" in z of some (difficult to find) linear combinatorial structure that is defined very abstractly at the beginning of their paper and in the book by Flajolet and Sedgewick (2009). (Since the series here converge for z and t close to 0, we have that 1-t is positive for all t in a "small" interval around 0.)
Using the theory in Flajolet and Soria (1991) and the one in Hadjicostas and Zhang (2018), we can prove that the g.f. of the numbers W(n,k) is F(z,t) = Sum_{n >= 1, k >= 0} W(n,k)*z^n*t^k = -Sum_{d>=1} (phi(d)/d)*log(1-A(z^d,t^d)). We can also prove that W(n,k) = (1/n)*Sum_{d|gcd(n,k)} phi(d)*T(n/d, k/d) for n>=1 and 0 <= k <= n. (We omit the details.)
For k=0, we get that T(n, k=0) = A000204(n) and W(n, k=0) = A000358(n) for n >= 1, and the Flajolet-Soria polynomial is A(z,t=0) = z + z^2 (which was discovered by Joerg Arndt).
To get univariate g.f.'s of the sequences (T(n,k): n >= 1) and (W(n, k): n >= 1) when k >= 1, we have to differentiate the previous two g.f.'s k times with respect to t, set t=0, and divide by k!. (Obviously, the log now disappears.)
For k=1, we get T(n, k=1) = A006490(n) and W(n, k=1) = A212804(n-1) = A006490(n)/n for n >= 1.
For k=2, we get T(n, k=2) = A006491(n-1) for n >= 1 (with A006491(0) := 0) and W(n, k=2) = (1/n)*(T(n,2) + I(2|n)*T(n/2,1)) for n >= 1, where I(2|n) = 1 if 2|n, and 0 otherwise.
For k=3, we get T(n, k=3) = A006492(n-2) for n >=1 (with A006492(m) = 0 for m = 1,2) and W(n, k=3) = (1/n)*(T(n,3) + 2*I(3|n)*T(n/3, 1)) for n >= 1.
This theory can be generalized for any pattern P of 0's and 1's provided one discovers the correct "Flajolet-Soria" polynomial A_P(z,t). In other words, if P is a finite pattern of zeros and ones of length L, and we let T_P(n,k) be the number of (marked) circular binary words of length n having k occurrences of P (0 <= k <= n) and we allow strings of length n, with 1 <= n < L, to wrap around themselves on the circle to form a string of length n*ceiling(L/n), then (most probably) we can express the g.f. of T_p(n,k), say G_p(z,t), in the form 1-z*(d(1-A_P(z,t))/dz)/(1-A_P(z,t)). In such a case, if W_P(n,k) is the number of binary necklaces (= unmarked circular binary words) of length n with exactly k occurrences of the pattern P, we have that its generating function is Sum_{n >= 1, k >= 0} W_P(n,k)*z^n*t^k = -Sum_{d>=1} (phi(d)/d)*log(1-A_P(z^d,t^d)). We can also prove that W_P(n,k) = (1/n)*Sum_{d|gcd(n,k)} phi(d)*T_P(n/d, k/d) for n>=1 and 0 <= k <= n.
One final note: it seems that the theory of Flajolet and Soria (1991) applies only to the case k=0 and to the case we consider all k simultaneously. (For fixed k >= 2, W_P(n,k) depends not only on T_P(n,k), but also on all T(n/d, k/d) where d ranges over the common divisors of n and k. Thus, for fixed k >= 2, it seems there is no linear combinatorial structure whose list of cycles of elements corresponds to the collection of necklaces we want.) See also Flajolet and Sedgewick (2009), pp. 84-85 and 729-730.
(End)

Examples

			T(5,3) = 5 because we have 10000, 01000, 00100, 00010 and 00001.
Triangle for T(n,k) begins:
n=0:    1;
n=1:    1,   1;
n=2:    3,   0,   1;
n=3:    4,   3,   0,   1;
n=4:    7,   4,   4,   0,   1;
n=5:   11,  10,   5,   5,   0,  1
n=6:   18,  18,  15,   6,   6,  0,  1;
n=7:   29,  35,  28,  21,   7,  7,  0,  1;
n=8:   47,  64,  60,  40,  28,  8,  8,  0,  1;
n=9:   76, 117, 117,  93,  54, 36,  9,  9,  0, 1;
n=10: 123, 210, 230, 190, 135, 70, 45, 10, 10, 0, 1;
  ...
From _Petros Hadjicostas_, Jan 06 2019: (Start)
If we take the Taylor expansion of g.f. G(z,t) of T(n,k) around z=0, we get G(z,t) = 1 + (1+t)*z + (3+0*t+t^2)*z^2 + (4+3*t+0*t^2+t^3)*z^3 + (7+4*t+4*t^2+0*t^3+t^4)*z^4 +(11+10*t+5*t^2+5*t^3+0*t^4+t^5)*z^5 + ...
One the other hand, if we take the Taylor expansion of the g.f. F(z,t) of W(n,k) = A320341(n, k) around z=0, we get F(z,t) = (1+t)*z + (2+0*t+t^2)*z^2 + (2+t+0*t^2+t^3)*z^3 + (3+t+t^2+0*t^3+t^4)*z^4 + (3+2*t+t^2+t^3+0*t^4+t^5)*z^5 + ...
Triangle for W(n,k) begins:
n=1:    1,  1;
n=2:    2,  0,  1;
n=3:    2,  1,  0,  1;
n=4:    3,  1,  1,  0,  1;
n=5:    3,  2,  1,  1,  0,  1;
n=6:    5,  3,  3,  1,  1,  0,  1;
n=7:    5,  5,  4,  3,  1,  1,  0,  1;
n=8:    8,  8,  8,  5,  4,  1,  1,  0,  1;
n=9:   10, 13, 13, 11,  6,  4,  1,  1,  0, 1;
n=10:  15, 21, 24, 19, 14,  7,  5,  1,  1, 0, 1;
...
For example, for n=4, we have the following marked and unmarked circular binary words (the square brackets denote equivalence classes):
k=0: [1111], [1110,1101,1011,0111], [1010,0101], T(4,0) = 7 and W(4,0) = 3;
k=1: [1100,1001,0011,0110], T(4,1) = 4 and W(4,1) = 1;
k=2: [0001,0010,0100,1000], T(4,2) = 4 and W(4,2) = 1;
k=3: none, T(4,3) = 0 = W(4,3);
k=4: [0000], T(4,4) = 1 = W(4,4).
(End)
		

Crossrefs

Programs

  • Maple
    T:=proc(n,k): if k>n or k<0 then 0 elif n=0 and k=0 then 1 elif n=1 then 1 elif n=2 and k=0 then 3 elif n=2 and k=1 then 0 else T(n-1,k)+T(n-2,k)+T(n-1,k-1)-T(n-2,k-1) fi end: for n from 0 to 12 do seq(T(n,k),k=0..n) od; # yields sequence in triangular form
  • Mathematica
    T[n_, k_] := T[n, k] = Which[k > n || k < 0, 0, n == 0 && k == 0, 1, n == 1, 1, n == 2 && k == 0, 3, n == 2 && k == 1, 0, True, T[n-1, k] + T[n-2, k] + T[n-1, k-1] - T[n-2, k-1]];
    Table[T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jan 11 2019 *)

Formula

T(n,k) = T(n-1,k) + T(n-2,k) + T(n-1,k-1) - T(n-2,k-1) for n >= 3 and k >= 1.
G.f.: G(z,t) = Sum_{n,k >=0} T(n,k)*z^n*t^k = (1 + z^2 - t*z^2)/(1 - z - z^2 - t*z + t*z^2). [edited by Petros Hadjicostas, Jan 05 2019]
T(n,0) = A000204(n) for n >= 1 (Lucas numbers).
T(n,1) = A006490(n) for n >= 1.
T(n,2) = A006491(n-1) for n >= 1 (with A006491(0):=0).
Sum_{k=0..n} k*T(n,k) = A057711(n).

Extensions

Name was edited by Petros Hadjicostas, Jan 06 2019
Values of T(9,5) and T(9,6) were corrected in the example by Petros Hadjicostas, Jan 06 2019

A006491 Generalized Lucas numbers.

Original entry on oeis.org

1, 0, 4, 5, 15, 28, 60, 117, 230, 440, 834, 1560, 2891, 5310, 9680, 17527, 31545, 56468, 100590, 178395, 315106, 554530, 972564, 1700400, 2964325, 5153868, 8938300, 15465497, 26700915, 46004620, 79112304, 135801105, 232715006, 398151740
Offset: 1

Views

Author

Keywords

Comments

For n>2 note that (n+1)|a(n) unless n is prime, in which case (n+1)|2*a(n). This sequence is not the better-known generalized Lucas numbers V(n,a,b) defined for fixed integers a and b such that D = a^2 + 4*b is nonnegative, V(0) = 2, V(1) = a and for n>1 the recurrence V(n) = V(n-1) + V(n-2). The a = b = 1 case gives the Lucas Numbers. - Jonathan Vos Post, Mar 16 2005
Number of circular binary words of length n+1 having exactly two occurrences of 00. Example: a(4) = 5 because we have 00011, 10001, 11000, 00110 and 01100. Column 2 of A119458. - Emeric Deutsch, May 20 2006
From Petros Hadjicostas, Jan 10 2019: (Start)
In view of the comment by Emeric Deutsch above, we clarify the previous comment by Jonathan Vos Post. We have that 25 + 1 = 26 does not divide a(25) = 2964325 even though n = 25 is not a prime. What he probably meant is that, for n >= 1, we have (n+1) | a(n) unless n is odd, in which case (n+1)|2*a(n). (Of course, for some odd numbers n, we do have (n+1)|a(n), but not for all of them.)
From Emeric Deutsch's comment above, we have a(n) = A119458(n+1, k=2), while from the theory of marked and unmarked circular words, we have A320341(n+1, k=2) = (1/(n+1))*Sum_{d|gcd(n+1, 2)} phi(d)*A119458((n+1)/d, 2/d).
If n is even, then n+1 is odd, and hence A320341(n+1, k=2) = (1/(n+1)) * A119458(n+1, 2) = a(n)/(n+1), i.e., (n+1)|a(n).
If n=1, then (1+1)|2*a(1). Let n be odd >= 3, in which case n+1 is even and 2*A320341(n+1, k=2) = (1/(n+1))*(2*A119458(n+1, k=2) + 2*A119458((n+1)/2, k=1)). Thus, 2*A320341(n+1, k=2) = (1/(n+1))*(2*a(n) + 2*A006490((n+1)/2)) = (1/(n+1))*(2*a(n) + 2*((n+1)/2)*Fibonacci((n-3)/2)). It follows that 2*A320341(n+1, k=2) = 2*a(n)/(n+1) + Fibonacci((n-3)/2). Thus, 2*a(n)/(n+1) = 2*A320341(n+1, k=2) - Fibonacci((n-3)/2), and thus, (n+1)|2*a(n). (End)

References

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

Crossrefs

Programs

  • Magma
    I:=[1,0,4,5,15,28]; [n le 6 select I[n] else 3*Self(n-1) -5*Self(n-3) +3*Self(n-5)+Self(n-6): n in [1..30]]; // G. C. Greubel, Jan 01 2018
  • Maple
    G:=x*(1-x)*(1-2*x+2*x^2)/(1-x-x^2)^3: Gser:=series(G,x=0,45): seq(coeff(Gser,x^n),n=1..40); # Emeric Deutsch, Feb 07 2006
    with(combinat): a[1]:=1: a[2]:=0: for n from 3 to 40 do a[n]:=a[n-1]+a[n-2]+n*fibonacci(n-2)-(n-1)*fibonacci(n-3) od: seq(a[n],n=1..40); # Emeric Deutsch, May 20 2006
    A006491:=(z-1)*(1-2*z+2*z**2)/(z**2+z-1)**3; # conjectured by Simon Plouffe in his 1992 dissertation
  • Mathematica
    LinearRecurrence[{3, 0, -5, 0, 3, 1}, {1, 0, 4, 5, 15, 28}, 50] (* G. C. Greubel, Jan 01 2018 *)
  • PARI
    x='x+O('x^30); Vec(x*(1-x)*(1-2*x+2*x^2)/(1-x-x^2)^3) \\ G. C. Greubel, Jan 01 2018
    

Formula

G.f.: x*(1-x)*(1-2*x+2*x^2)/(1-x-x^2)^3. - Ralf Stephan, Apr 23 2004, corrected Feb 08 2006
a(n) = a(n-1) + a(n-2) + n*Fibonacci(n-2) - (n-1)*Fibonacci(n-3) for n >= 3; a(1)=1, a(2)=0. - Emeric Deutsch, May 20 2006
a(n) = 3*a(n-1) - 5*a(n-3) + 3*a(n-5) + a(n-6). - G. C. Greubel, Jan 01 2018

Extensions

More terms from Emeric Deutsch, Feb 07 2006
Showing 1-5 of 5 results.