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

A189391 The minimum 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, 3, 8, 19, 44, 98, 216, 467, 1004, 2134, 4520, 9502, 19928, 41572, 86576, 179587, 372044, 768398, 1585416, 3263210, 6711176, 13775068, 28255568, 57863214, 118430584, 242061468, 494523536, 1009105372, 2058327344, 4194213448
Offset: 0

Views

Author

Nathaniel Johnston, Apr 20 2011

Keywords

Comments

This is the Riordan transform of A000217 (triangular numbers) with the Riordan matrix (of the Bell type) A053121 (inverse of the Chebyshev S Bell matrix). See the resulting formulae below. - Wolfdieter Lang, Feb 18 2017.
Conjecture: a(n) is also half the sum of the "cuts-resistance" (see A319416, A319420, A319421) of all binary vectors of length n (see Lenormand, page 4). - N. J. A. Sloane, Sep 20 2018

Examples

			For n = 4 consider the triangle:
....19
...8  11
..5  3  8
.4  1 2  6
3  1 0 2  4
This triangle has 19 at its apex and no other such triangle with the numbers 0 - 4 on its base has a smaller apex value, so a(4) = 19.
		

Crossrefs

Programs

  • Magma
    m:=30; R:=PowerSeriesRing(Rationals(), m); [0] cat Coefficients(R!((2*x+Sqrt(1-4*x^2)-1)/(2*(2*x-1)^2))); // G. C. Greubel, Aug 24 2018
  • Maple
    a:=proc(n)return add((2*n-4*k-1)*binomial(n,k),k=0..floor((n-1)/2)): end:
    seq(a(n),n=0..50);
  • Mathematica
    CoefficientList[Series[(2*x+Sqrt[1-4*x^2]-1) / (2*(2*x-1)^2), {x, 0, 20}], x] (* Vaclav Kotesovec, Mar 16 2014 *)
  • PARI
    A189391(n)=sum(i=0,(n-1)\2,(2*n-4*i-1)*binomial(n,i))  \\ M. F. Hasler, Jan 24 2012
    

Formula

If n even, a(n) = (n+1/2)*binomial(n,n/2) - 2^(n-1); if n odd, a(n) = ((n+1)/2)*binomial(n+1,(n+1)/2) - 2^(n-1). - N. J. A. Sloane, Nov 01 2018
a(n) = Sum_{k=0..floor((n-1)/2)} (2*n-4*k-1)*binomial(n,k).
G.f.: (2*x+sqrt(1-4*x^2)-1) / (2*(2*x-1)^2). - Alois P. Heinz, Feb 09 2012
a(n) ~ 2^n * (sqrt(2n/Pi)- 1/2). - Vaclav Kotesovec, Mar 16 2014 (formula simplified by Lewis Chen, May 25 2017)
D-finite with recurrence n*a(n) + (n-5)*a(n-1) + 2*(-5*n+6)*a(n-2) + 4*(-n+8)*a(n-3) + 24*(n-3)*a(n-4) = 0. - R. J. Mathar, Jan 04 2017
From Wolfdieter Lang, Feb 18 2017:(Start)
a(n) = Sum_{m=0..n} A053121(n, m)*A000217(m), n >= 0.
G.f.: c(x^2)*Tri(x*c(x^2)), with c and Tri the g.f. of A000108 and A000217, respectively. See the explicit form of the g.f. given above by Alois P. Heinz.
(End)
2*a(n) = A152548(n)-2^n. - R. J. Mathar, Jun 17 2021

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

A099326 Expansion of ((1-2x)*sqrt(1+2x) + sqrt(1-2x))/(2*(1-2x)^(5/2)).

Original entry on oeis.org

1, 4, 11, 28, 67, 156, 354, 792, 1747, 3820, 8278, 17832, 38174, 81368, 172644, 365104, 769411, 1617228, 3389838, 7090440, 14797546, 30828424, 64106716, 133113168, 275967022, 571415416, 1181585564, 2440680592, 5035637212
Offset: 0

Views

Author

Paul Barry, Oct 12 2004

Keywords

Comments

a(n) = Sum_{k=0..n} (k+1)*binomial(n,(n-k)/2)*binomial(k+3,3)*(1+(-1)^(n-k))/(n+k+2). The g.f. is transformed to 1/(1-x)^4 under the Chebyshev transformation A(x) -> (1/(1+x^2))*A(x/(1+x^2)). Second binomial transform of the sequence with g.f. 1/c(-x)^2, where c(x) is the g.f. of the Catalan numbers A000108.
0, 1, 4, 11, 28, ... is the image of the quarter-squares floor((n+1)^2/4) (A002620(n+1)) under the Riordan array ((1+2x)/sqrt(1-4x^2), x*c(x^2)). Hankel transform of A099326 has g.f. (1-x)/(1+x)^4. - Paul Barry, Oct 25 2007

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[((1-2*x)*Sqrt[1+2*x]+Sqrt[1-2*x])/(2*(1-2*x)^(5/2)), {x, 0, 20}], x] (* Vaclav Kotesovec, Feb 12 2014 *)

Formula

a(n) = Sum_{k=0..n} (k+1)*binomial(n, (n-k)/2)*binomial(k+3, 3)*(1 + (-1)^(n-k))/(n+k+2).
a(n) = Sum_{k=0..n} C(n,k)*(floor((abs(n-2k) + 1)^2/4) + floor((abs(n-2k+1) + 1)^2/4)). - Paul Barry, Oct 25 2007
D-finite with recurrence: n*(n-2)*a(n) +2*(-n^2+3)*a(n-1) -4*(n-1)*(n-4)*a(n-2) +8*(n-1)*(n-2)*a(n-3)=0. - R. J. Mathar, Nov 24 2012
a(n) ~ n * 2^(n-1) * (1 + 2*sqrt(2/(Pi*n))). - Vaclav Kotesovec, Feb 12 2014

A099327 Expansion of ((1-x)*sqrt(1+2x) + (1+x)*sqrt(1-2x))/(2*(1-2x)^(5/2)).

Original entry on oeis.org

1, 5, 16, 45, 117, 291, 700, 1646, 3799, 8647, 19448, 43330, 95738, 210094, 458216, 994204, 2146955, 4617439, 9893376, 21128058, 44982486, 95510090, 202278376, 427425860, 901236582, 1896594966, 3983929680, 8354539156, 17492095604
Offset: 0

Views

Author

Paul Barry, Oct 12 2004

Keywords

Comments

The g.f. is transformed to 1/(1-x)^5 under the Chebyshev transformation A(x)->1/(1+x^2)A(x/(1+x^2)). Second binomial transform of the sequence with g.f. 1/c(-x)^3, where c(x) is the g.f. of the Catalan numbers A000108.

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[((1-x)*Sqrt[1+2*x]+(1+x)*Sqrt[1-2*x])/(2*(1-2*x)^(5/2)), {x, 0, 20}], x] (* Vaclav Kotesovec, Feb 08 2014 *)

Formula

a(n) = Sum_{k=0..n} (k+1)*binomial(n, (n-k)/2)*binomial(k+4, 4)*(1+(-1)^(n-k))/(n+k+2).
D-finite with recurrence: n*(n-3)*a(n) + 2*(-n^2+6)*a(n-1) + 4*(n-1)*(n-5)*a(n-2) + 8*(n-1)*(n-2)*a(n-3) = 0. - R. J. Mathar, Nov 24 2012
a(n) ~ 2^(n+1/2) *n^(3/2) / (3*sqrt(Pi)) * (1 + 9/8*sqrt(2*Pi/n)). - Vaclav Kotesovec, Feb 08 2014
Showing 1-6 of 6 results.