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.

A198060 Array read by antidiagonals, m>=0, n>=0, A(m,n) = Sum_{k=0..n} Sum_{j=0..m} Sum_{i=0..m} (-1)^(j+i)*C(i,j)*C(n,k)^(m+1)*(n+1)^j*(k+1)^(-j).

Original entry on oeis.org

1, 1, 2, 1, 3, 4, 1, 4, 10, 8, 1, 5, 22, 35, 16, 1, 6, 46, 134, 126, 32, 1, 7, 94, 485, 866, 462, 64, 1, 8, 190, 1700, 5626, 5812, 1716, 128, 1, 9, 382, 5831, 35466, 69062, 40048, 6435, 256, 1, 10, 766, 19682, 219626, 795312, 882540, 281374, 24310, 512
Offset: 0

Views

Author

Peter Luschny, Nov 01 2011

Keywords

Comments

We repeat the definition of a meander as given in the link below and used in the sequences in the cross-references:
A binary curve C is a triple (m, S, dir) such that:
(a) S is a list with values in {L, R} which starts with an L,
(b) dir is a list of m different values, each value of S being allocated a value of dir,
(c) consecutive Ls increment the index of dir,
(d) consecutive Rs decrement the index of dir,
(e) the integer m > 0 divides the length of S.
(f) C is a meander if each value of dir occurs length(S) / m times.
The rows of the array A(m, n) show the number of meanders of length n and central angle 360/m as specified by the columns of a table in the given link. - Peter Luschny, Mar 20 2023

Examples

			Array A(m, k) starts:
  m\n  [0] [1]  [2]   [3]     [4]     [5]        [6]
  --------------------------------------------------
  [0]   1   2    4     8      16       32         64   A000079
  [1]   1   3   10    35     126      462       1716   A001700
  [2]   1   4   22   134     866     5812      40048   A197657
  [3]   1   5   46   485    5626    69062     882540   A198256
  [4]   1   6   94  1700   35466   795312   18848992   A198257
  [5]   1   7  190  5831  219626  8976562  394800204   A198258
Triangle T(m, k) starts:
  [0]   1;
  [1]   2,    1;
  [2]   4,    3,    1;
  [3]   8,   10,    4,    1;
  [4]  16,   35,   22,    5,    1;
  [5]  32,  126,  134,   46,    6,   1;
  [6]  64,  462,  866,  485,   94,   7, 1;
  [7] 128, 1716, 5812, 5626, 1700, 190, 8, 1;
Using the representation of meanders as multiset permutations (see A361043) and generated by the Julia program below.
  T(3, 0) =  8 = card(1000, 1100, 1010, 1001, 1110, 1101, 1011, 1111).
  T(3, 1) = 10 = card(110000, 100100, 100001, 111100, 111001, 110110, 110011, 101101, 100111, 111111).
  T(3, 2) =  4 = card(111000, 110001, 100011, 111111).
  T(3, 3) =  1 = card(1111).
		

Crossrefs

Programs

  • Julia
    using Combinatorics
    function isMeander(m::Int, c::Vector{Bool})::Bool
        l = length(c)
        (l == 0 || c[1] != true) && return false
        vec = fill(Int(0), m)
        max = div(l, m)
        dir = Int(1)
        ob = c[1]
        for b in c
            if b && ob
                dir += 1
            elseif !b && !ob
                dir -= 1
            end
            dir = mod(dir, m)
            v = vec[dir + 1] + 1
            vec[dir + 1] = v
            if v > max
                return false
            end
            ob = b
        end
    true end
    function CountMeanders(n, k)
        n == 0 && return k + 1
        count = 0
        size = n * k
        for a in range(0, stop=size; step=n)
            S = [(i <= a) for i in 1:size]
            count += sum(1 for c in multiset_permutations(S, size)
                         if isMeander(n, c); init = 0)
        end
    count end
    A198060ByCount(m, n) = CountMeanders(m + 1, n + 1)
    for n in 0:4
        [A198060ByCount(n, k) for k in 0:4] |> println
    end
    # Peter Luschny, Mar 20 2023
  • Maple
    A198060 := proc(m, n) local i, j, k; add(add(add((-1)^(j+i)*binomial(i, j)* binomial(n, k)^(m+1)*(n+1)^j*(k+1)^(-j), i=0..m), j=0..m), k=0..n) end:
    for m from 0 to 6 do seq(A198060(m, n), n=0..6) od;
  • Mathematica
    a[m_, n_] := Sum[ Sum[ Sum[(-1)^(j + i)*Binomial[i, j]*Binomial[n, k]^(m+1)*(n+1)^j*(k+1)^(m-j)/(k+1)^m, {i, 0, m}], {j, 0, m}], {k, 0, n}]; Table[ a[m-n, n], {m, 0, 9}, {n, 0, m}] // Flatten (* Jean-François Alcover, Jun 27 2013 *)
  • SageMath
    # This function assumes an offset (1, 1).
    def A(m: int, n: int) -> int:
        S = sum(
                sum(
                    sum((
                        (-1) ** (j + i)
                        * binomial(i, j)
                        * binomial(n - 1, k) ** m
                        * n ** j )
                        // (k + 1) ** j
                    for i in range(m) )
                for j in range(m) )
            for k in range(n) )
        return S
    def Arow(n: int, size: int) -> list[int]:
        return [A(n, k) for k in range(1, size + 1)]
    for n in range(1, 7): print([n], Arow(n, 7)) # Peter Luschny, Mar 24 2023
    # These functions compute the number of meanders by generating and counting.
    # Their primary purpose is to illustrate that meanders are a special class of
    # multiset permutations. They are not suitable for numerical calculation.
    

Formula

From Peter Bala, Apr 22 2022: (Start)
Conjectures:
1) the m-th row entries satisfy the Gauss congruences T(m, n*p^r - 1) == T(m, n*p^(r-1) - 1) (mod p^r) for primes p >= 3 and positive integers n and r.
2) for m even, the m-th row entries satisfy the congruences T(m, p^r - 1) == 2^(p^r - 1) (mod p^2) for primes p >= 3 and positive integers r.
3) for m odd, the m-th row entries satisfy the supercongruences T(m,n*p^r - 1) == T(m,n*p*(r-1) - 1) (mod p^(3*r)) for primes p >= 5 and positive integers n and r. (End)

A194595 Triangle by rows T(n,k), showing the number of meanders with length (n+1)*3 and containing (k+1)*3 L's and (n-k)*3 R's, where L's and R's denote arcs of equal length and a central angle of 120 degrees which are positively or negatively oriented.

Original entry on oeis.org

1, 3, 1, 7, 14, 1, 13, 81, 39, 1, 21, 304, 456, 84, 1, 31, 875, 3000, 1750, 155, 1, 43, 2106, 13875, 18500, 5265, 258, 1, 57, 4459, 50421, 128625, 84035, 13377, 399, 1, 73, 8576, 153664, 669536, 836920, 307328, 30016, 584, 1, 91, 15309, 409536, 2815344, 6001128, 4223016, 955584, 61236, 819, 1
Offset: 0

Views

Author

Susanne Wienand, Oct 10 2011

Keywords

Comments

Definition of a meander:
A binary curve C is a triple (m, S, dir) such that
(a) S is a list with values in {L,R} which starts with an L,
(b) dir is a list of m different values, each value of S being allocated
a value of dir,
(c) consecutive L's increment the index of dir,
(d) consecutive R's decrement the index of dir,
(e) the integer m > 0 divides the length of S and
(f) C is a meander if each value of dir occurs length(S)/m times.
For this sequence, m = 3.
The values in the triangle are proved by brute force for 0 <= n <= 11. The formulas are not yet proved in general. - Susanne Wienand
Let S(N,n,k) = C(n,k)^(N+1)*Sum_{j=0..N} Sum_{i=0..N} (-1)^(N-j+i)*C(N-i,j)*((n+1)/(k+1))^j. Then S(0,n,k) = A007318(n,k), S(1,n,k) = A103371(n,k), S(2,n,k) = T(n,k), S(3,n,k) = A197653(n,k), S(4,n,k) = A197654(n,k), S(5,n,k) = A197655(n,k). - Peter Luschny, Oct 21 2011
The number triangle can be calculated recursively by the number triangles A103371 and A007318. The first column of the triangle contains the central polygonal numbers A002061. The diagonal right hand is A000012. The diagonal with k = n-1 seems to be A027444. Row sums are in A197657. - Susanne Wienand, Nov 24 2011
The conjectured formulas are confirmed by dynamic programming for 0 <= n <= 62. - Susanne Wienand, Jun 24 2015

Examples

			For n = 4 and k = 2, T(3,4,2) = 456.
Recursive example:
T(1,4,0) = 1
T(1,4,1) = 4
T(1,4,2) = 6
T(1,4,3) = 4
T(1,4,4) = 1
T(2,4,0) = 5
T(2,4,1) = 40
T(2,4,2) = 60
T(2,4,3) = 20
T(2,4,4) = 1
T(3,4,0) = T(1,4,0)^3 + T(1,4,0)*T(2,4,4-1-0) = 1^3 + 1*20 = 21
T(3,4,1) = T(1,4,1)^3 + T(1,4,1)*T(2,4,4-1-1) = 4^3 + 4*60 = 304
T(3,4,2) = T(1,4,2)^3 + T(1,4,2)*T(2,4,4-1-2) = 6^3 + 6*40 = 456
T(3,4,3) = T(1,4,3)^3 + T(1,4,3)*T(2,4,4-1-3) = 4^3 + 4*5  = 84
T(3,4,4) = 1.
Example for closed formula:
T(4,2) = (C(4,2))^3 + C(4,2) * C(4,3) * C(5,3) = 6^3 + 6 * 4 * 10 = 456.
Some examples of list S and allocated values of dir if n = 4 and k = 2:
Length(S) = (4+1)*3 = 15 and S contains (2+1)*3 = 9 L's.
  S: L,L,L,L,L,L,L,L,L,R,R,R,R,R,R
dir: 1,2,0,1,2,0,1,2,0,0,2,1,0,2,1
  S: L,L,R,L,L,L,L,R,R,L,R,R,L,R,L
dir: 1,2,2,2,0,1,2,2,1,1,1,0,0,0,0
  S: L,R,R,R,L,L,L,L,R,R,L,L,L,R,L
dir: 1,1,0,2,2,0,1,2,2,1,1,2,0,0,0
Each value of dir occurs 15/3 = 5 times.
		

Crossrefs

Programs

  • Maple
    A194595 := (n,k)->binomial(n,k)^3*(k^2+k+1+n^2+n-k*n)/((k+1)^2);
    seq(print(seq(A194595(n,k),k=0..n)),n=0..7); # Peter Luschny, Oct 14 2011
  • Mathematica
    T[n_, k_] := Binomial[n, k]^3*(k^2 + k + 1 + n^2 + n - k*n)/((k + 1)^2);
    Table[T[n, k], {n, 0, 9}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 30 2018, after Peter Luschny *)
  • PARI
    A194595(n,k) = {if(n == 1+2*k,3,(1+k)*(1-((n-k)/(1+k))^3)/(1+2*k-n))*binomial(n,k)^3} \\ Peter Luschny, Nov 24 2011

Formula

Recursive formula (conjectured):
T(n,k) = T(3,n,k) = T(1,n,k)^3 + T(1,n,k)*T(2,n,n-1-k), 0 <= k < n
T(3,n,n) = 1, k = n
T(2,n,k) = T(1,n,k)^2 + T(1,n,k) * T(1,n,n-1-k), 0 <= k < n
T(2,n,n) = 1, k = n
T(2,n,k) = A103371,
T(1,n,k) = A007318 (Pascal's Triangle).
Closed formula (conjectured): T(n,k) = (C(n,k))^3 + C(n,k) * C(n,k+1) * C(n+1,k+1). - Susanne Wienand
Let S(n,k) = binomial(2*n,n)^(k+1)*((n+1)^(k+1)-n^(k+1))/(n+1)^k. Then T(2*n,n) = S(n,2). - Peter Luschny, Oct 20 2011
T(n,k) = A073254(n+1,k+1)C(n,k)^3/(k+1)^2. - Peter Luschny, Oct 29 2011
T(n,k) = h(n,k)*binomial(n,k)^3, where h(n,k) = (1+k)*(1-((n-k)/(1+k))^3)/(1+2*k-n) if 1+2*k-n <> 0 else h(n,k) = 3. - Peter Luschny, Nov 24 2011

A369923 Array read by antidiagonals: A(n,k) is the number of permutations of n copies of 1..k with values introduced in order and without cyclically adjacent elements equal.

Original entry on oeis.org

0, 1, 0, 1, 1, 0, 1, 4, 1, 0, 1, 31, 22, 1, 0, 1, 293, 1415, 134, 1, 0, 1, 3326, 140343, 75843, 866, 1, 0, 1, 44189, 20167651, 83002866, 4446741, 5812, 1, 0, 1, 673471, 3980871156, 158861646466, 55279816356, 276154969, 40048, 1, 0
Offset: 1

Views

Author

Andrew Howroyd, Feb 05 2024

Keywords

Comments

Also, T(n,k) is the number of generalized chord labeled loopless diagrams with k parts of K_n. See the Krasko reference for a full definition.

Examples

			Array begins:
n\k| 1 2    3         4              5                    6 ...
---+-----------------------------------------------------------
 1 | 0 1    1         1              1                    1 ...
 2 | 0 1    4        31            293                 3326 ...
 3 | 0 1   22      1415         140343             20167651 ...
 4 | 0 1  134     75843       83002866         158861646466 ...
 5 | 0 1  866   4446741    55279816356     1450728060971387 ...
 6 | 0 1 5812 276154969 39738077935264 14571371516350429940 ...
 ...
		

Crossrefs

Column 3 is A197657, column 4 appears to be A209183(n)/2.
Cf. A322013 (without linearly adjacent elements equal), A322093.

Programs

  • Mathematica
    T[n_, k_] := If[k == 1, 0, Expand[(-1)^(k (n + 1))/(k - 1)! n Hypergeometric1F1[1 - n, 2, x]^k x^(k - 1)] /. x^p_ :> p!] (* Eric W. Weisstein, Feb 20 2025 *)
  • PARI
    \\ compare with A322013.
    q(n, x) = sum(i=1, n, (-1)^(n-i) * binomial(n-1, n-i) * x^i/i!)
    T(n, k) = if(k > 1, subst(serlaplace(n*q(n, x)^k/x), x, 1)/(k-1)!, 0)

A361574 a(n) is the number of Fibonacci meanders of length m*n and central angle 360/m degrees where m = 3.

Original entry on oeis.org

1, 3, 8, 21, 68, 242, 861, 3151, 11874, 45192, 173496, 673042
Offset: 1

Views

Author

Peter Luschny, Mar 16 2023

Keywords

Comments

A binary curve C is a pair (m, S) such that
(a) S is a list with values in {L, R} that
(b) starts with an L, and
(c) m > 0 is an integer that divides the length of S.
Given a binary curve C = (m, S), we call m the modulus of the curve and S the steps of C. 'L' stands for a positively oriented arc (left turn) and 'R' for a negatively oriented arc (right turn).
Let SS denote a pair of consecutive steps in C. The direction d of a curve at n starts with d = 0, and for n > 0, d = d + 1 if SS = LL and d = d - 1 if SS = RR; otherwise, d remains unchanged.
A binary curve C = (m, S) is a meander if the values d mod m are assumed with equal frequency. A meander is a closed smooth curve in the plane, possibly self-overlapping (see the plots).
A binary curve 'changes direction' if two consecutive steps are of the same type, i.e., is a pair of steps of the form LL or RR.
A Fibonacci meander is a meander that does not change direction to the left except at the beginning of the curve, where any number of left turns can appear.

Examples

			For n = 4 the Fibonacci meanders with central angle 120 degrees and length 12, written as binary strings (L = 1, R = 0), are:
100000010001, 100010000001, 110000000001, 100000100100, 100100000100, 100010001000,
110000001000, 100100100000, 110001000000, 111000000000, 110100100101, 111001001001,
111100010001, 111110000001, 111010010010, 111100100100, 111110001000, 111111000000,
111111110001, 111111111000, 111111111111.
		

Crossrefs

Cf. A000071 (m=1), A201631 (m=2), A197657.

Programs

  • SageMath
    def isFibonacci(S: list[bool]) -> bool:
        dir, os = True, S[0]
        for s in S:
            if s and os:
                if not dir:
                    return False
                dir = True
            else:
                dir = False
            os = s
        return True
    def isMeander(n: int, S: list[bool]) -> bool:
        if S[0] != True:
            return False
        vec = [0] * n
        max = len(S) // n
        dir, ob = 0, True
        for b in S:
            if b and ob:
                dir += 1
            elif not b and not ob:
                dir -= 1
            dir = dir % n
            v = vec[dir] = vec[dir] + 1
            if v > max:
                return False
            ob = b
        return True
    def FibonacciMeanders(m: int, steps: int) -> int:
        size = m * steps
        count = 0
        for a in range(0, size + 1, m):
            S = [i < a for i in range(size)]
            for c in Permutations(S):
                if c[0] == 0: break
                if not isFibonacci(c): continue
                if not isMeander(m, c): continue
                count += 1
            print(count)
        return count
    def FibonacciMeandersColumn(m: int, size: int) -> list[int]:
        return [FibonacciMeanders(m, n) for n in range(1, size + 1)]
    print([FibonacciMeandersColumn(3, n) for n in range(1, 7)])

A209352 Number of initially rising meander words, where each letter of the cyclic 6-ary alphabet occurs n times.

Original entry on oeis.org

1, 1, 16, 484, 17956, 749956, 33779344, 1603842304, 79171327876, 4026836863204, 209730177700096, 11135960392243600, 600800844868633600, 32853035097265158400, 1817225079550242841600, 101519847275313821814784, 5720749624907993103318916, 324836041052683988251601956
Offset: 0

Views

Author

Alois P. Heinz, Mar 06 2012

Keywords

Comments

In a meander word letters of neighboring positions have to be neighbors in the alphabet, where in a cyclic alphabet the first and the last letters are considered neighbors too. The words are not considered cyclic here.
A word is initially rising if it is empty or if it begins with the first letter of the alphabet that can only be followed by the second letter in this word position.
a(n) is also the number of (6*n-1)-step walks on 6-dimensional cubic lattice from (1,0,...,0) to (n,n,...,n) with positive unit steps in all dimensions such that the indices of dimensions used in consecutive steps differ by 1 or are in the set {1,6}.

Examples

			a(0) =  1: the empty word.
a(1) =  1 = |{abcdef}|.
a(2) = 16 = |{ababcdcdefef, abafedcbcdef, abafefedcbcd, abafefedcdcb, abcbafedcdef, abcbafefedcd, abcbcdedefaf, abcbcdefafed, abcdcbafedef, abcdcbafefed, abcdcdefefab, abcdedcbafef, abcdefabcdef, abcdefafedcb, abcdefedcbaf, abcdefefabcd}|.
		

Crossrefs

Column k=6 of A209349.
Cf. A197657.

Programs

  • Maple
    g:= proc(m, n, k) local h;
          h:= binomial(n-1, k);
          h^m +`if`(m<2, 0, h* g(m-1, n, n-k-2))
        end:
    a:= n-> add(g(3, n, k), k=0..n)^2:
    seq(a(n), n=0..30);
  • Mathematica
    g[m_, n_, k_] := g[m, n, k] = With[{h = Binomial[n - 1, k]}, h^m + If[m < 2, 0, h g[m - 1, n, n - k - 2]]];
    a[n_] := Sum[g[3, n, k], {k, 0, n}]^2;
    a /@ Range[0, 30] (* Jean-François Alcover, May 14 2020, after Maple *)

Formula

a(n) = A197657(n-1)^2 for n>0, a(0) = 1.
a(n) ~ 3 * 2^(6*n - 4) / (Pi^2 * n^2). - Vaclav Kotesovec, May 14 2020
Showing 1-5 of 5 results.