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 13 results. Next

A187392 Floor(s*n), where s=1+sqrt(8)-sqrt(7); complement of A189391.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 52, 53, 54, 55, 56, 57, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 91, 92, 93, 94, 95, 96, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108, 109, 111, 112, 113, 114, 115, 117, 118
Offset: 1

Views

Author

Clark Kimberling, Mar 09 2011

Keywords

Comments

A187391 and A187392 are the Beatty sequences based on r=1+sqrt(8)+sqrt(7) and s=1+sqrt(8)-sqrt(7); 1/r+1/s=1.

Crossrefs

Cf. A187391.

Programs

  • Mathematica
    k=8; r=1+k^(1/2)+(k-1)^(1/2); s=1+k^(1/2)-(k-1)^(1/2);
    Table[Floor[r*n],{n,1,80}]  (* A187391 *)
    Table[Floor[s*n],{n,1,80}]  (* A187392 *)
    With[{c=1+Sqrt[8]-Sqrt[7]},Floor[c*Range[100]]] (* Harvey P. Dale, Mar 04 2015 *)

Formula

a(n)=floor(s*n), where s=1+sqrt(8)-sqrt(7).

A319421 Triangle read by rows: T(n,k) (1 <= k <= n) = one-half of the number of binary vectors of length n and cuts-resistance k.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 4, 2, 1, 1, 6, 6, 2, 1, 1, 10, 11, 7, 2, 1, 1, 14, 24, 14, 8, 2, 1, 1, 22, 42, 35, 16, 9, 2, 1, 1, 30, 81, 68, 45, 18, 10, 2, 1, 1, 46, 138, 149, 89, 55, 20, 11, 2, 1, 1, 62, 250, 282, 216, 110, 66, 22, 12, 2, 1, 1, 94, 419, 577, 422, 285, 132, 78, 24, 13, 2, 1
Offset: 1

Views

Author

N. J. A. Sloane, Sep 23 2018

Keywords

Comments

Cuts-resistance is defined in A319416.
This triangle summarizes the data shown in A319420.
Conjecture (Sloane): Sum_{i = 1..n} i * T(n,i) = A189391(n).

Examples

			Triangle begins:
   1
   1   1
   1   2   1
   1   4   2   1
   1   6   6   2   1
   1  10  11   7   2   1
   1  14  24  14   8   2   1
   1  22  42  35  16   9   2   1
   1  30  81  68  45  18  10   2   1
   1  46 138 149  89  55  20  11   2   1
   1  62 250 282 216 110  66  22  12   2   1
   1  94 419 577 422 285 132  78  24  13   2   1
Lenormand gives first 15 rows.
For example, the "1,2,1" row here refers to the 8 vectors of length 3. There are 2 vectors of cuts-resistance 1, namely 010 and 101 (see A319416), 4 vectors of cuts-resistance 2 (100,011,001,110), and 2 of cuts-resistance 3 (000 and 111). Halving these counts we get 1,2,1
		

Crossrefs

Row sums are A000079.
Column k = 2 appears to be A027383.
The version for runs-resistance is A319411 or A329767.
The version for compositions is A329861.
The cuts-resistance of the binary expansion of n is A319416(n).

Programs

  • Mathematica
    degdep[q_]:=Length[NestWhileList[Join@@Rest/@Split[#]&,q,Length[#]>0&]]-1;
    Table[Length[Select[Tuples[{0,1},n],First[#]==1&°dep[#]==k&]],{n,8},{k,n}] (* Gus Wiseman, Nov 25 2019 *)

Formula

T(n,k) = A329860(n,k)/2. - Gus Wiseman, Nov 25 2019

A319420 Irregular triangle read by rows: row n lists the cuts-resistances of the 2^n binary vectors of length n.

Original entry on oeis.org

0, 1, 1, 2, 1, 1, 2, 3, 2, 1, 2, 2, 1, 2, 3, 4, 3, 2, 2, 2, 1, 2, 3, 3, 2, 1, 2, 2, 2, 3, 4, 5, 4, 3, 3, 3, 2, 2, 3, 3, 2, 1, 2, 2, 2, 3, 4, 4, 3, 2, 2, 2, 1, 2, 3, 3, 2, 2, 2, 3, 3, 3, 4, 5
Offset: 0

Views

Author

N. J. A. Sloane, Sep 22 2018

Keywords

Comments

The cuts-resistance of a vector is defined in A319416. The 2^n vectors of length n are taken in lexicographic order.
Note that here the vectors can begin with either 0 or 1, whereas in A319416 only vectors beginning with 1 are considered (since there we are considering binary representations of numbers).
Conjecture: The row sums, halved, appear to match A189391.

Examples

			Triangle begins:
0,
1,1,
2,1,1,2,
3,2,1,2,2,1,2,3,
4,3,2,2,2,1,2,3,3,2,1,2,2,2,3,4,
5,4,3,3,3,2,2,3,3,2,1,2,2,2,3,4,4,3,2,2,2,1,2,3,3,2,2,2,3,3,3,4,5,
...
		

Crossrefs

Keeping the first digit gives A319416.
Positions of 1's are the terms > 1 of A061547 and A086893, all minus 1.
The version for runs-resistance is A329870.
Compositions counted by cuts-resistance are A329861.
Binary words counted by cuts-resistance are A319421 or A329860.

Programs

  • Mathematica
    degdep[q_]:=Length[NestWhileList[Join@@Rest/@Split[#]&,q,Length[#]>0&]]-1;
    Table[degdep[Rest[IntegerDigits[n,2]]],{n,0,50}] (* Gus Wiseman, Nov 25 2019 *)

A189390 The maximum possible value for the apex of a triangle of numbers whose base consists of a permutation of the numbers 0 to n, and each number in a higher row is the sum of the two numbers directly below it.

Original entry on oeis.org

0, 1, 5, 16, 45, 116, 286, 680, 1581, 3604, 8106, 18008, 39650, 86568, 187804, 404944, 868989, 1856180, 3950194, 8376056, 17708310, 37329016, 78499620, 164682416, 344789970, 720430216, 1502768996, 3129355120, 6507087396, 13510929104
Offset: 0

Views

Author

Nathaniel Johnston, Apr 20 2011

Keywords

Comments

The maximal value is reached when the largest numbers are placed in the middle and the smallest numbers at the border of the first row, i.e., [0,2,...,n,...,3,1]. Since the value of the apex is given as sum(c_k binomial(n,k)), one can compute this maximal value directly.

Examples

			For n = 4 consider the triangle:
         45
       21  24
      8  13  11
    2   6   7   4
  0   2   4   3   1
This triangle has 45 at its apex and no other such triangle with the numbers 0 through 4 on its base has a larger apex value, so a(4) = 45.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) return add((4*k+1)*binomial(n,k), k=0..floor((n-1)/2)) + `if`(n mod 2=0, n*binomial(n,n/2), 0):end:
    seq(a(n), n=0..50);
  • Mathematica
    a[n_] := Sum[(4k+1)*Binomial[n, k], {k, 0, Floor[(n-1)/2]}] + If[EvenQ[n], n*Binomial[n, n/2], 0]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Feb 18 2017, translated from Maple *)
  • PARI
    A189390(n)=sum(i=0, (n-1)\2, (4*i+1)*binomial(n, i), if(!bittest(n,0),n*binomial(n, n\2)))  \\ - M. F. Hasler, Jan 24 2012
    
  • Python
    from math import comb
    def A189390(n): return sum(((k<<2)|1)*comb(n,k) for k in range(n+1>>1))+(0 if n&1 else n*comb(n,n>>1)) # Chai Wah Wu, Oct 28 2024

Formula

a(n) = Sum_{k=0..floor((n-1)/2)} (4*k+1)*C(n,k) + (n+1 mod 2)*n*C(n,n/2).
a(n) = n*2^n-A189391(n). - M. F. Hasler, Jan 24 2012
a(n) = Sum_{k=0..n} k * C(n,floor(k/2)) = Sum_{k=0..n} k*A107430(n,k). - Alois P. Heinz, Feb 02 2012
G.f.: (2*x-sqrt(1-4*x^2)+1) / (2*(2*x-1)^2). - Alois P. Heinz, Feb 09 2012
D-finite with recurrence n*a(n) -4*n*a(n-1) +12*a(n-2) +16*(n-3)*a(n-3) +16*(-n+3)*a(n-4)=0. - R. J. Mathar, Jul 28 2016
D-finite with recurrence n*(2*n-3)*a(n) +2*(-2*n^2-n+5)*a(n-1) +4*(-2*n^2+9*n-5)*a(n-2) +8*(2*n-1)*(n-2)*a(n-3)=0. - R. J. Mathar, Jul 28 2016
a(n) = Sum_{k=1..n} Sum_{i=1..k} C(n,floor((n-k)/2)+i). - Stefano Spezia, Aug 20 2019

A066411 Form a triangle with the numbers [0..n] on the base, where each number is the sum of the two below; a(n) is the number of different possible values for the apex.

Original entry on oeis.org

1, 1, 3, 5, 23, 61, 143, 215, 995, 2481, 5785, 12907, 29279, 64963, 144289, 158049, 683311, 1471123, 3166531, 6759177, 14404547, 30548713
Offset: 0

Views

Author

Naohiro Nomoto, Dec 25 2001

Keywords

Comments

a(n) is the number of different possible sums of c_k * (n choose k) where the c_k are a permutation of 0 through n. - Joshua Zucker, May 08 2006

Examples

			For n = 2 we have three triangles:
..4.......5.......3
.1,3.....2,3.....2,1
0,1,2...0,2,1...2,0,1
with three different values for the apex, so a(2) = 3.
		

Crossrefs

Cf. A062684, A062896, A099325, A189162, A189390 (maximum apex value), A189391 (minimum apex value).

Programs

  • Haskell
    import Data.List (permutations, nub)
    a066411 0 = 1
    a066411 n = length $ nub $ map
       apex [perm | perm <- permutations [0..n], head perm < last perm] where
       apex = head . until ((== 1) . length)
                           (\xs -> (zipWith (+) xs $ tail xs))
    -- Reinhard Zumkeller, Jan 24 2012
    
  • MATLAB
    for n=0:9
    size(unique(perms(0:n)*diag(fliplr(pascal(n+1)))),1)
    end % Nathaniel Johnston, Apr 20 2011
    (C++)
    #include 
    #include 
    #include 
    #include 
    using namespace std;
    inline long long pascApx(const vector & s)
    {
        const int n = s.size() ;
        vector scp(n) ;
        for(int i=0; i s;
            for(int i=0;i apx;
            do
            {
                apx.insert( pascApx(s)) ;
            } while( next_permutation(s.begin(),s.end()) ) ;
            cout << n << " " << apx.size() << endl ;
        }
        return 0 ;
    } /* R. J. Mathar, Jan 24 2012 */
    
  • Mathematica
    g[s_List] := Plus @@@ Partition[s, 2, 1]; f[n_] := Block[{k = 1, lmt = 1 + (n + 1)!, lst = {}, p = Permutations[Range[0, n]]}, While[k < lmt, AppendTo[ lst, Nest[g, p[[k]], n][[1]]]; k++]; lst]; Table[ Length@ Union@ f@ n, {n, 0, 10}] (* Robert G. Wilson v, Jan 24 2012 *)
  • PARI
    A066411(n)={my(u=0,o=A189391(n),v,b=vector(n++,i,binomial(n-1,i-1))~);sum(k=1,n!\2,!bittest(u,numtoperm(n,k)*b-o) & u+=1<<(numtoperm(n,k)*b-o))}  \\ M. F. Hasler, Jan 24 2012
    
  • Python
    from sympy import binomial
    def partitionpairs(xlist): # generator of all partitions into pairs and at most 1 singleton, returning the sums of the pairs
        if len(xlist) <= 2:
            yield [sum(xlist)]
        else:
            m = len(xlist)
            for i in range(m-1):
                for j in range(i+1,m):
                    rem = xlist[:i]+xlist[i+1:j]+xlist[j+1:]
                    y = [xlist[i]+xlist[j]]
                    for d in partitionpairs(rem):
                        yield y+d
    def A066411(n):
        b = [binomial(n,k) for k in range(n//2+1)]
        return len(set((sum(d[i]*b[i] for i in range(n//2+1)) for d in partitionpairs(list(range(n+1)))))) # Chai Wah Wu, Oct 19 2021

Extensions

More terms from John W. Layman, Jan 07 2003
a(10) from Nathaniel Johnston, Apr 20 2011
a(11) from Alois P. Heinz, Apr 21 2011
a(12) and a(13) from Joerg Arndt, Apr 21 2011
a(14)-a(15) from Alois P. Heinz, Apr 27 2011
a(0)-a(15) verified by R. H. Hardin Jan 27 2012
a(16) from Alois P. Heinz, Jan 28 2012
a(17)-a(21) from Graeme McRae, Jan 28, Feb 01 2012

A189162 The maximum possible value for the apex of a triangle of numbers whose base consists of a permutation of the numbers 1 to n, and each number in a higher row is the sum of the two numbers directly below it.

Original entry on oeis.org

1, 3, 9, 24, 61, 148, 350, 808, 1837, 4116, 9130, 20056, 43746, 94760, 204188, 437712, 934525, 1987252, 4212338, 8900344, 18756886, 39426168, 82693924, 173071024, 361567186, 753984648, 1569877860, 3263572848, 6775522852, 14047800016, 29091783096, 60175932320
Offset: 1

Views

Author

Nathaniel Johnston, Apr 20 2011

Keywords

Comments

The maximum is attained by the triangle with base 1, 3, 5, ..., 2*ceiling(n/2)-1, 2*floor(n/2), ..., 6, 4, 2 (i.e., odd numbers increasing, followed by even numbers decreasing).

Examples

			For n = 5 consider the triangle:
         61
       29  32
     12  17  15
    4   8   9   6
  1   3   5   4   2
This triangle has 61 at its apex and no other such triangle with the numbers 1 - 5 on its base has a larger apex value, so a(5) = 61.
		

Crossrefs

Programs

  • Maple
    a:=proc(n)return 2^(n-1) + add((4*k+1)*binomial(n-1,k),k=0..floor(n/2)-1) + `if`(n mod 2=1,(n-1)*binomial(n-1,(n-1)/2),0):end:
    seq(a(n),n=1..50);
  • Mathematica
    a[n_] := a[n] = Switch[n, 1, 1, 2, 3, 3, 9, 4, 24, _, (1/(n-1))*(4((4n-16)a[n-4] - (4n-16)a[n-3] - 3a[n-2] + (n-1)a[n-1]))];
    Table[a[n], {n, 1, 50}] (* Jean-François Alcover, May 09 2023, after R. J. Mathar *)

Formula

a(n) = 2^(n-1) + A189390(n-1).
D-finite with recurrence (-n+1)*a(n) +4*(n-1)*a(n-1) -12*a(n-2) +16*(-n+4)*a(n-3) +16*(n-4)*a(n-4)=0. - R. J. Mathar, Jun 17 2021

A049610 a(n) = Sum_{k=0..floor(n/2)} k*binomial(n,2*k) = floor(n*2^(n-3)).

Original entry on oeis.org

0, 0, 1, 3, 8, 20, 48, 112, 256, 576, 1280, 2816, 6144, 13312, 28672, 61440, 131072, 278528, 589824, 1245184, 2621440, 5505024, 11534336, 24117248, 50331648, 104857600, 218103808, 452984832, 939524096, 1946157056, 4026531840, 8321499136, 17179869184, 35433480192
Offset: 0

Views

Author

M. F. Hasler, Jan 25 2012

Keywords

Comments

Essentially same as A001792, except for leading zeros, which motivate the existence of this sequence on its own.

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[x^2*(1 - x)/(1 - 2*x)^2, {x, 0, 40}], x] (* Vincenzo Librandi, Jan 09 2013 *)
  • PARI
    a(n)=n<<(n-3)

Formula

G.f. x^2*(1-x)/(1-2*x)^2. - Sergei N. Gladkovskii, Oct 18 2012
G.f.: x^2*( 1 + 2*x*U(0) ) where U(k) = 1 + (k+1)/(2 - 8*x/(4*x + (k+1)/U(k+1))); (continued fraction, 3-step). - Sergei N. Gladkovskii, Oct 19 2012
E.g.f.: x*(exp(2*x) - 1)/4. - Stefano Spezia, Feb 02 2023
Sum_{n>=2} 1/a(n) = 8*log(2) - 4. - Amiram Eldar, Feb 14 2023

A370883 Irregular triangle read by rows: T(n,k) is the number of unmatched right parentheses in the k-th string of parentheses of length n, where strings within a row are in reverse lexicographical order.

Original entry on oeis.org

0, 1, 0, 2, 1, 0, 0, 3, 2, 1, 1, 1, 0, 0, 0, 4, 3, 2, 2, 2, 1, 1, 1, 2, 1, 0, 0, 0, 0, 0, 0, 5, 4, 3, 3, 3, 2, 2, 2, 3, 2, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 6, 5, 4, 4, 4, 3, 3, 3, 4, 3, 2, 2, 2, 2, 2, 2, 4, 3, 2, 2, 2, 1, 1, 1, 2
Offset: 0

Views

Author

Paolo Xausa, Mar 06 2024

Keywords

Comments

Using Knuth's (2011) notation, any string of parentheses can be uniquely written as s_0")"...s_p-1")"s_p"("s_p+1..."("s_q, with 0 <= p <= q, where the substrings s_i are the longest possible properly nested substrings (possibly empty). Examples of properly nested substrings are "()", "()()" and "(())()" (cf. A063171).
Exactly p right parentheses and q-p (cf. A370884) left parentheses are unmatched.
Knuth observes that the above string is part of a chain of length q+1: s_0")"...s_q-1")"s_q, s_0")"...s_q-2")"s_q-1"("s_q, ... , s_0"("s_1..."("s_q, where the q unmatched right parentheses in the first element of the chain are turned, one by one, into unmatched left parentheses in the next elements of the chain. By encoding "(" and ")" with 1 and 0, respectively, such a chain corresponds to a row in the Christmas tree pattern (cf. A367508).

Examples

			Triangle begins:
  [0] 0;
  [1] 1 0;
  [2] 2 1 0 0;
  [3] 3 2 1 1 1 0 0 0;
  [4] 4 3 2 2 2 1 1 1 2 1 0 0 0 0 0 0;
  ...
The strings corresponding to row 2, in reverse lexicographical order, are:
  "))" (2 unmatched right parentheses),
  ")(" (1 unmatched right parenthesis),
  "()" (0 unmatched right parentheses), and
  "((" (0 unmatched right parentheses).
The k-th string in row n corresponds to the binary expansion of k-1, padded with zeros on the left as to make it n digits long, with zeros replaced by ")" and ones replaced by "(".
In the following string the position of the unmatched p = 6 right parentheses is denoted by R, the position of the unmatched q-p = 3 left parentheses is denoted by L, and the q+1 = 10 properly nested substrings s_0..s_9 are marked either with E (empty) or * (nonempty).
.
   R      R      R R R R L      L            L
   ) ()() ) (()) ) ) ) ) ( (()) ( (()(()())) (
  |  \__/   \__/  | | | |  \__/   \________/  |
  E   *      *    E E E E   *         *       E
.
		

References

  • Donald E. Knuth, The Art of Computer Programming, Vol. 4A: Combinatorial Algorithms, Part 1, Addison-Wesley, 2011, Section 7.2.1.6, p. 459.

Crossrefs

Cf. A367508, A370884 (p-q), A370885 (q), A370942 (nonempty nested substrings).
Cf. A000079 (row lengths), A063171.
Apparently, row sums are given by A189391.

Programs

  • Mathematica
    countR[s_] := StringCount[s, "0"] - StringCount[StringJoin[StringCases[s, RegularExpression["1(?R)*+0"]]], "0"];
    Array[Map[countR, IntegerString[Range[0, 2^#-1], 2, #]] &, 7, 0]

Formula

T(n,k) = A370885(n,k) - A370884(n,k).

A370884 Irregular triangle read by rows: T(n,k) is the number of unmatched left parentheses in the k-th string of parentheses of length n, where strings within a row are in reverse lexicographical order.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 1, 3, 0, 1, 0, 2, 0, 1, 1, 3, 0, 1, 0, 2, 0, 2, 2, 4, 0, 1, 0, 2, 0, 1, 1, 3, 0, 1, 0, 2, 0, 2, 2, 4, 0, 1, 0, 2, 0, 1, 1, 3, 0, 1, 1, 3, 1, 3, 3, 5, 0, 1, 0, 2, 0, 1, 1, 3, 0, 1, 0, 2, 0, 2, 2, 4, 0, 1, 0, 2, 0, 1, 1, 3, 0
Offset: 0

Views

Author

Paolo Xausa, Mar 06 2024

Keywords

Comments

See A370883 for more information.
The first half of each row n >= 1 is equal to row n-1.

Examples

			Triangle begins:
  [0] 0;
  [1] 0 1;
  [2] 0 1 0 2;
  [3] 0 1 0 2 0 1 1 3;
  [4] 0 1 0 2 0 1 1 3 0 1 0 2 0 2 2 4;
  ...
The strings corresponding to row 2, in reverse lexicographical order, are:
  "))" (0 unmatched left parentheses),
  ")(" (1 unmatched left parenthesis),
  "()" (0 unmatched left parentheses), and
  "((" (2 unmatched left parentheses).
		

References

  • Donald E. Knuth, The Art of Computer Programming, Vol. 4A: Combinatorial Algorithms, Part 1, Addison-Wesley, 2011, Section 7.2.1.6, p. 459.

Crossrefs

Cf. A000079 (row lengths).
Apparently, row sums are given by A189391.

Programs

  • Mathematica
    countL[s_] := StringCount[s, "1"] - StringCount[StringJoin[StringCases[s, RegularExpression["1(?R)*+0"]]], "1"];
    Array[Map[countL, IntegerString[Range[0, 2^#-1], 2, #]] &, 7, 0]

Formula

T(n,k) = A370885(n,k) - A370883(n,k).

A370885 Irregular triangle read by rows: T(n,k) is the total number of unmatched parentheses (both left and right) in the k-th string of parentheses of length n, where strings within a row are in reverse lexicographical order.

Original entry on oeis.org

0, 1, 1, 2, 2, 0, 2, 3, 3, 1, 3, 1, 1, 1, 3, 4, 4, 2, 4, 2, 2, 2, 4, 2, 2, 0, 2, 0, 2, 2, 4, 5, 5, 3, 5, 3, 3, 3, 5, 3, 3, 1, 3, 1, 3, 3, 5, 3, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 3, 5, 6, 6, 4, 6, 4, 4, 4, 6, 4, 4, 2, 4, 2, 4, 4, 6, 4, 4, 2, 4, 2, 2, 2, 4, 2
Offset: 0

Views

Author

Paolo Xausa, Mar 06 2024

Keywords

Comments

See A370883 for more information.

Examples

			Triangle begins:
  [0] 0;
  [1] 1 1;
  [2] 2 2 0 2;
  [3] 3 3 1 3 1 1 1 3;
  [4] 4 4 2 4 2 2 2 4 2 2 0 2 0 2 2 4;
  ...
		

References

  • Donald E. Knuth, The Art of Computer Programming, Vol. 4A: Combinatorial Algorithms, Part 1, Addison-Wesley, 2011, Section 7.2.1.6, p. 459.

Crossrefs

Cf. A000079 (row lengths).
Apparently, row sums are given by 2*A189391.

Programs

  • Mathematica
    countLR[s_] := StringLength[s] - StringLength[StringJoin[StringCases[s, RegularExpression["1(?R)*+0"]]]];
    Array[Map[countLR, IntegerString[Range[0, 2^#-1], 2, #]] &, 7, 0]

Formula

T(n,k) = A370883(n,k) + A370884(n,k).
Showing 1-10 of 13 results. Next