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.

A102401 a(n) is the index of the permutation of order n having the least sum of pairwise products as given by A026035.

Original entry on oeis.org

0, 2, 14, 80, 512, 3776, 31376, 290456, 2970296, 33276536, 405440216, 5338909736, 75572075816, 1144441325096, 18464406889256, 316212570391976, 5729159765566376
Offset: 2

Views

Author

Eugene McDonnell (eemcd(AT)mac.com), Feb 22 2005

Keywords

Comments

A026035 gives the minimum sum of products for permutations and was used to validate the results above. There is a companion index for the permutations that are the reversals of those indexed here. A formula would be very welcome.

Examples

			In the permutation table of order 7 the first instance of a row having the least sum of overlapping pairwise products can be found empirically to be:
6 2 4 3 5 1 7
and this is found at index 3776. Its products are
12 8 12 15 5 7
and sum is 59; a(7) of A026035 is 59. This allows us to give a(7) as 3776.
		

A101986 Maximum sum of products of successive pairs in a permutation of order n+1.

Original entry on oeis.org

0, 2, 9, 23, 46, 80, 127, 189, 268, 366, 485, 627, 794, 988, 1211, 1465, 1752, 2074, 2433, 2831, 3270, 3752, 4279, 4853, 5476, 6150, 6877, 7659, 8498, 9396, 10355, 11377, 12464, 13618, 14841, 16135, 17502, 18944, 20463, 22061, 23740, 25502
Offset: 0

Views

Author

Eugene McDonnell (eemcd(AT)mac.com), Jan 29 2005

Keywords

Comments

1 3 5 4 2 is the 11th permutation, in lexical order. of order 5. Its reverse 2 4 5 3 1 is the 41st. The earliest permutation of order 6 is the 41st, 1 3 5 6 4 2. This pattern continues as far as I have looked, so its reversal 2 4 6 5 3 1 is the 191st and the earliest permutation of order 7 is the 191st, et cetera.
Comments from Dmitry Kamenetsky, Dec 15 2006: (Start)
This sequence is related to A026035, except here we take the maximum sum of products of successive pairs. Here is a method for generating such permutations. Start with two lists, the first has numbers 1 to n, while the second is empty.
Repeat the following operations until the first list is empty: 1. Move the smallest number of the first list to the leftmost available position in the second list. The move operation removes the original number from the first list. 2. Move the smallest number of the first list to the rightmost available position in the second list. For example when n=8, the permutation is 1, 3, 5, 7, 8, 6, 4, 2. (End)
Convolution of odd numbers and integers greater than 1. - Reinhard Zumkeller, Mar 30 2012
For n>0, a(n) is row 2 of the convolution array A213751. - Clark Kimberling, Jun 20 2012

Examples

			The permutations of order 5 with maximum sum of products is 1 3 5 4 2 and its reverse, since (1*3)+(3*5)+(5*4)+(4*2) is 46. All others are empirically less than 46. So a(4) = 46.
		

Crossrefs

Pairwise sums of A005581.

Programs

  • Haskell
    a101986 n = sum $ zipWith (*) [1,3..] (reverse [2..n+1])
    -- Reinhard Zumkeller, Mar 30 2012
  • J
    0 1 9 2 & p. % 6 & p. (A) NB. the polynomial P such that P(n) is a(n).
    NB. where 0 1 9 2 are the coefficients in ascending order of the numerator of a rational polynomial and 6 is the (constant) coefficient of its denominator. J's primitive function p. produces a polynomial with these coefficients. Division is indicated by % . Thus the J expression (A) is equivalent to the formula above.
    
  • Maple
    a:=n->add((n+j^2),j=1..n): seq(a(n),n=0..41); # Zerinvary Lajos, Jul 27 2006
  • Mathematica
    Table[(n + 9 n^2 + 2 n^3)/6, {n, 0, 41}] (* Robert G. Wilson v, Feb 04 2005 *)
  • PARI
    a(n)=n*(2*n^2+9*n+1)/6 \\ Charles R Greathouse IV, Jan 17 2012
    

Formula

a(n) = n*(2*n^2 + 9*n + 1)/6.
a(n+1) = a(n) + A008865(n+2); a(n) = A160805(n) - 4. [Reinhard Zumkeller, May 26 2009]
G.f.: x*(1+x)*(2-x)/(1-x)^4. - L. Edson Jeffery, Jan 17 2012
a(n) = 4*a(n-1)-6*a(n-2)+4*a(n-3)-a(n-4) for n>3, a(0)=0, a(1)=2, a(2)=9, a(3)=23. - L. Edson Jeffery, Jan 17 2012
a(n) = A000330(n) + A005449(n) - A000217(n). - Richard R. Forberg, Aug 07 2013
a(n) = 1 + sum( A008865(i), i=1..n+1 ). [Bruno Berselli, Jan 13 2015]
a(n) = A000290(n) + A000330(n). - J. M. Bergot, Apr 26 2018

Extensions

Edited by Bruno Berselli, Jan 13 2015
Name edited by Alois P. Heinz, Feb 02 2019

A114113 a(n) = sum{k=1 to n} (A114112(k)). (For n>=2, a(n) = sum{k=1 to n} (A014681(k)) =sum{k=1 to n} (A103889(k)).).

Original entry on oeis.org

1, 3, 7, 10, 16, 21, 29, 36, 46, 55, 67, 78, 92, 105, 121, 136, 154, 171, 191, 210, 232, 253, 277, 300, 326, 351, 379, 406, 436, 465, 497, 528, 562, 595, 631, 666, 704, 741, 781, 820, 862, 903, 947, 990, 1036, 1081, 1129, 1176, 1226, 1275, 1327, 1378, 1432
Offset: 1

Views

Author

Leroy Quet, Nov 13 2005

Keywords

Comments

a(n) is not divisible by (A114112(n+1)).
Sequence is A130883 union A014105 - {0,2}. - Anthony Hernandez, Sep 08 2016

Crossrefs

Programs

  • Magma
    I:=[1,3,7,10,16]; [n le 5 select I[n] else 2*Self(n-1)-2*Self(n-3)+Self(n-4): n in [1..60]]; // Vincenzo Librandi, Mar 13 2018
    
  • Mathematica
    Join[{1}, LinearRecurrence[{2, 0, -2, 1}, {3, 7, 10, 16}, 52]] (* Jean-François Alcover, Sep 22 2017 *)
    CoefficientList[Series[(1 + x + x^2 -2 x^3 + x^4)/((1 + x) (1 - x)^3), {x, 0, 60}], x] (* Vincenzo Librandi, Mar 13 2018 *)
  • Python
    def A114113(n): return 1 if n == 1 else (m:=n//2)*(n+1) + (n+1-m)*(n-2*m) # Chai Wah Wu, May 24 2022

Formula

a(1)=1. a(2n) = n*(2n+1). a(2n+1) = 2n^2 +3n +2.
From R. J. Mathar, Nov 04 2008: (Start)
a(n) = A026035(n+1) - A026035(n), n>1.
G.f.: x(1+x+x^2-2x^3+x^4)/((1+x)(1-x)^3).
a(n) = 2*a(n-1)-2*a(n-3)+a(n-4), n>5. (End)
This is (essentially) 1 + A084265, - N. J. A. Sloane, Mar 12 2018

Extensions

More terms from R. J. Mathar, Aug 31 2007

A210795 Triangle of coefficients of polynomials u(n,x) jointly generated with A210796; see the Formula section.

Original entry on oeis.org

1, 2, 1, 3, 2, 2, 4, 5, 5, 3, 5, 8, 12, 9, 5, 6, 13, 22, 25, 17, 8, 7, 18, 38, 51, 51, 31, 13, 8, 25, 59, 98, 115, 101, 56, 21, 9, 32, 88, 166, 238, 248, 196, 100, 34, 10, 41, 124, 270, 438, 552, 520, 374, 177, 55, 11, 50, 170, 410, 762, 1090, 1234, 1064, 704
Offset: 1

Views

Author

Clark Kimberling, Mar 26 2012

Keywords

Comments

Row n starts with n and ends with F(n), where F=A000045 (Fibonacci numbers).
Column 2: A000982
Column 3: A026035
For a discussion and guide to related arrays, see A208510.

Examples

			First five rows:
1
2...1
3...2...2
4...5...5....3
5...8...12...9...5
First three polynomials u(n,x): 1, 2 + x, 3 + 2x + 2x^2.
		

Crossrefs

Programs

  • Mathematica
    u[1, x_] := 1; v[1, x_] := 1; z = 16;
    u[n_, x_] := u[n - 1, x] + (x + j)*v[n - 1, x] + c;
    d[x_] := h + x; e[x_] := p + x;
    v[n_, x_] := d[x]*u[n - 1, x] + e[x]*v[n - 1, x] + f;
    j = 0; c = 1; h = 2; p = -1; f = 0;
    Table[Expand[u[n, x]], {n, 1, z/2}]
    Table[Expand[v[n, x]], {n, 1, z/2}]
    cu = Table[CoefficientList[u[n, x], x], {n, 1, z}];
    TableForm[cu]
    Flatten[%]   (* A210795 *)
    cv = Table[CoefficientList[v[n, x], x], {n, 1, z}];
    TableForm[cv]
    Flatten[%]   (* A210796 *)

Formula

u(n,x)=u(n-1,x)+x*v(n-1,x)+1,
v(n,x)=(x+2)*u(n-1,x)+(x-1)*v(n-1,x),
where u(1,x)=1, v(1,x)=1.

A179783 a(n) = 2*n*(n+1)*(n+2)/3 + (-1)^n.

Original entry on oeis.org

1, 3, 17, 39, 81, 139, 225, 335, 481, 659, 881, 1143, 1457, 1819, 2241, 2719, 3265, 3875, 4561, 5319, 6161, 7083, 8097, 9199, 10401, 11699, 13105, 14615, 16241, 17979, 19841, 21823, 23937, 26179, 28561, 31079
Offset: 0

Views

Author

Bruno Berselli, Jul 29 2010 - Sep 07 2010

Keywords

Comments

First differences in 2*A081352.
Second differences in 4*A004442.

Crossrefs

Programs

  • Magma
    [(2/3)*n*(n+1)*(n+2)+(-1)^n: n in [0..35]];
    
  • Mathematica
    LinearRecurrence[{3,-2,-2,3,-1},{1,3,17,39,81},40] (* Harvey P. Dale, Mar 04 2023 *)
  • PARI
    for(n=0, 35, print1((2/3)*n*(n+1)*(n+2)+(-1)^n", "));

Formula

G.f.: (1+10*x^2-4*x^3+x^4)/((1+x)*(1-x)^4); exp(-x)+(2/3)*exp(x)*x*(6+6*x+x^2).
a(n) = 3*a(n-1)-2*a(n-2)-2*a(n-3)+3*a(n-4)-a(n-5) for n>4.
a(n) = 4*A000292(n)+(-1)^n.

A306262 Difference between maximum and minimum sum of products of successive pairs in permutations of [n].

Original entry on oeis.org

0, 0, 0, 4, 11, 24, 42, 68, 101, 144, 196, 260, 335, 424, 526, 644, 777, 928, 1096, 1284, 1491, 1720, 1970, 2244, 2541, 2864, 3212, 3588, 3991, 4424, 4886, 5380, 5905, 6464, 7056, 7684, 8347, 9048, 9786, 10564, 11381, 12240, 13140, 14084, 15071, 16104, 17182
Offset: 0

Views

Author

Louis Rogliano, Feb 01 2019

Keywords

Examples

			a(4) = 11 = 23 - 12. 1342 and 2431 have sums 23, 3214 and 4123 have sums 12.
		

Crossrefs

Programs

  • Maple
    a:= n-> `if`(n=0, 0, (<<0|1|0|0|0>, <0|0|1|0|0>, <0|0|0|1|0>,
        <0|0|0|0|1>, <-1|3|-2|-2|3>>^n. <<1, 0, 0, 4, 11>>)[1, 1]):
    seq(a(n), n=0..50);  # Alois P. Heinz, Feb 02 2019
  • Mathematica
    a[n_] := Module[
      {min, max, perm, g, mperm},
      perm = Permutations[Range[n]];
      g[x_] := Sum[x[[i]] x[[i + 1]], {i, 1, Length[x] - 1}];
      mperm = Map[g, perm];
      min = Min[mperm];
      max = Max[mperm];
      Return[max - min]]
    LinearRecurrence[{3,-2,-2,3,-1},{0,0,0,4,11,24},60] (* Harvey P. Dale, Aug 05 2020 *)
  • PARI
    concat([0,0,0], Vec(x^3*(4 - x - x^2) / ((1 - x)^4*(1 + x)) + O(x^40))) \\ Colin Barker, Feb 05 2019

Formula

a(n+1) = a(n) + 1/4*((-1+(-1)^(n-1))^2+2*(n-1)*(n+4)) with a(n) = 0 for n <= 2.
From Alois P. Heinz, Feb 01 2019: (Start)
G.f.: -(x^2+x-4)*x^3/((x+1)*(x-1)^4).
a(n) = (2*n^3+6*n^2-26*n+15-3*(-1)^n)/12 for n > 0.
a(n) = A101986(n-1) - A026035(n) for n > 0. (End)
a(n) = 3*a(n-1)-2*a(n-2)-2*a(n-3)+3*a(n-4)-a(n-5). - Wesley Ivan Hurt, May 28 2021
a(n) = A110610(n+1) - A110611(n+1). - Talmon Silver, Sep 24 2025

Extensions

More terms from Alois P. Heinz, Feb 01 2019
Showing 1-6 of 6 results.