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.

User: Bruce E. Sagan

Bruce E. Sagan's wiki page.

Bruce E. Sagan has authored 8 sequences.

A140982 If (a_n) is a sequence then let L(a_n)=(b_n) where b_n = a_n^2 - a_{n-1} a_{n+1}. The given sequence is the rows of the triangle obtained by computing L^2(binomial(n,k)).

Original entry on oeis.org

1, 3, 1, 6, 16, 1, 10, 100, 50, 1, 15, 400, 750, 120, 1, 21, 1225, 6125, 3675, 245, 1, 28, 3136, 34300, 54880, 13720, 448, 1, 36, 7056, 148176, 518616, 345744, 42336, 756, 1, 45, 14400, 529200, 3556224, 5186160, 1693440, 113400, 1200, 1, 55, 27225, 1633500
Offset: 3

Author

Bruce E. Sagan, Jul 28 2008

Keywords

Comments

L(binomial(n,k)) gives the Narayana numbers, A001263.

Crossrefs

Cf. A001263.

Programs

  • Mathematica
    a[n_, k_] := 2 * Binomial[n, k]^2 * Binomial[n, k - 1] * Binomial[n, k - 2] / ((n - 1) n^2); Table[ a[n, k], {n, 2, 11}, {k, 2, n}] // Flatten (* Robert G. Wilson v, Aug 03 2008 *)

Formula

a(n,k) = binomial(n,k)^2 * binomial(n,k-1) * binomial(n,k-2) / (n*binomial(n,2)).

Extensions

More terms from Robert G. Wilson v, Aug 03 2008

A113248 Number of permutations pi in S_n such that maj pi and maj pi^(-1) have opposite parity where maj is the major index. Equivalently, the number of pi such that maj pi and inv pi have opposite parity where inv is the inversion number.

Original entry on oeis.org

0, 0, 2, 8, 56, 336, 2496, 19968, 181248, 1812480, 19956480, 239477760, 3113487360, 43588823040, 653836861440, 10461389783040, 177843708887040, 3201186759966720, 60822550111518720, 1216451002230374400
Offset: 0

Author

Bruce E. Sagan, Oct 20 2005

Keywords

Comments

a(2n) and a(2n+1) are both divisible by 2^n n! a(2n) = 2n a(2n-1) The number of pi in S_n such that maj pi is even and maj pi^(-1) is odd is exactly half of a(n)

Examples

			a(3)=2 because the following 2 permutations in S_3 have opposite parity for their major index and the major index of their inverse: 231, 312.
		

Crossrefs

Cf. A113247.

Formula

a(2n) = 2 n^2 a(2n-2) + 2 n (n-1) b(2n-2) and a(2n+1) = 2 n (n+1) a(2n-1) + 2 n^2 b(2n-1) where b(n) is sequence A113247

A113247 Number of permutations pi in S_n such that maj pi and maj pi^(-1) have the same parity where maj is the major index. Equivalently, the number of pi such that maj pi and inv pi have the same parity where inv is the inversion number.

Original entry on oeis.org

1, 1, 2, 4, 16, 64, 384, 2544, 20352, 181632, 1816320, 19960320, 239523840, 3113533440, 43589468160, 653837506560, 10461400104960, 177843719208960, 3201186945761280, 60822550297313280, 1216451005946265600
Offset: 0

Author

Bruce E. Sagan, Oct 20 2005

Keywords

Comments

a(2n) and a(2n+1) are both divisible by 2^n n! a(2n) = 2n a(2n-1) The number of pi in S_n such that maj pi and maj pi^(-1) are both even is exactly half of a(n)

Examples

			a(3)=4 because the following 4 permutations in S_3 have the same parity for their major index and the major index of their inverse (and in fact are equal to their inverse): 123, 213, 321, 132.
		

Crossrefs

Cf. A113248.

Formula

a(2n) = 2 n^2 a(2n-2) + 2 n (n-1) b(2n-2) and a(2n+1) = 2 n (n+1) a(2n-1) + 2 n^2 b(2n-1) where b(n) is sequence A113248

A089119 Complement of ((3*A005836) union (3*A005836 - 1) union (3*A005836 - 2)).

Original entry on oeis.org

4, 5, 6, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 31, 32, 33, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 85, 86, 87, 94, 95, 96, 97, 98, 99, 100, 101, 102
Offset: 1

Author

Emeric Deutsch and Bruce E. Sagan, Dec 05 2003

Keywords

Comments

Numbers k such that the Motzkin number A001006(k) == 0 (mod 3).
The asymptotic density of this sequence is 1 (Burns, 2016). - Amiram Eldar, Jan 30 2021

Crossrefs

Programs

  • Mathematica
    (* m = MotzkinNumber *) m[0] = 1; m[n_] := m[n] = m[n - 1] + Sum[m[k]*m[n - 2 - k], {k, 0, n - 2}]; Select[Range[0, 120], Mod[m[#], 3] == 0 &] (* Jean-François Alcover, Jul 10 2013 *)

Extensions

Offset corrected by Amiram Eldar, Jan 30 2021

A089118 Nonnegative numbers in (3*A005836 - 1) [A005836 are the numbers with base representation containing no 2].

Original entry on oeis.org

2, 8, 11, 26, 29, 35, 38, 80, 83, 89, 92, 107, 110, 116, 119, 242, 245, 251, 254, 269, 272, 278, 281, 323, 326, 332, 335, 350, 353, 359, 362, 728, 731, 737, 740, 755, 758, 764, 767, 809, 812, 818, 821, 836, 839, 845, 848, 971, 974, 980, 983, 998, 1001, 1007, 1010
Offset: 1

Author

Emeric Deutsch and Bruce E. Sagan, Dec 05 2003

Keywords

Comments

Numbers k such that the Motzkin number A001006(k) == 2 (mod 3).

Crossrefs

Programs

  • Mathematica
    (* m = MotzkinNumber *) m[0] = 1; m[n_] := m[n] = m[n - 1] + Sum[ m[k]*m[n - 2 - k], {k, 0, n - 2}]; Select[ Range[1010], Mod[m[#], 3] == 2 &] (* Jean-François Alcover, Jul 10 2013 *)
    Select[3*Range[350] - 1, DigitCount[# + 1, 3, 2] == 0 &] (* Amiram Eldar, Jun 04 2022 *)

Extensions

Offset corrected to 1 by Jean-François Alcover, Jun 23 2016

A082575 Nonnegative numbers in (3*A005836) union (3*A005836 - 2) [A005836 lists the numbers with base-3 representation containing no 2].

Original entry on oeis.org

0, 1, 3, 7, 9, 10, 12, 25, 27, 28, 30, 34, 36, 37, 39, 79, 81, 82, 84, 88, 90, 91, 93, 106, 108, 109, 111, 115, 117, 118, 120, 241, 243, 244, 246, 250, 252, 253, 255, 268, 270, 271, 273, 277, 279, 280, 282, 322, 324, 325, 327, 331, 333, 334, 336, 349, 351, 352
Offset: 1

Author

Emeric Deutsch and Bruce E. Sagan, Dec 05 2003

Keywords

Comments

Numbers k such that the Motzkin number A001006(k) == 1 (mod 3).

Crossrefs

Programs

  • Mathematica
    (* m = MotzkinNumber *) m[0] = 1; m[n_] := m[n] = m[n - 1] + Sum[m[k]*m[n - 2 - k], {k, 0, n - 2}]; Select[Range[0, 400], Mod[m[#], 3] == 1 &] (* Jean-François Alcover, Jul 10 2013 *)
    max = 150; Sort @ Join[Select[3*Range[0, max], DigitCount[#, 3, 2] == 0 &], Select[3*Range[max] - 2, DigitCount[# + 2, 3, 2] == 0 &]] (* Amiram Eldar, Jun 04 2022 *)

Extensions

Offset changed to 1 (sequence is a list) by L. Edson Jeffery, Nov 27 2015

A081706 Numbers n such that binary representation ends either in an odd number of ones followed by one zero or in an even number of ones.

Original entry on oeis.org

2, 3, 10, 11, 14, 15, 18, 19, 26, 27, 34, 35, 42, 43, 46, 47, 50, 51, 58, 59, 62, 63, 66, 67, 74, 75, 78, 79, 82, 83, 90, 91, 98, 99, 106, 107, 110, 111, 114, 115, 122, 123, 130, 131, 138, 139, 142, 143, 146, 147, 154, 155, 162, 163, 170, 171, 174, 175, 178, 179, 186
Offset: 1

Author

Emeric Deutsch and Bruce E. Sagan, Apr 02 2003

Keywords

Comments

Values of k such that the Motzkin number A001006(k) is even. Values of k such that the number of restricted hexagonal polyominoes with k+1 cells (A002212) is even.
Or union of sequences {2*A079523(n)+k}, k=0,1. A generalization see in comment to A161639. - Vladimir Shevelev, Jun 15 2009
Or intersection of sequences A121539 and {A121539(n)-1}. A generalization see in comment to A161890. - Vladimir Shevelev, Jul 03 2009
Also numbers n for which A010060(n+2) = A010060(n). - Vladimir Shevelev, Jul 06 2009
The asymptotic density of this sequence is 1/3 (Rowland and Yassawi, 2015; Burns, 2016). - Amiram Eldar, Jan 30 2021
Numbers of the form 4^k*(2*n-1)-2 and 4^k*(2*n-1)-1 where n and k are positive integers. - Michael Somos, Oct 22 2021

Programs

  • Mathematica
    (* m = MotzkinNumber *) m[0] = 1; m[n_] := m[n] = m[n - 1] + Sum[m[k]*m[n - 2 - k], {k, 0, n - 2}]; Select[Range[200], Mod[m[#], 2] == 0 &] (* Jean-François Alcover, Jul 10 2013 *)
    Select[Range[200], EvenQ@Hypergeometric2F1[3/2, -#, 3, 4]&] (* Vladimir Reshetnikov, Nov 02 2015 *)
  • PARI
    is(n)=valuation(bitor(n,1)+1,2)%2==0 \\ Charles R Greathouse IV, Mar 07 2013
    
  • Python
    from itertools import count, islice
    def A081706_gen(): # generator of terms
        for n in count(0):
            if (n&-n).bit_length()&1:
                m = n<<2
                yield m-2
                yield m-1
    A081706_list = list(islice(A081706_gen(),30)) # Chai Wah Wu, Jan 09 2023
    
  • Python
    def A081706(n):
        def f(x):
            c, s = (n+1>>1)+x, bin(x)[2:]
            l = len(s)
            for i in range(l&1^1,l,2):
                c -= int(s[i])+int('0'+s[:i],2)
            return c
        m, k = n+1>>1, f(n+1>>1)
        while m != k: m, k = k, f(k)
        return (m<<2)-1-(n&1) # Chai Wah Wu, Jan 29 2025

Formula

a(2n-1) = 2*A079523(n) = 4*A003159(n)-2; a(2n) = 4*A003159(n)-1.
Note that a(2n) = 1+a(2n-1).

A026845 Sum_{mu a partition of n} (f^mu/n!)^{-2} where f^mu is the number of standard Young tableaux of shape mu.

Original entry on oeis.org

1, 8, 81, 1424, 32152, 1144937, 53178768, 3360267976, 268737034880, 26735641360265, 3222856389284352, 463078022054303432, 78131995260953112576, 15295767841794798044432, 3438384401028669096232665, 879589866427669147125523584, 254053056142392070125392290952
Offset: 1

Author

Bruce E. Sagan, Apr 06 2002

Keywords

Comments

Arises from counting coverings of a genus g=2 Riemann surface - expansion of generating function A_g(q) = sum_{n>=0} a_{n,g} q^n where a_{n,g} = sum_{mu a partition of n} (f^mu/n!)^{2-2g}; note that A_0(q) = e^q and A_1(q) = prod_{i>=1} 1/(1-q^i).

Crossrefs

Cf. A047874. - Wouter Meeussen, Sep 30 2010

Programs

  • Mathematica
    (* version 4.0 *) Needs["DiscreteMath`Combinatorica`"]; Table[Tr[(n!/ (NumberOfTableaux /@ Partitions[n]))^2],{n,20}] (* Wouter Meeussen, Sep 30 2010 *)

Extensions

Terms 8 to 20 added by Wouter Meeussen, Sep 30 2010