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

A368516 Irregular triangular array T, read by rows: T(n,k) = number of sums |x-y|+|y-z| = k, where x,y,z are in {1,2,...,n} and x != y and y != z.

Original entry on oeis.org

2, 6, 4, 2, 10, 12, 8, 4, 2, 14, 20, 20, 12, 8, 4, 2, 18, 28, 32, 28, 18, 12, 8, 4, 2, 22, 36, 44, 44, 38, 24, 18, 12, 8, 4, 2, 26, 44, 56, 60, 58, 48, 32, 24, 18, 12, 8, 4, 2, 30, 52, 68, 76, 78, 72, 60, 40, 32, 24, 18, 12, 8, 4, 2, 34, 60, 80, 92, 98, 96
Offset: 1

Views

Author

Clark Kimberling, Dec 31 2023

Keywords

Comments

Row n consists of 2n-1 even positive integers.

Examples

			First six rows:
   2
   6    4    2
  10   12    8    4    2
  14   20   20   12    8    4    2
  18   28   32   28   18   12    8    4   2
  22   36   44   44   38   24   18   12   8   4   2
For n=3, there are 12 triples (x,y,z) having x != y and y != z:
  121:  |x-y| + |y-z| = 2
  123:  |x-y| + |y-z| = 2
  131:  |x-y| + |y-z| = 4
  132:  |x-y| + |y-z| = 3
  212:  |x-y| + |y-z| = 2
  213:  |x-y| + |y-z| = 3
  231:  |x-y| + |y-z| = 3
  232:  |x-y| + |y-z| = 2
  312:  |x-y| + |y-z| = 3
  313:  |x-y| + |y-z| = 4
  321:  |x-y| + |y-z| = 2
  323:  |x-y| + |y-z| = 2,
so that row 2 of the array is (6,4,2), representing six 2s, four 3s, and two 4s.
		

Crossrefs

Cf. A011379 (row sums), A007590 (limiting reverse row), A368434, A368437, A368515, A368517, A368518, A368519, A368520, A368521, A368522.

Programs

  • Mathematica
    t1[n_] := t1[n] = Tuples[Range[n], 3];
    t[n_] := t[n] = Select[t1[n], #[[1]] != #[[2]] && #[[2]] != #[[3]] &];
    a[n_, k_] := Select[t[n], Abs[#[[1]] - #[[2]]] + Abs[#[[2]] - #[[3]]] == k &];
    u = Table[Length[a[n, k]], {n, 2, 15}, {k, 2, 2 n - 2}]
    v = Flatten[u];  (* sequence *)
    Column[Table[Length[a[n, k]], {n, 2, 15}, {k, 2, 2 n - 2}]]  (* array *)

A028724 a(n) = (1/2)*floor(n/2)*floor((n-1)/2)*floor((n-2)/2).

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 6, 9, 18, 24, 40, 50, 75, 90, 126, 147, 196, 224, 288, 324, 405, 450, 550, 605, 726, 792, 936, 1014, 1183, 1274, 1470, 1575, 1800, 1920, 2176, 2312, 2601, 2754, 3078, 3249, 3610, 3800, 4200, 4410, 4851, 5082, 5566, 5819, 6348, 6624, 7200
Offset: 0

Views

Author

Keywords

Comments

Number of symmetric Dyck paths of semilength n and having four peaks. E.g., a(5)=2 because we have UU*DU*DU*DU*DD and U*DUU*DU*DDU*D, where U=(1,1), D=(1,-1) and * indicates peaks. - Emeric Deutsch, Jan 12 2004
Starting with "1" = triangle A171608 * the triangular numbers. - Gary W. Adamson, Dec 12 2009
Integer solutions of (x + y)^3 = (x - y)^2. If x = a(2*n + 2) then y = -a(2*n + 1). y and x may be interchanged. - Thomas Scheuerle, Mar 22 2023
2*a(n+3) interleaves the positive integers of A011379 and A045991. - J.S. Seneschal, Mar 31 2025

Examples

			a(7) = 9 since the 9 tuples [x, y, z, w] in {[4, 3, 2, 2] [4, 3, 3, 2] [4, 3, 3, 3] [4, 3, 4, 2] [4, 3, 4, 3] [5, 2, 2, 2] [5, 2, 3, 2] [5, 2, 4, 2] [5, 2, 5, 2]} are all the solutions of 7 = x + y, x >= max(y, z), min(y, z) >= w >= 2.
		

References

  • P. A. MacMahon, Combinatory Analysis, Cambridge Univ. Press, London and New York, Vol. 1, 1915 and Vol. 2, 1916; see vol. 2, p 185, Article 433.

Crossrefs

Programs

  • Magma
    [((-1)^n*(3 -3*n +n^2) -(3 -11*n +9*n^2 -2*n^3))/32: n in [0..60]]; // G. C. Greubel, Apr 08 2022
    
  • Maple
    A028724:=n->(1/2)*floor(n/2)*floor((n-1)/2)*floor((n-2)/2);
    seq(A028724(k), k=0..100); # Wesley Ivan Hurt, Nov 01 2013
  • Mathematica
    Table[(1/2)*Floor[n/2]*Floor[(n-1)/2]*Floor[(n-2)/2], {n,0,100}] (* Wesley Ivan Hurt, Nov 01 2013 *)
    Table[(11n-3-9n^2+2n^3+(-1)^n(3-3n+n^2))/32,{n,0,60}] (* Benedict W. J. Irwin, Sep 27 2016 *)
    CoefficientList[Series[x^4 (1 + x + x^2)/(x - 1)^4/(x + 1)^3, {x, 0, 60}], x] (* Michael De Vlieger, Sep 27 2016 *)
  • PARI
    {a(n) = (n\2) * ((n-1)\2) * (n\2-1) / 2} /* Michael Somos, Jan 27 2008 */
    
  • PARI
    {a(n) = if( n<0, n=-1-n; -1, n-=4; 1) * polcoeff( (1 - x^3) / (1 - x)^2 / (1 - x^2)^3 + x*O(x^n), n)} /* Michael Somos, Jan 27 2008 */
    
  • PARI
    first(n) = Vec(x^4*(1+x+x^2)/(x-1)^4/(x+1)^3 + O(x^(n)), -n) \\ Iain Fox, Nov 18 2017
    
  • SageMath
    [(1/2)*(n//2)*((n-1)//2)*((n-2)//2) for n in (0..60)] # G. C. Greubel, Apr 08 2022

Formula

G.f.: x^4*(1+x+x^2)/((1-x)^4*(1+x)^3). - Ralf Stephan, Jun 22 2003
Number of tuples [x, y, z, w] of integers such that n = x + y, x >= max(y, z), min(y, z) >= w >= 2. - Michael Somos, Jan 27 2008
Euler transform of length 3 sequence [2, 3, -1]. - Michael Somos, Jan 27 2008
a(3-n) = -a(n). - Michael Somos, Jan 27 2008
a(n) = (-3 + 11*n - 9*n^2 + 2*n^3 + (-1)^n*(3 - 3*n + n^2))/32. - Benedict W. J. Irwin, Sep 27 2016
a(n) = Sum_{i=1..floor((n-1)/2)} i * ( floor((n-1)/2) mod (n-i-1) ). - Wesley Ivan Hurt, Nov 17 2017
E.g.f.: (1/32)*( (3 + 2*x + x^2)*exp(-x) - (1-x)*(3 - x + 2*x^2)*exp(x) ). - G. C. Greubel, Apr 08 2022
From Amiram Eldar, Apr 16 2023: (Start)
Sum_{n>=4} 1/a(n) = 2.
Sum_{n>=4} (-1)^n/a(n) = 2*Pi^2/3 - 6. (End)

A099721 a(n) = n^2*(2*n+1).

Original entry on oeis.org

0, 3, 20, 63, 144, 275, 468, 735, 1088, 1539, 2100, 2783, 3600, 4563, 5684, 6975, 8448, 10115, 11988, 14079, 16400, 18963, 21780, 24863, 28224, 31875, 35828, 40095, 44688, 49619, 54900, 60543, 66560, 72963, 79764, 86975, 94608, 102675, 111188, 120159, 129600
Offset: 0

Views

Author

Douglas Winston (douglas.winston(AT)srupc.com), Nov 07 2004

Keywords

Comments

For a right triangle with sides of lengths 8*n^3 + 12*n^2 + 8*n + 2, 4*n^4 + 8*n^3 + 4*n^2, and 4*n^4 + 8*n^3 + 12*n^2 + 8*n + 2, dividing the area by the perimeter gives a(n). - J. M. Bergot, Jul 30 2013
This sequence is the difference between the centered icosahedral (or cuboctahedral) numbers (A005902(n)) and the centered octagonal pyramidal numbers (A000447(n+1)). - Peter M. Chema, Jan 09 2016
a(n) is the sum of the integers in the closed interval (n-1)*n to n*(n+1). - J. M. Bergot, Apr 19 2017

Crossrefs

Programs

Formula

G.f.: x*(3 + 8*x + x^2)/(x-1)^4.
a(n) = A024196(n) - A024196(n-1). - Philippe Deléham, May 07 2012
a(n) = ceiling(Sum_{i=n^2-(n-1)..n^2+(n-1)} s(i)), for n > 0 and integer i, where s(i) are the real solutions to x = i + sqrt(x), and the summation range excludes the integer solutions which occur where i is an oblong number (A002378). The fractional portion of the summation converges to 2/3 for large n. If s(i) is replaced with i, then the summation equals n^2*(2*n-1) = A015237. - Richard R. Forberg, Oct 15 2014
a(n) = A005902(n) - A000447(n+1). - Peter M. Chema, Jan 09 2016
From Amiram Eldar, May 17 2022: (Start)
Sum_{n>=1} 1/a(n) = Pi^2/6 + 4*log(2) - 4.
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi^2/12 - Pi - 2*log(2) + 4. (End)
From Elmo R. Oliveira, Aug 08 2025: (Start)
E.g.f.: x*(1 + 2*x)*(3 + x)*exp(x).
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4).
a(n) = A000290(n)*A005408(n). (End)

A221515 T(n,k)=Number of 0..k arrays of length n with each element differing from at least one neighbor by 2 or more, starting with 0.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 1, 0, 0, 3, 3, 2, 0, 0, 4, 7, 12, 3, 0, 0, 5, 13, 36, 30, 5, 0, 0, 6, 21, 80, 130, 89, 8, 0, 0, 7, 31, 150, 381, 532, 248, 13, 0, 0, 8, 43, 252, 884, 1970, 2088, 706, 21, 0, 0, 9, 57, 392, 1765, 5513, 9940, 8304, 1995, 34, 0, 0, 10, 73, 576, 3174, 12872, 33860
Offset: 1

Views

Author

R. H. Hardin Jan 18 2013

Keywords

Comments

Table starts
.0..0.....0.......0........0.........0..........0..........0...........0
.0..1.....2.......3........4.........5..........6..........7...........8
.0..1.....3.......7.......13........21.........31.........43..........57
.0..2....12......36.......80.......150........252........392.........576
.0..3....30.....130......381.......884.......1765.......3174........5285
.0..5....89.....532.....1970......5513......12872......26477.......49598
.0..8...248....2088.....9940.....33860......92934.....219352......463208
.0.13...706....8304....50495....208756.....672526....1819931.....4330224
.0.21..1995...32876...255980...1285694....4864004...15094631....40472105
.0.34..5652..130376..1298632...7921082...35184566..125207022...378288032
.0.55.15998..516704..6586395..48795589..254499831.1038541668..3535769160
.0.89.45297.2048264.33407907.300602292.1840896185.8614340129.33048102488

Examples

			Some solutions for n=6 k=4
..0....0....0....0....0....0....0....0....0....0....0....0....0....0....0....0
..4....2....4....4....4....2....2....3....2....4....2....3....2....4....3....4
..1....4....2....1....4....2....0....3....0....3....0....0....4....1....4....4
..2....0....2....2....2....0....3....1....4....1....3....4....3....3....2....0
..4....0....4....0....1....3....2....0....2....1....4....0....0....4....2....3
..2....2....2....2....4....0....4....4....0....4....1....4....3....1....0....0
		

Crossrefs

Column 2 is A000045(n-1)
Row 2 is A000027(n-1)
Row 3 is A002061(n-1)
Row 4 is A011379(n-1)

Formula

Empirical for column k:
k=2: a(n) = a(n-1) +a(n-2)
k=3: a(n) = a(n-1) +4*a(n-2) +3*a(n-3) +a(n-4)
k=4: a(n) = 2*a(n-1) +6*a(n-2) +6*a(n-3) +4*a(n-4) +4*a(n-6)
k=5: a(n) = 2*a(n-1) +11*a(n-2) +20*a(n-3) +17*a(n-4) -3*a(n-5) +a(n-6)
k=6: a(n) = 3*a(n-1) +14*a(n-2) +29*a(n-3) +28*a(n-4) +a(n-5) +27*a(n-6) +8*a(n-7) +2*a(n-8)
k=7: a(n) = 3*a(n-1) +21*a(n-2) +58*a(n-3) +79*a(n-4) +32*a(n-5) +23*a(n-6) +4*a(n-7) +8*a(n-8)
Empirical for row n:
n=2: a(k) = k - 1
n=3: a(k) = k^2 - 3*k + 3 for k>1
n=4: a(k) = k^3 - 2*k^2 + k
n=5: a(k) = k^4 - k^3 - 10*k^2 + 33*k - 34 for k>3
n=6: a(k) = k^5 - 20*k^3 + 78*k^2 - 146*k + 125 for k>4
n=7: a(k) = k^6 + k^5 - 29*k^4 + 104*k^3 - 173*k^2 + 136*k - 40 for k>3

A214943 T(n,k) = Number of squarefree words of length n in a (k+1)-ary alphabet.

Original entry on oeis.org

2, 3, 2, 4, 6, 2, 5, 12, 12, 0, 6, 20, 36, 18, 0, 7, 30, 80, 96, 30, 0, 8, 42, 150, 300, 264, 42, 0, 9, 56, 252, 720, 1140, 696, 60, 0, 10, 72, 392, 1470, 3480, 4260, 1848, 78, 0, 11, 90, 576, 2688, 8610, 16680, 15960, 4848, 108, 0, 12, 110, 810, 4536, 18480, 50190, 80040
Offset: 1

Views

Author

R. H. Hardin, Jul 30 2012

Keywords

Comments

Table starts
.2..3...4....5.....6.....7......8......9.....10......11......12......13......14
.2..6..12...20....30....42.....56.....72.....90.....110.....132.....156.....182
.2.12..36...80...150...252....392....576....810....1100....1452....1872....2366
.0.18..96..300...720..1470...2688...4536...7200...10890...15840...22308...30576
.0.30.264.1140..3480..8610..18480..35784..64080..107910..172920..265980..395304
.0.42.696.4260.16680.50190.126672.281736.569520.1068210.1886280.3169452.5108376
Empirical: row n is a polynomial of degree n
Coefficients for rows 1-12, highest power first:
...1...1
...1...1...0
...1...1...0...0
...1...1..-1..-1...0
...1...1..-2..-1...1...0
...1...1..-3..-2...2...1...0
...1...1..-4..-3...5...2..-2...0
...1...1..-5..-4...8...4..-4..-1...0
...1...1..-6..-5..12...8..-9..-4...2...0
...1...1..-7..-6..17..12.-17..-7...6...0...0
...1...1..-8..-7..23..17.-28.-13..10...2...2...0
...1...1..-9..-8..30..23.-45.-23..25...3..-2...4...0
Terms in column k are multiples of k+1 due to symmetry. - Michael S. Branicky, May 20 2021

Examples

			Some solutions for n=6 k=4
..0....1....1....0....4....4....4....0....2....2....1....2....1....4....1....1
..2....0....4....4....3....0....0....4....1....3....4....0....0....2....0....3
..1....4....2....1....2....3....2....1....0....4....3....2....2....1....2....1
..4....3....4....2....3....1....4....2....4....1....2....4....4....3....4....4
..1....0....3....0....0....4....2....3....2....0....1....3....0....4....2....3
..0....2....1....3....1....0....3....1....4....4....0....0....1....3....0....1
		

Crossrefs

Cf. A006156 (column 2), A051041 (column 3), A214939 (column 4).
Cf. A002378 (row 2), A011379 (row 3), A047929(n+1) (row 4).

Programs

  • Python
    from itertools import product
    def T(n, k):
      if n == 1: return k+1
      symbols = "".join(chr(48+i) for i in range(k+1))
      squares = ["".join(u)*2 for r in range(1, n//2 + 1)
        for u in product(symbols, repeat = r)]
      words = ("0" + "".join(w) for w in product(symbols, repeat=n-1))
      return (k+1)*sum(all(s not in w for s in squares) for w in words)
    def atodiag(maxd): # maxd antidiagonals
      return [T(n, d+1-n) for d in range(1, maxd+1) for n in range(1, d+1)]
    print(atodiag(11)) # Michael S. Branicky, May 20 2021

Formula

From Arseny Shur, Apr 26 2015: (Start)
Let L_k be the limit lim T(n,k)^{1/n}, which exists because T(n,k) is a submultiplicative sequence for any k. Then L_k=k-1/k-1/k^3-O(1/k^5) (Shur, 2010).
Exact values of L_k for small k, rounded up to several decimal places:
L_2=1.30176..., L_3=2.6215080..., L_4=3.7325386... (for L_5,...,L_14 see Shur arXiv:1009.4415).
Empirical observation: for k=2 the O-term in the general formula is slightly bigger than 2/k^5, and for k=3,...,14 this O-term is slightly smaller than 2/k^5.
(End)

A262221 a(n) = 25*n*(n + 1)/2 + 1.

Original entry on oeis.org

1, 26, 76, 151, 251, 376, 526, 701, 901, 1126, 1376, 1651, 1951, 2276, 2626, 3001, 3401, 3826, 4276, 4751, 5251, 5776, 6326, 6901, 7501, 8126, 8776, 9451, 10151, 10876, 11626, 12401, 13201, 14026, 14876, 15751, 16651, 17576, 18526, 19501, 20501, 21526, 22576, 23651
Offset: 0

Views

Author

Bruno Berselli, Sep 15 2015

Keywords

Comments

Also centered 25-gonal (or icosipentagonal) numbers.
This is the case k=25 of the formula (k*n*(n+1) - (-1)^k + 1)/2. See table in Links section for similar sequences.
For k=2*n, the formula shown above gives A011379.
Primes in sequence: 151, 251, 701, 1951, 3001, 4751, 10151, 12401, ...

References

  • E. Deza and M. M. Deza, Figurate numbers, World Scientific Publishing (2012), page 51 (23rd row of the table).

Crossrefs

Cf. centered polygonal numbers listed in A069190.
Similar sequences of the form (k*n*(n+1) - (-1)^k + 1)/2 with -1 <= k <= 26: A000004, A000124, A002378, A005448, A005891, A028896, A033996, A035008, A046092, A049598, A060544, A064200, A069099, A069125, A069126, A069128, A069130, A069132, A069174, A069178, A080956, A124080, A163756, A163758, A163761, A164136, A173307.

Programs

  • Magma
    [25*n*(n+1)/2+1: n in [0..50]];
  • Mathematica
    Table[25 n (n + 1)/2 + 1, {n, 0, 50}]
    25*Accumulate[Range[0,50]]+1 (* or *) LinearRecurrence[{3,-3,1},{1,26,76},50] (* Harvey P. Dale, Jan 29 2023 *)
  • PARI
    vector(50, n, n--; 25*n*(n+1)/2+1)
    
  • Sage
    [25*n*(n+1)/2+1 for n in (0..50)]
    

Formula

G.f.: (1 + 23*x + x^2)/(1 - x)^3.
a(n) = a(-n-1) = 3*a(n-1) - 3*a(n-2) + a(n-3).
a(n) = A123296(n) + 1.
a(n) = A000217(5*n+2) - 2.
a(n) = A034856(5*n+1).
a(n) = A186349(10*n+1).
a(n) = A054254(5*n+2) with n>0, a(0)=1.
a(n) = A000217(n+1) + 23*A000217(n) + A000217(n-1) with A000217(-1)=0.
Sum_{i>=0} 1/a(i) = 1.078209111... = 2*Pi*tan(Pi*sqrt(17)/10)/(5*sqrt(17)).
From Amiram Eldar, Jun 21 2020: (Start)
Sum_{n>=0} a(n)/n! = 77*e/2.
Sum_{n>=0} (-1)^(n+1) * a(n)/n! = 23/(2*e). (End)
E.g.f.: exp(x)*(2 + 50*x + 25*x^2)/2. - Elmo R. Oliveira, Dec 24 2024

A181617 Molecular topological indices of the complete graph K_n.

Original entry on oeis.org

0, 4, 24, 72, 160, 300, 504, 784, 1152, 1620, 2200, 2904, 3744, 4732, 5880, 7200, 8704, 10404, 12312, 14440, 16800, 19404, 22264, 25392, 28800, 32500, 36504, 40824, 45472, 50460, 55800, 61504, 67584, 74052, 80920, 88200, 95904, 104044, 112632, 121680, 131200
Offset: 1

Views

Author

Eric W. Weisstein, Jul 10 2011

Keywords

Comments

a(n) = the area of a trapezoid with vertices at (n-1,n), (n,n-1), ((n-1)^2,n^2), and (n^2,(n-1)^2). - J. M. Bergot, Mar 23 2014
For n > 3, also the detour index of the (n-1)-helm graph. - Eric W. Weisstein, Dec 16 2017
a(n-3) is the maximum sigma irregularity over all maximal 2-degenerate graphs with n vertices. The extremal graphs are 2-stars (K_2 joined to n-2 independent vertices). (The sigma irregularity of a graph is the sum of the squares of the differences between the degrees over all edges of the graph.) - Allan Bickle, Jun 14 2023

Crossrefs

Cf. A002411.
Cf. A011379, A181617, A270205 (sigma irregularities of maximal k-degenerate graphs).

Programs

  • Magma
    [2*n*(n-1)^2: n in [1..50]]; // Vincenzo Librandi, Mar 24 2014
  • Mathematica
    CoefficientList[Series[4 x (1 + 2 x)/(1 - x)^4, {x, 0, 50}], x] (* Vincenzo Librandi, Mar 24 2014 *)
    LinearRecurrence[{4, -6, 4, -1}, {0, 4, 24, 72}, 50] (* Harvey P. Dale, Jun 16 2016 *)
    Table[2 n (n - 1)^2, {n, 20}] (* Eric W. Weisstein, Dec 16 2017 *)
  • PARI
    a(n) = 2*n*(n-1)^2; \\ Joerg Arndt, Mar 24 2014
    

Formula

a(n) = 2*n*(n-1)^2.
a(n) = 4*A002411(n).
G.f.: 4*x^2*(1+2*x)/(1-x)^4. - Colin Barker, Nov 04 2012
From Amiram Eldar, Jan 22 2023: (Start)
Sum_{n>=2} 1/a(n) = Pi^2/12 - 1/2.
Sum_{n>=2} (-1)^n/a(n) = Pi^2/24 - log(2) + 1/2. (End)

Extensions

More terms from Joerg Arndt, Mar 24 2014

A195437 Triangle formed by: 1 even, 2 odd, 3 even, 4 odd... starting with 2.

Original entry on oeis.org

2, 5, 7, 10, 12, 14, 17, 19, 21, 23, 26, 28, 30, 32, 34, 37, 39, 41, 43, 45, 47, 50, 52, 54, 56, 58, 60, 62, 65, 67, 69, 71, 73, 75, 77, 79, 82, 84, 86, 88, 90, 92, 94, 96, 98, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 122, 124, 126, 128, 130, 132
Offset: 0

Views

Author

Reinhard Zumkeller, Oct 12 2011

Keywords

Comments

A127366(T(n,k)) mod 2 = 1;
T(n,k) mod 2 + A000196(T(n,k)) mod 2 = 1;
complement of A133280.

Crossrefs

Cf. A002522 (left edge), A008865 (right edge), A011379 (row sums), A002939 (central terms).

Programs

  • Haskell
    a195437 n k = a195437_tabl !! n !! k
    a195437_tabl = tail $ g 1 1 [0..] where
       g m j xs = (filter ((== m) . (`mod` 2)) ys) : g (1 - m) (j + 2) xs'
         where (ys,xs') = splitAt j xs
    b195437 = bFile' "A195437" (concat $ take 101 a195437_tabl) 0
    -- Reinhard Zumkeller, Nov 23 2011 (fixed), Oct 12 2011
  • Mathematica
    p[n_,k_]:=NestList[#+2&,n,k-1]; Module[{nn=6,ev,od},ev=p@@@Partition[Riffle[Table[ 4n^2-4n+2,{n,nn}],Range[ 1,2nn,2]],2];od=p@@@Partition[Riffle[Table[4n^2+1,{n,nn}],Range[ 2,2nn+1,2]],2];Sort[Flatten[Join[ev,od]]]] (* Harvey P. Dale, Aug 27 2023 *)

A221463 T(n,k)=Number of 0..k arrays of length n with each element unequal to at least one neighbor, starting with 0.

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 0, 3, 4, 2, 0, 4, 9, 12, 3, 0, 5, 16, 36, 32, 5, 0, 6, 25, 80, 135, 88, 8, 0, 7, 36, 150, 384, 513, 240, 13, 0, 8, 49, 252, 875, 1856, 1944, 656, 21, 0, 9, 64, 392, 1728, 5125, 8960, 7371, 1792, 34, 0, 10, 81, 576, 3087, 11880, 30000, 43264, 27945, 4896, 55, 0, 11
Offset: 1

Views

Author

R. H. Hardin, general recursion proved by Robert Israel in the Sequence Fans Mailing List, Jan 17 2013

Keywords

Comments

Table starts
..0.....0.......0........0.........0..........0..........0...........0
..1.....2.......3........4.........5..........6..........7...........8
..1.....4.......9.......16........25.........36.........49..........64
..2....12......36.......80.......150........252........392.........576
..3....32.....135......384.......875.......1728.......3087........5120
..5....88.....513.....1856......5125......11880......24353.......45568
..8...240....1944.....8960.....30000......81648.....192080......405504
.13...656....7371....43264....175625.....561168....1515031.....3608576
.21..1792...27945...208896...1028125....3856896...11949777....32112640
.34..4896..105948..1008640...6018750...26508384...94253656...285769728
.55.13376..401679..4870144..35234375..182191680..743424031..2543058944
.89.36544.1522881.23515136.206265625.1252200384.5863743809.22630629376

Examples

			Some solutions for n=6 k=4
..0....0....0....0....0....0....0....0....0....0....0....0....0....0....0....0
..4....2....1....3....3....2....2....1....4....2....3....1....3....2....3....3
..1....4....0....1....2....4....3....0....2....0....3....3....2....0....0....4
..0....0....3....4....2....3....2....1....0....3....2....4....3....3....4....1
..1....2....1....2....1....0....3....4....0....1....3....1....3....0....2....0
..0....3....2....3....3....1....4....0....4....2....0....0....0....4....0....3
		

Crossrefs

Column 1 is A000045(n-1)
Column 2 is A028860(n+1)
Column 3 is A106435(n-1)
Column 4 is A094013
Column 5 is A106565(n-1)
Row 2 is A000027
Row 3 is A000290
Row 4 is A011379

Formula

Recursion for column k:
k=1: a(n) = a(n-1) +a(n-2)
k=2: a(n) = 2*a(n-1) +2*a(n-2)
k=3: a(n) = 3*a(n-1) +3*a(n-2)
k=4: a(n) = 4*a(n-1) +4*a(n-2)
k=5: a(n) = 5*a(n-1) +5*a(n-2)
k=6: a(n) = 6*a(n-1) +6*a(n-2)
k=7: a(n) = 7*a(n-1) +7*a(n-2)
Empirical for row n:
n=2: a(k) = 1*k
n=3: a(k) = 1*k^2
n=4: a(k) = 1*k^3 + 1*k^2
n=5: a(k) = 1*k^4 + 2*k^3
n=6: a(k) = 1*k^5 + 3*k^4 + 1*k^3
n=7: a(k) = 1*k^6 + 4*k^5 + 3*k^4
n=8: a(k) = 1*k^7 + 5*k^6 + 6*k^5 + 1*k^4
n=9: a(k) = 1*k^8 + 6*k^7 + 10*k^6 + 4*k^5
n=10: a(k) = 1*k^9 + 7*k^8 + 15*k^7 + 10*k^6 + 1*k^5
n=11: a(k) = 1*k^10 + 8*k^9 + 21*k^8 + 20*k^7 + 5*k^6
n=12: a(k) = 1*k^11 + 9*k^10 + 28*k^9 + 35*k^8 + 15*k^7 + 1*k^6
n=13: a(k) = 1*k^12 + 10*k^11 + 36*k^10 + 56*k^9 + 35*k^8 + 6*k^7
n=14: a(k) = 1*k^13 + 11*k^12 + 45*k^11 + 84*k^10 + 70*k^9 + 21*k^8 + 1*k^7
n=15: a(k) = 1*k^14 + 12*k^13 + 55*k^12 + 120*k^11 + 126*k^10 + 56*k^9 + 7*k^8
Apparently then T(n,k) = sum { binomial(n-2-i,i)*k^(n-1-i) , 0<=2*i<=n-2 }.
The formula reduces to T(n,k) = [4*k^(n-1)*(1+G)^(2*n-2) +4^n] /[2^(n+1) *G *(1+G)^(n-1)] for even n and to T(n,k) = [4*k^(n-1) *(1+G)^(2*n-2) -4^n] /[2^(n+1) *G *(1+G)^(n-1)] for odd n, where G=sqrt(1+4/k). - R. J. Mathar, Jan 21 2013

A265583 Array T(n,k) = k*(k-1)^(n-1) read by ascending antidiagonals; k,n >= 1.

Original entry on oeis.org

1, 0, 2, 0, 2, 3, 0, 2, 6, 4, 0, 2, 12, 12, 5, 0, 2, 24, 36, 20, 6, 0, 2, 48, 108, 80, 30, 7, 0, 2, 96, 324, 320, 150, 42, 8, 0, 2, 192, 972, 1280, 750, 252, 56, 9, 0, 2, 384, 2916, 5120, 3750, 1512, 392, 72, 10, 0, 2, 768, 8748, 20480, 18750, 9072, 2744, 576, 90, 11
Offset: 1

Views

Author

R. J. Mathar, Dec 10 2015

Keywords

Comments

T(n,k) is the number of n-letter words in a k-letter alphabet with no adjacent letters the same. The factor k represents the number of choices of the first letter, and the n-1 times repeated factor k-1 represents the choices of the next n-1 letters avoiding their predecessor.
The antidiagonal sums are s(d) = 1, 2, 5, 12, 31, 88, 275, 942, 3513, 14158, 61241, 282632, .. for d = n+k >= 2.

Examples

			      1       2       3       4       5       6       7
      0       2       6      12      20      30      42
      0       2      12      36      80     150     252
      0       2      24     108     320     750    1512
      0       2      48     324    1280    3750    9072
      0       2      96     972    5120   18750   54432
      0       2     192    2916   20480   93750  326592
T(3,3)=12 counts aba, abc, aca, acb, bab, bac, bca, bcb, cab, cac, cba, cbc. Words like aab or cbb are not counted.
		

Crossrefs

Cf. A007283 (column 3), A003946 (column 4), A003947 (column 5), A002378 (row 2), A011379 (row 3), A179824 (row 4), A055897 (diagonal), A265584.

Programs

  • GAP
    T:= function(n,k)
        if (n=1 and k=1) then return 1;
        else return k*(k-1)^(n-k-1);
        fi;
      end;
    Flat(List([2..15], n-> List([1..n-1], k-> T(n,k) ))); # G. C. Greubel, Aug 10 2019
  • Magma
    T:= func< n,k | (n eq 1 and k eq 1) select 1 else k*(k-1)^(n-k-1) >;
    [T(n,k): k in [1..n-1], n in [2..15]]; // G. C. Greubel, Aug 10 2019
    
  • Maple
    A265583 := proc(n,k)
        k*(k-1)^(n-1) ;
    end proc:
    seq(seq( A265583(d-k,k),k=1..d-1),d=2..13) ;
  • Mathematica
    T[1,1] = 1; T[n_, k_] := If[k==1, 0, k*(k-1)^(n-1)]; Table[T[n-k,k], {n,2,12}, {k,1,n-1}] // Flatten (* Amiram Eldar, Dec 13 2018 *)
  • PARI
    T(n,k) = if(n==k==1, 1, k*(k-1)^(n-k-1) );
    for(n=2,15, for(k=1,n-1, print1(T(n,k), ", "))) \\ G. C. Greubel, Aug 10 2019
    
  • Sage
    def T(n, k):
        if (n==k==1): return 1
        else: return k*(k-1)^(n-k-1)
    [[T(n, k) for k in (1..n-1)] for n in (2..15)] # G. C. Greubel, Aug 10 2019
    

Formula

T(n,k) = k*A051129(n-1,k-1) = k*A003992(k-1,n-1).
G.f. for column k: k*x/(1-(k-1)*x). - R. J. Mathar, Dec 12 2015
G.f. for array: y/(y-1) - (1+1/x)*y*LerchPhi(y,1,-1/x). - Robert Israel, Dec 13 2018
Previous Showing 11-20 of 61 results. Next