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.

Previous Showing 11-20 of 35 results. Next

A167762 a(n) = 2*a(n-1)+3*a(n-2)-6*a(n-3) starting a(0)=a(1)=0, a(2)=1.

Original entry on oeis.org

0, 0, 1, 2, 7, 14, 37, 74, 175, 350, 781, 1562, 3367, 6734, 14197, 28394, 58975, 117950, 242461, 484922, 989527, 1979054, 4017157, 8034314, 16245775, 32491550, 65514541, 131029082, 263652487, 527304974, 1059392917, 2118785834, 4251920575, 8503841150
Offset: 0

Views

Author

Paul Curtz, Nov 11 2009

Keywords

Comments

Inverse binomial transform yields two zeros followed by A077917 (a signed variant of A127864).
a(n) mod 10 is zero followed by a sequence with period length 8: 0, 1, 2, 7, 4, 7, 4, 5 (repeat).
a(n) is the number of length n+1 binary words with some prefix w such that w contains three more 1's than 0's and no prefix of w contains three more 0's than 1's. - Geoffrey Critzer, Dec 13 2013
From Gus Wiseman, Oct 06 2023: (Start)
Also the number of subsets of {1..n} with two distinct elements summing to n + 1. For example, the a(2) = 1 through a(5) = 14 subsets are:
{1,2} {1,3} {1,4} {1,5}
{1,2,3} {2,3} {2,4}
{1,2,3} {1,2,4}
{1,2,4} {1,2,5}
{1,3,4} {1,3,5}
{2,3,4} {1,4,5}
{1,2,3,4} {2,3,4}
{2,4,5}
{1,2,3,4}
{1,2,3,5}
{1,2,4,5}
{1,3,4,5}
{2,3,4,5}
{1,2,3,4,5}
The complement is counted by A038754.
Allowing twins gives A167936, complement A108411.
For n instead of n + 1 we have A365544, complement A068911.
The version for all subsets (not just pairs) is A366130.
(End)

Crossrefs

First differences are A167936, complement A108411.

Programs

  • Mathematica
    LinearRecurrence[{2,3,-6},{0,0,1},40] (* Harvey P. Dale, Sep 17 2013 *)
    CoefficientList[Series[x^2/((2 x - 1) (3 x^2 - 1)), {x, 0, 50}], x] (* Vincenzo Librandi, Sep 17 2013 *)
    Table[Length[Select[Subsets[Range[n]],MemberQ[Total/@Subsets[#,{2}],n+1]&]],{n,0,10}] (* Gus Wiseman, Oct 06 2023 *)

Formula

a(n) mod 9 = A153130(n), n>3 (essentially the same as A154529, A146501 and A029898).
a(n+1)-2*a(n) = 0 if n even, = A000244((1+n)/2) if n odd.
a(2*n) = A005061(n). a(2*n+1) = 2*A005061(n).
G.f.: x^2/((2*x-1)*(3*x^2-1)). a(n) = 2^n - A038754(n). - R. J. Mathar, Nov 12 2009
G.f.: x^2/(1-2*x-3*x^2+6*x^3). - Philippe Deléham, Nov 11 2009

Extensions

Edited and extended by R. J. Mathar, Nov 12 2009

A071028 Triangle read by rows giving successive states of cellular automaton generated by "Rule 50".

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0
Offset: 0

Views

Author

Hans Havermann, May 26 2002

Keywords

Comments

Row n has length 2n+1.
Rules #50, #58, #114, #122, #178, #179, #186, #242, #250 all give rise to this sequence.
The following sequences all have the same parity: A004737, A006590, A027052, A071028, A071797, A078358, A078446. - Jeremy Gardiner, Mar 16 2003

Examples

			Triangle begins:
1;
1, 0, 1;
1, 0, 1, 0, 1;
1, 0, 1, 0, 1, 0, 1;
1, 0, 1, 0, 1, 0, 1, 0, 1;
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1;
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1;
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1;
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1;
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1;
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1;
- _Philippe Deléham_, Mar 23 2014
		

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; Chapter 3.

Crossrefs

Cf. A071797.

Programs

  • Mathematica
    rows = 10; ca = CellularAutomaton[50, {{1}, 0}, rows-1]; Flatten[ Table[ca[[k, rows-k+1 ;; rows+k-1]], {k, 1, rows}]] (* Jean-François Alcover, May 24 2012 *)

Formula

a(n) = n - 1 + floor(sqrt(n)) - 2*Sum_{k=1..n-1} a(k) for n >= 1. - Benoit Cloitre, Jan 24 2013
a(n) = A071797(n) (mod 2). - Boris Putievskiy, Jul 24 2013
a(n) = (1+(-1)^(Sum_{k=1..floor(n/2)} floor((n-k)/k)))/2. - Wesley Ivan Hurt, Dec 25 2020

A080883 Distance of n to next square.

Original entry on oeis.org

1, 3, 2, 1, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 19, 18, 17, 16, 15, 14, 13
Offset: 0

Views

Author

Ralf Stephan, Mar 29 2003

Keywords

Comments

The following sequences all have the same parity: A004737, A006590, A027052, A071028, A071797, A078358, A078446, A080883. - Jeremy Gardiner, Dec 30 2006

Crossrefs

Cf. A075555.
Cf. A066635, A053188. - R. J. Mathar, Aug 08 2009

Programs

  • GAP
    List([0..90], n-> Int(1+RootInt(n))^2 -n); # G. C. Greubel, Nov 07 2019
  • Magma
    [Floor(1+Sqrt(n))^2 -n: n in [0..90]]; // G. C. Greubel, Nov 07 2019
    
  • Maple
    A080883 := proc(n) (floor(sqrt(n)+1))^2 -n ; end: seq( A080883(n),n=0..40) ; # R. J. Mathar, Aug 08 2009
  • Mathematica
    Table[Floor[1+Sqrt[n]]^2 -n, {n,0,90}] (* G. C. Greubel, Nov 07 2019 *)
  • PARI
    a(n) = (sqrtint(n)+1)^2-n; \\ Michel Marcus, May 22 2024
    
  • Sage
    [floor(1+sqrt(n))^2 -n for n in (0..90)] # G. C. Greubel, Nov 07 2019
    

Formula

a(n) = floor( sqrt(n)+1 )^2 - n.

A117855 Number of nonzero palindromes of length n (in base 3).

Original entry on oeis.org

2, 2, 6, 6, 18, 18, 54, 54, 162, 162, 486, 486, 1458, 1458, 4374, 4374, 13122, 13122, 39366, 39366, 118098, 118098, 354294, 354294, 1062882, 1062882, 3188646, 3188646, 9565938, 9565938, 28697814, 28697814, 86093442, 86093442, 258280326, 258280326, 774840978
Offset: 1

Views

Author

Martin Renner, May 02 2006

Keywords

Comments

See A225367 for the sequence that counts all base 3 palindromes, including 0 (and thus also the number of n-digit terms in A006072). -- A nonzero palindrome of length L=2k-1 or of length L=2k is determined by the first k digits, which then determine the last k digits by symmetry. Since the first digit cannot be 0, there are 2*3^(k-1) possibilities. - M. F. Hasler, May 05 2013
From Gus Wiseman, Oct 18 2023: (Start)
Also the number of subsets of {1..n} with n not the sum of two subset elements (possibly the same). For example, the a(0) = 1 through a(4) = 6 subsets are:
{} {} {} {} {}
{1} {2} {1} {1}
{2} {3}
{3} {4}
{1,3} {1,4}
{2,3} {3,4}
For subsets with no subset summing to n we have A365377.
Requiring pairs to be distinct gives A068911, complement A365544.
The complement is counted by A366131.
(End) [Edited by Peter Munn, Nov 22 2023]

Examples

			The a(3)=6 palindromes of length 3 are: 101, 111, 121, 202, 212, and 222. - _M. F. Hasler_, May 05 2013
		

Crossrefs

Cf. A050683 and A070252.
Bisections are both A025192.
A093971/A088809/A364534 count certain types of sum-full subsets.
A108411 lists powers of 3 repeated, complement A167936.

Programs

  • Mathematica
    With[{c=NestList[3#&,2,20]},Riffle[c,c]] (* Harvey P. Dale, Mar 25 2018 *)
    Table[Length[Select[Subsets[Range[n]],!MemberQ[Total/@Tuples[#,2],n]&]],{n,0,10}] (* Gus Wiseman, Oct 18 2023 *)
  • PARI
    A117855(n)=2*3^((n-1)\2) \\ - M. F. Hasler, May 05 2013
    
  • Python
    def A117855(n): return 3**(n-1>>1)<<1 # Chai Wah Wu, Oct 28 2024

Formula

a(n) = 2*3^floor((n-1)/2).
a(n) = 2*A108411(n-1).
From Colin Barker, Feb 15 2013: (Start)
a(n) = 3*a(n-2).
G.f.: -2*x*(x+1)/(3*x^2-1). (End)

Extensions

More terms from Colin Barker, Feb 15 2013

A196199 Count up from -n to n for n = 0, 1, 2, ... .

Original entry on oeis.org

0, -1, 0, 1, -2, -1, 0, 1, 2, -3, -2, -1, 0, 1, 2, 3, -4, -3, -2, -1, 0, 1, 2, 3, 4, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8
Offset: 0

Views

Author

Keywords

Comments

This sequence contains every integer infinitely often, hence all integer sequences are subsequences.
This is a fractal sequence.
Indeed, if all terms (a(n),a(n+1)) such that a(n+1) does NOT equal a(n)+1 (<=> a(n+1) < a(n)) are deleted, the same sequence is recovered again. See A253580 for an "opposite" yet similar "fractal tree" construction. - M. F. Hasler, Jan 04 2015

Examples

			Table starts:
            0,
        -1, 0, 1,
    -2, -1, 0, 1, 2,
-3, -2, -1, 0, 1, 2, 3,
...
The sequence of fractions A196199/A004737 = 0/1, -1/1, 0/2, 1/1, -2/1, -1/2, 0/3, 1/2, 2/1, -3/1, -2/2, -1/3, 0/4, 1/3, 2/2, 3/1, -4/4. -3/2, ... contains every rational number (infinitely often) [Laczkovich]. - _N. J. A. Sloane_, Oct 09 2013
		

References

  • Miklós Laczkovich, Conjecture and Proof, TypoTex, Budapest, 1998. See Chapter 10.

Crossrefs

Cf. absolute values A053615, A002262, A002260, row lengths A005408, row sums A000004, A071797.

Programs

  • Haskell
    a196199 n k = a196199_row n !! k
    a196199_tabf = map a196199_row [0..]
    a196199_row n = [-n..n]
    b196199 = bFile' "A196199" (concat $ take 101 a196199_tabf) 0
    -- Reinhard Zumkeller, Sep 30 2011
    
  • Maple
    seq(seq(j-k-k^2, j=k^2 .. (k+1)^2-1), k = 0 .. 10); # Robert Israel, Jan 05 2015
    # Alternatively, as a table with rows -n<=k<=n (compare A257564):
    r := n -> (n-(n mod 2))/2: T := (n, k) -> r(n+k) - r(n-k):
    seq(print(seq(T(n, k), k=-n..n)), n=0..6); # Peter Luschny, May 28 2015
  • Mathematica
    Table[Range[-n, n], {n, 0, 9}] // Flatten
    (* or *)
    a[n_] := With[{t = Floor[Sqrt[n]]}, n - t (t + 1)];
    Table[a[n], {n, 0, 99}] (* Jean-François Alcover, Jul 13 2018, after Boris Putievskiy *)
  • PARI
    r=[];for(k=0,8,r=concat(r,vector(2*k+1,j,j-k-1)));r
    
  • Python
    from math import isqrt
    def A196199(n): return n-(t:=isqrt(n))*(t+1) # Chai Wah Wu, Aug 04 2022

Formula

a(n) = n - t*t - t - 1, where t = floor(sqrt(n-1)). - Boris Putievskiy, Jan 28 2013
G.f.: x/(x-1)^2 + 1/(x-1)*sum(k >= 1, 2*k*x^(k^2)). The series is related to Jacobi theta functions. - Robert Israel, Jan 05 2015

A078446 a(1)=a(2)=1; a(n)=a(n-2)/2 if a(n-2) is even, a(n)=a(n-1)+a(n-2) otherwise.

Original entry on oeis.org

1, 1, 2, 3, 1, 4, 5, 2, 7, 1, 8, 9, 4, 13, 2, 15, 1, 16, 17, 8, 25, 4, 29, 2, 31, 1, 32, 33, 16, 49, 8, 57, 4, 61, 2, 63, 1, 64, 65, 32, 97, 16, 113, 8, 121, 4, 125, 2, 127, 1, 128, 129, 64, 193, 32, 225, 16, 241, 8, 249, 4, 253, 2, 255, 1, 256, 257, 128, 385, 64, 449, 32, 481, 16, 497
Offset: 1

Views

Author

Benoit Cloitre, Dec 31 2002

Keywords

Comments

The following sequences all have the same parity: A004737, A006590, A027052, A071028, A071797, A078358, A078446. - Jeremy Gardiner, Mar 16 2003

Programs

  • Maple
    a:= proc(n) option remember;
          if n < 3 then 1
        elif `mod`(procname(n-2), 2) = 0 then procname(n-2)/2
        else procname(n-1) + procname(n-2)
          fi
        end:
    seq(a(n), n=1..80); # G. C. Greubel, Nov 07 2019
  • Mathematica
    a[n_]:= a[n]= If[n<3, 1, If[EvenQ[a[n-2]], a[n-2]/2, a[n-1]+a[n-2]]];
    Table[a[n], {n, 80}] (* G. C. Greubel, Nov 07 2019 *)
    nxt[{a_,b_}]:={b,If[EvenQ[a],a/2,a+b]}; NestList[nxt,{1,1},80][[;;,1]] (* Harvey P. Dale, Jul 18 2025 *)
  • PARI
    a(n) = if(n<3, 1, if(a(n-2)%2==0, a(n-2)/2, a(n-1) + a(n-2) )); \\ G. C. Greubel, Nov 07 2019
    
  • Sage
    @CachedFunction
    def a(n):
        if (n<3): return 1
        elif (a(n-2)%2==0): return a(n-2)/2
        else: return a(n-1) + a(n-2)
    [a(n) for n in (1..80)] # G. C. Greubel, Nov 07 2019

Formula

a(n^2)=2^n-1; a(n^2+1)=1; a(n^2+2)=2^n; a(n^2+3)=2^n+1; a(n^2+4)=2^(n-1); a(n^2+5)=3*2^n+1 ...; inequality : a(n)/2^sqrt(n) <2
Sum(k=1, n^2, a(k)) = 2*(n-2)*2^n + n*(n+1)/2 + 4

A109439 Triangle read by rows, in which row n gives coefficients in expansion of ((1 - x^n)/(1 - x))^3.

Original entry on oeis.org

1, 1, 3, 3, 1, 1, 3, 6, 7, 6, 3, 1, 1, 3, 6, 10, 12, 12, 10, 6, 3, 1, 1, 3, 6, 10, 15, 18, 19, 18, 15, 10, 6, 3, 1, 1, 3, 6, 10, 15, 21, 25, 27, 27, 25, 21, 15, 10, 6, 3, 1, 1, 3, 6, 10, 15, 21, 28, 33, 36, 37, 36, 33, 28, 21, 15, 10, 6, 3, 1, 1, 3, 6, 10, 15, 21, 28, 36, 42, 46, 48, 48
Offset: 1

Views

Author

Labos Elemer, Jun 30 2005

Keywords

Comments

Sum of n-th row is n^3. The n-th row contains 3n-2 entries. Largest coefficients in rows are listed in A077043. The 255th row describes the distribution of color lattice points in the 765 r+g+b=k planes of the 24-bit RGB-cube with 256^3 points.
Also, the number of cubes of dimension 1 X 1 X 1 needed to build a cube by layers perpendicular to the main diagonal. Each layer is made up of regular triangular numbers T near the summits and truncated T's in the middle. E.g., cube 3^3 is made of layers 1, 3, 6, 7, 6, 3, 1, using T1, T2, T3 and a regularly truncated T4, 7 instead of 10. - M. Dauchez (mdzzdm(AT)yahoo.fr), Aug 31 2005
The n-th row is the third row of the (n+1)-nomial triangle. For example, row 1 (1,3,3,1) is the third row in the binomial triangle; row 5 is the third row of the 6-nomial triangle. - Bob Selcoe, Feb 18 2014
It appears that T(n,k) gives the number of possible ways of randomly selecting k cards from n-1 sets, each with three different playing cards. - Juan Pablo Herrera P., Nov 04 2016

Examples

			Triangle starts:
  1;
  1, 3, 3, 1;
  1, 3, 6, 7, 6, 3, 1;
  1, 3, 6,10,12,12,10, 6, 3, 1;
  1, 3, 6,10,15,18,19,18,15,10, 6, 3, 1;
  1, 3, 6,10,15,21,25,27,27,25,21,15,10, 6, 3, 1;
  1, 3, 6,10,15,21,28,33,36,37,36,33,28,21,15,10, 6, 3, 1.
		

Crossrefs

Programs

  • Mathematica
    Flatten[Table[CoefficientList[Series[((1-x^n)/(1-x))^3,{x,1,3*n}],x], {n,1,100}],1]
  • PARI
    row(n) = Vec(((1 - x^n)/(1 - x))^3);
    tabf(nn) = for (n=1, nn, print(row(n))); \\ Michel Marcus, Oct 12 2016

Formula

From Juan Pablo Herrera P., Oct 17 2016: (Start)
T(n,k) = A000217(k+1) = (k+2)!/(k!*2) if 0 <= k < n,
T(n,k) = (9*n-3*n^2+6*k*n-6*k-2*k^2-4)/2 if n-3 < k < 2*n,
T(n,k) = A000217(3n-k-2) = (3*n-k-1)!/((3*(n-1)-k)!*2) if 2*n-3 < k < 3*n-2.
T(n,k) = Sum_{i=k-n+1..k} A004737(T(n,i)),
T(n,k) = Sum_{i=k-n+1..k} (n-|n-i-1|) if n <= k <= 2*n+1. (End)

Extensions

Offset corrected by Joerg Arndt at the suggestion of Michel Marcus, Oct 12 2016

A124258 Triangle whose rows are sequences of increasing and decreasing squares: 1; 1,4,1; 1,4,9,4,1; ...

Original entry on oeis.org

1, 1, 4, 1, 1, 4, 9, 4, 1, 1, 4, 9, 16, 9, 4, 1, 1, 4, 9, 16, 25, 16, 9, 4, 1, 1, 4, 9, 16, 25, 36, 25, 16, 9, 4, 1, 1, 4, 9, 16, 25, 36, 49, 36, 25, 16, 9, 4, 1, 1, 4, 9, 16, 25, 36, 49, 64, 49, 36, 25, 16, 9, 4, 1, 1, 4, 9, 16, 25, 36, 49, 64, 81, 64, 49, 36, 25, 16, 9, 4, 1, 1, 4, 9, 16
Offset: 1

Views

Author

Jonathan Vos Post, Dec 16 2006

Keywords

Comments

The triangle A003983 with individual entries squared and each 2nd row skipped.
Analogous to A004737. - Peter Bala, Sep 25 2007
T(n,k) = min(n,k)^2. The order of the list T(n,k) is by sides of squares from T(1,n) to T(n,n), then from T(n,n) to T(n,1). - Boris Putievskiy, Jan 13 2013

Examples

			Triangle starts
  1;
  1, 4, 1;
  1, 4, 9, 4, 1:
  1, 4, 9, 16, 9, 4, 1:
From _Boris Putievskiy_, Jan 13 2013: (Start)
The start of the sequence as table:
  1...1...1...1...1...1...
  1...4...4...4...4...4...
  1...4...9...9...9...9...
  1...4...9..16..16..16...
  1...4...9..16..25..25...
  1...4...9..16..25..36...
  ...
The start of the sequence as triangle array read by rows:
  1;
  1, 4, 1;
  1, 4, 9,  4,  1;
  1, 4, 9, 16,  9,  4,  1;
  1, 4, 9, 16, 25, 16,  9,  4, 1;
  1, 4, 9, 16, 25, 36, 25, 16, 9, 4, 1;
  ...
Row number k contains 2*k-1 numbers 1,4,...,(k-1)^2,k^2,(k-1)^2,...,4,1. (End)
		

Crossrefs

Programs

  • Maple
    A003983 := proc(n,k) min(n,k) ; end: A124258 := proc(n,k) A003983(n,k)^2 ; end: for d from 1 to 20 by 2 do for c from 1 to d do printf("%d, ",A124258(d+1-c,c)) ; od: od: # R. J. Mathar, Sep 21 2007
    # second Maple program:
    T:= n-> i^2$i=1..n, (n-i)^2$i=1..n-1:
    seq(T(n), n=1..10);  # Alois P. Heinz, Feb 15 2022
  • Mathematica
    Flatten[Table[Join[Range[n]^2,Range[n-1,1,-1]^2],{n,10}]] (* Harvey P. Dale, Jun 14 2015 *)

Formula

O.g.f.: (1+qx)^2/((1-x)(1-qx)^2(1-q^2x)) = 1 + x(1 + 4q + q^2) + x^2(1 + 4q + 9q^2 + 4q^3 + q^4) + ... . - Peter Bala, Sep 25 2007
From Boris Putievskiy, Jan 13 2013: (Start)
a(n) = (A004737(n))^2.
a(n) = (floor(sqrt(n-1)) - |n- floor(sqrt(n-1))^2- floor(sqrt(n-1))-1| +1)^2. (End)

Extensions

More terms from R. J. Mathar, Sep 21 2007
Edited by N. J. A. Sloane, Jun 30 at the suggestion of R. J. Mathar

A242357 Crescendo trapezoidal.

Original entry on oeis.org

1, 1, 2, 2, 1, 1, 2, 3, 3, 3, 2, 1, 1, 2, 3, 4, 4, 4, 4, 3, 2, 1, 1, 2, 3, 4, 5, 5, 5, 5, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 6, 6, 6, 6, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 7
Offset: 1

Views

Author

Reinhard Zumkeller, May 11 2014

Keywords

Comments

a(A000326(n)) = a(A143689(n-1)) = 1;
for all n: a(k) = n, A104249(n-1) <= k <= A005448(n).

Examples

			. Initial values
. seen trapezoidal:                                  666666
.                                    55555          5......5
.                       4444        4.....4        4........4
.             333      3....3      3.......3      3..........3
.      22    2...2    2......2    2.........2    2............2
.  1  1..1  1.....1  1........1  1...........1  1..............1 .
		

Crossrefs

Cf. A004737.

Programs

  • Haskell
    import Data.List (inits)
    a242357 n = a242357_list !! (n-1)
    a242357_list = concatMap f $ tail $ inits [1..] where
       f us = (init us) ++ (take v [v, v ..]) ++ vs
              where (v:vs) = reverse us
  • Mathematica
    Table[Join[Range[n-1],PadRight[{},n,n],Range[n-1,1,-1]],{n,9}]//Flatten (* Harvey P. Dale, Oct 23 2020 *)

A273975 Three-dimensional array written by antidiagonals in k,n: T(k,n,h) with k >= 1, n >= 0, 0 <= h <= n*(k-1) is the coefficient of x^h in the polynomial (1 + x + ... + x^(k-1))^n = ((x^k-1)/(x-1))^n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 3, 2, 1, 1, 3, 6, 7, 6, 3, 1, 1, 4, 6, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 3, 6, 10, 12, 12, 10, 6, 3, 1, 1, 4, 10
Offset: 1

Views

Author

Andrey Zabolotskiy, Nov 10 2016

Keywords

Comments

Equivalently, T(k,n,h) is the number of ordered sets of n nonnegative integers < k with the sum equal to h.
From Juan Pablo Herrera P., Nov 21 2016: (Start)
T(k,n,h) is the number of possible ways of randomly selecting h cards from k-1 sets, each with n different playing cards. It is also the number of lattice paths from (0,0) to (n,h) using steps (1,0), (1,1), (1,2), ..., (1,k-1).
Shallow diagonal sums of each triangle with fixed k give the k-bonacci numbers. (End)
T(k,n,h) is the number of n-dimensional grid points of a k X k X ... X k grid, which are lying in the (n-1)-dimensional hyperplane which is at an L1 distance of h from one of the grid's corners, and normal to the corresponding main diagonal of the grid. - Eitan Y. Levine, Apr 23 2023

Examples

			For first few k and for first few n, the rows with h = 0..n*(k-1) are given:
k=1:  1;  1;  1;  1;  1; ...
k=2:  1;  1, 1;  1, 2, 1;  1, 3, 3, 1;  1, 4, 6, 4, 1; ...
k=3:  1;  1, 1, 1;  1, 2, 3, 2, 1;  1, 3, 6, 7, 6, 3, 1; ...
k=4:  1;  1, 1, 1, 1;  1, 2, 3, 4, 3, 2, 1; ...
For example, (1 + x + x^2)^3 = 1 + 3*x + 6*x^2 + 7*x^3 + 6*x^4 + 3*x^5 + x^6, hence T(3,3,2) = T(3,3,4) = 6.
From _Eitan Y. Levine_, Apr 23 2023: (Start)
Example for the repeated cumulative sum formula, for (k,n)=(3,3) (each line is the cumulative sum of the previous line, and the first line is the padded, alternating 3rd row from Pascal's triangle):
  1  0  0 -3  0  0  3  0  0 -1
  1  1  1 -2 -2 -2  1  1  1
  1  2  3  1 -1 -3 -2 -1
  1  3  6  7  6  3  1
which is T(3,3,h). (End)
		

Crossrefs

k-nomial arrays for fixed k=1..10: A000012, A007318, A027907, A008287, A035343, A063260, A063265, A171890, A213652, A213651.
Arrays for fixed n=0..6: A000012, A000012, A004737, A109439, A277949, A277950, A277951.
Central n-nomial coefficients for n=1..9, i.e., sequences with h=floor(n*(k-1)/2) and fixed n: A000012, A000984 (A001405), A002426, A005721 (A005190), A005191, A063419 (A018901), A025012, (A025013), A025014, A174061 (A025015), A201549, (A225779), A201550. Arrays: A201552, A077042, see also cfs. therein.
Triangle n=k-1: A181567. Triangle n=k: A163181.

Programs

  • Mathematica
    a = Table[CoefficientList[Sum[x^(h-1),{h,k}]^n,x],{k,10},{n,0,9}];
    Flatten@Table[a[[s-n,n+1]],{s,10},{n,0,s-1}]
    (* alternate program *)
    row[k_, n_] := Nest[Accumulate,Upsample[Table[((-1)^j)*Binomial[n,j],{j,0,n}],k],n][[;;n*(k-1)+1]] (* Eitan Y. Levine, Apr 23 2023 *)

Formula

T(k,n,h) = Sum_{i = 0..floor(h/k)} (-1)^i*binomial(n,i)*binomial(n+h-1-k*i,n-1). [Corrected by Eitan Y. Levine, Apr 23 2023]
From Eitan Y. Levine, Apr 23 2023: (Start)
(T(k,n,h))_{h=0..n*(k-1)} = f(f(...f(g(P))...)), where:
(x_i)_{i=0..m} denotes a tuple (in particular, the LHS contains the values for 0 <= h <= n*(k-1)),
f repeats n times,
f((x_i){i=0..m}) = (Sum{j=0..i} x_j)_{i=0..m} is the cumulative sum function,
g((x_i){i=0..m}) = (x(i/k) if k|i, otherwise 0)_{i=0..m*k} is adding k-1 zeros between adjacent elements,
and P=((-1)^i*binomial(n,i))_{i=0..n} is the n-th row of Pascal's triangle, with alternating signs. (End)
From Eitan Y. Levine, Jul 27 2023: (Start)
Recurrence relations, the first follows from the sequence's defining polynomial as mentioned in the Smarandache link:
T(k,n+1,h) = Sum_{i = 0..s-1} T(k,n,h-i)
T(k+1,n,h) = Sum_{i = 0..n} binomial(n,i)*T(k,n-i,h-i*k) (End)
Previous Showing 11-20 of 35 results. Next