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

A213759 Principal diagonal of the convolution array A213783.

Original entry on oeis.org

1, 4, 11, 22, 39, 62, 93, 132, 181, 240, 311, 394, 491, 602, 729, 872, 1033, 1212, 1411, 1630, 1871, 2134, 2421, 2732, 3069, 3432, 3823, 4242, 4691, 5170, 5681, 6224, 6801, 7412, 8059, 8742, 9463, 10222, 11021, 11860, 12741, 13664, 14631
Offset: 1

Views

Author

Clark Kimberling, Jun 22 2012

Keywords

Crossrefs

Partial sums of A047838. - Guenther Schrack, May 24 2018

Programs

  • Mathematica
    b[n_] := Floor[(n + 2)/2]; c[n_] := Floor[(n + 1)/2];
    t[n_, k_] := Sum[b[k - i] c[n + i], {i, 0, k - 1}]
    TableForm[Table[t[n, k], {n, 1, 10}, {k, 1, 10}]]
    Flatten[Table[t[n - k + 1, k], {n, 12}, {k, n, 1, -1}]]
    r[n_] := Table[t[n, k], {k, 1, 60}]  (* A213783 *)
    Table[t[n, n], {n, 1, 40}] (* A213759 *)
    LinearRecurrence[{3,-2,-2,3,-1},{1,4,11,22,39},50] (* Harvey P. Dale, Jul 22 2014 *)

Formula

a(n) = (3 - 3*(-1)^n - 4*n + 18*n^2 + 4*n^3)/24.
a(n) = 3*a(n-1) - 2*a(n-2) - 2*a(n-3) + 3*a(n-4) - a(n-5).
G.f.: x*(1 + x + x^2 - x^3)/((1 - x)^4 *(1 + x)).
a(n+1) = a(n) + A047838(n+2) for n > 0. - Guenther Schrack, May 24 2018
a(n) = A212964(n+2) - n for n > 0. - Guenther Schrack, May 30 2018

A047839 a(n) = n + floor( sqrt(2*n) ).

Original entry on oeis.org

2, 4, 5, 6, 8, 9, 10, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 79
Offset: 1

Views

Author

Michael Somos, May 07 1999

Keywords

Comments

Complement of A047838.

Crossrefs

Cf. A047838.

Programs

  • Magma
    [n +Floor(Sqrt(2*n)): n in [1..100]]; // G. C. Greubel, Sep 08 2018
  • Mathematica
    Table[n +Floor[Sqrt[2*n]], {n,1,100}] (* G. C. Greubel, Sep 08 2018 *)
  • PARI
    {a(n) = if( n<0, 0, n + sqrtint(2*n))}
    

A135151 A002260 + A128174 - I, I = Identity matrix.

Original entry on oeis.org

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

Views

Author

Gary W. Adamson, Nov 21 2007

Keywords

Comments

A135152 is a companion triangle, both having row sums = A047838: (1, 3, 7, 11, 17, 23, 31, 39, ...).

Examples

			First few rows of the triangle:
  1;
  1, 2;
  2, 2, 3;
  1, 3, 3, 4;
  2, 2, 4, 4, 5;
  1, 3, 3, 5, 5, 6;
  2, 2, 4, 4, 6, 6, 7;
  ...
		

Crossrefs

Formula

A002260 + A128174 - I, where I = Identity matrix, A002260 = (1; 1,2; 1,2,3; ...) and A128174 = (1; 0,1; 1,0,1; 0,1,0,1; ...).

A135152 A004736 + A128174 - I, I = Identity matrix.

Original entry on oeis.org

1, 2, 1, 4, 2, 1, 4, 4, 2, 1, 6, 4, 4, 2, 1, 6, 6, 4, 4, 2, 1, 8, 6, 6, 4, 4, 2, 1, 8, 8, 6, 6, 4, 4, 2, 1, 10, 8, 8, 6, 6, 4, 4, 2, 1, 10, 10, 8, 8, 6, 6, 4, 4, 2, 1
Offset: 1

Views

Author

Gary W. Adamson, Nov 21 2007

Keywords

Comments

Row sums = A047838: (1, 3, 7, 11, 17, 23, 31, 39, ...). The triangle is a companion to A135151.

Examples

			First few rows of the triangle:
  1;
  2, 1;
  4, 2, 1;
  4, 4, 2, 1;
  6, 4, 4, 2, 1;
  6, 6, 4, 4, 2, 1;
  8, 6, 6, 4, 4, 2, 1;
  ...
		

Crossrefs

Formula

A004736 + A128174 - I, where I = Identity matrix, A004736 = (1; 2,1; 3,2,1; ...) and A128174 = (1; 0,1; 1,0,1; 0,1,0,1; ...).

A179094 Disorder number of the n X n grid graph.

Original entry on oeis.org

0, 5, 23, 61, 119, 213, 335, 509, 719, 997, 1319, 1725, 2183, 2741, 3359, 4093, 4895
Offset: 1

Views

Author

Thomas Young, Jun 29 2010

Keywords

Comments

Old name: Fill an n X n array with various permutations of the integers 1, 2, 3, 4... n^2. Define the organization number of the n X n array to be the following: Start at 1, count the rectilinear steps to reach 2, then the rectilinear steps to reach 3, etc. Add them up. The array that has the maximum organization number would be the "most disorganized." This sequence is the sequence showing the most disorganized number for n X n arrays starting at 1 X 1.
Similar to sequence A047838.
My computer program worked as follows:
a) generate a permutation
b) place the permutation into the array
c) calculate the array position (row, column) of each integer
d) sort the integers into another array preserving row and column
e) travel the new array from 1..n^2 and summing the absolute value of the differences between the rows of consecutive integers and summing the absolute value of the differences of the columns of consecutive integers. The organization number is the sum of the two sums.
For instance, with the permutation 8, 3, 6, 5, 9, 1, 2, 7, 4 place the integers into a 3 X 3 array as such:
8 3 6
5 9 1
2 7 4
(Notice the next integer is a knight's move away. This is not the only sequence that will give an organization number of 23, but this is why I wonder if the sequence is the same as A098499.)
Then sort the integers preserving their row and column:
number, row, column
1, 2, 3
2, 3, 1
3, 1, 2
4, 3, 3
5, 2, 1
6, 1, 3
7, 3, 2
8, 1, 1
9, 2, 2
Traveling from 1 to 9, the differences in the row numbers are 1, 2, 2, 1, 1, 2, 2, 1 (a sum of 12) and the differences in the column numbers are 2, 1, 1, 2, 2, 1, 1, 1 (a sum of 11) therefore the organization number is 23.
This is basically a traveling salesman variant. - D. S. McNeil, Aug 26 2010

Crossrefs

Formula

A possible formula: a(n) = 0 for n=1, n^3-n-1 for odd n > 1, n^3-3 for even n? - D. S. McNeil, Aug 26 2010
Let b(n) correspond to McNeil's formula. Then b(n) <= a(n) <= b(n) + 1 (see link). - Sela Fried, Nov 28 2023
Empirical G.f.: x^2*(5+13*x+10*x^2-6*x^3+x^4+x^5)/((1-x)^4*(1+x)^2). - Colin Barker, Mar 29 2012

Extensions

a(3) corrected and a(4)-a(17) computed by D. S. McNeil, Aug 26 2010. D. S. McNeil also finds that a(19)=6839, a(21)=9239, a(23)=12143.
Edited by N. J. A. Sloane, Aug 26 2010
Typo in formula corrected by D. S. McNeil, Aug 26 2010
Equivalent simpler description from Eric W. Weisstein, Oct 08 2024

A328378 Number of permutations of length n that possess the maximal sum of distances between contiguous elements.

Original entry on oeis.org

1, 1, 2, 4, 2, 8, 8, 48, 72, 576, 1152, 11520, 28800, 345600, 1036800, 14515200, 50803200, 812851200, 3251404800, 58525286400, 263363788800, 5267275776000, 26336378880000, 579400335360000, 3186701844480000, 76480844267520000, 458885065605120000, 11931011705733120000
Offset: 0

Views

Author

Tomás Roca Sánchez, Oct 14 2019

Keywords

Comments

From Andrew Howroyd, Oct 16 2019: (Start)
No permutation with maximal sum of distances between contiguous elements can contain three contiguous elements a, b, c such that a < b < c or a > b > c. Otherwise removing b will not alter the sum and then appending b to the end of the permutation will increase it so that the original permutation could not have been maximal. In this sense all solution permutations are alternating.
For odd n consider an alternating permutation of the form p_1 p_2 ... p_n with p_1 > p2, p_2 < p_3, etc. The sum of distances is given by (p_1 + 2*p_3 + 2*p_5 + ... 2*p_{n-2} + p_n) - 2*(p_2 + p_4 + ... p_{n-1}). This is maximized by choosing the central odd p_i to be as highest possible and the even p_i to be least possible but other than that the order does not alter the sum. Similar arguments can be made for p_1 < p_2 and for the case when n is even.
The above considerations lead to a formula for this sequence with the maximum sum being given by A047838(n). (End)

Examples

			(1,3,2) is a permutation of length 3 with distance sum |1-3| + |3-2| = 2 + 1 = 3. For n = 3, the 4 permutations with maximum sum of distances are (1,3,2), (2,1,3), (2,3,1) and (3,1,2).
		

Crossrefs

Cf. A047838 is the maximum distance for every length n, except for n = 0 and n = 1.

Programs

  • Mathematica
    A328378[n_]:=If[n<2,1,2(Floor[n/2]-1)!^2If[Divisible[n,2],1,n-1]];Array[A328378,30,0] (* Paolo Xausa, Aug 13 2023 *)
  • PARI
    a(n)={if(n<2, n>=0, 2*(n\2-1)!^2*if(n%2, n-1, 1))} \\ Andrew Howroyd, Oct 16 2019
  • Python
    # See Github link
    

Formula

a(2*n) = 2*(n-1)!^2 for n > 0; a(2*n+1) = 4*n!*(n-1)! for n > 0. - Andrew Howroyd, Oct 16 2019
D-finite with recurrence: - (12*n-20)*a(n) + 4*a(n-1) + (3*n-2)*(n-3)*(n-2)*a(n-2) = 0. - Georg Fischer, Nov 25 2022
Sum_{n>=0} 1/a(n) = BesselI(0, 2)/2 + BesselI(1, 2)/4 + 2 = A070910/2 + A096789/4 + 2. - Amiram Eldar, Oct 03 2023

Extensions

Terms a(12) and beyond from Andrew Howroyd, Oct 16 2019

A354528 Square array T(m,n) read by antidiagonals - see Comments for definition.

Original entry on oeis.org

0, 1, 1, 3, 5, 3, 7, 12, 12, 7, 11, 21, 23, 21, 11, 17, 32, 39, 32, 17, 23, 45, 55, 61, 55, 45, 23, 31, 60, 77, 87, 77, 60, 31, 39, 77, 99, 117, 119, 117, 99, 77, 39, 49, 96, 127, 151, 161, 151, 127, 96, 49, 59, 117, 155, 189, 203, 213
Offset: 1

Views

Author

Sela Fried, Aug 16 2022

Keywords

Comments

T(m,n) is defined as follows:
T(m, n) = T(n, m).
T(1, n) = floor(n^2/2) - 1.
T(2, n) = (n+1)^2 - 4.
For m, n >= 3 we have:
T(m, n) = m*n*(m + n)/2 - 3, if m and n are both even;
= m*n*(m + n)/2 - (m + n)/2 - 1, if m and n are both odd;
= m*n*(m + n)/2 - n/2 - 1, if m is odd and n is even.
The disorder number M(G) of a graph G is defined to be the maximal length of a walk along the edges of the graph, according to any ordering of its vertices.
Conjecture: T(m, n) = M(P_m X P_n) where P_m X P_n is the grid graph of size m X n.
The conjecture is proved if m = 1 or n = 1.

Examples

			m\n   1  2  3   4   5   6 ...
1     0  1  3   7  11  17
2     1  5 12  21  32  45
3     3 12 23  39  55  77
4     7 21 39  61  87 117
5    11 32 55  87 119 161
6    17 45 77 117 161 213
...
		

References

  • L. Bulteau, S. Giraudo and S. Vialette, Disorders and Permutations, CPM, 2021.

Crossrefs

A354529 a(1) = 3, a(2) = 12 and a(n) = (3n^2+8n-2)/2 if n is even or = (3n^2+8n-5)/2, if n is odd, for n >= 3.

Original entry on oeis.org

3, 12, 23, 39, 55, 77, 99, 127, 155, 189, 223, 263, 303, 349, 395, 447, 499, 557, 615, 679, 743, 813, 883, 959, 1035, 1117, 1199, 1287, 1375, 1469, 1563, 1663, 1763, 1869, 1975, 2087, 2199, 2317, 2435, 2559, 2683, 2813, 2943, 3079, 3215, 3357, 3499, 3647, 3795, 3949, 4103, 4263, 4423
Offset: 1

Views

Author

Sela Fried, Aug 16 2022

Keywords

Comments

The disorder number M(G) of a graph G is defined to be the maximal length of a walk along the edges of the graph, according to any ordering of its vertices.
Conjecture: a(n) = M(P_3 X P_n) where P_3 X P_n is the grid graph of size 3 X n.

Crossrefs

Programs

  • Python
    def A354529(n): return 9*n-6 if n<3 else n*(3*n+8)-2-3*(n&1)>>1 # Chai Wah Wu, Sep 11 2022

Formula

From Stefano Spezia, Aug 16 2022: (Start)
O.g.f.: x*(3 + 6*x - x^2 - x^3 - 2*x^4 + x^5)/((1 - x)^3*(1 + x)).
E.g.f.: ((3*x^2 + 11*x - 2)*cosh(x) + (3*x^2 + 11*x - 5)*sinh(x) - x^2 + 2)/2. (End)

A183573 a(n) = n + floor(sqrt(2n+1)).

Original entry on oeis.org

2, 4, 5, 7, 8, 9, 10, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 84, 85, 86, 87, 88, 89, 90, 91, 92
Offset: 1

Views

Author

Clark Kimberling, Jan 05 2011

Keywords

Crossrefs

Cf. A047838, A103128, A116940 (complement).

Programs

  • Maple
    seq(n+floor(sqrt(2*n+1)), n=1..100); # Robert Israel, Sep 12 2016
  • Mathematica
    Table[n + Floor@ Sqrt[2 n + 1], {n, 80}] (* Michael De Vlieger, Sep 12 2016 *)

Formula

From Robert Israel, Sep 12 2016: (Start)
a(n+1)=a(n)+2 if n is in A047838, otherwise a(n+1) = a(n)+1.
a(n) = n + A103128(n+1).
G.f.: Theta3(x^2)/(2*(1-x)) + Theta2(x^2)/(2*sqrt(x)*(1-x)) - (1-2*x)*(3-x)/(2*(1-x)^2), where Theta2 and Theta3 are Jacobi Theta functions. (End)

A384616 A(m,n) is the maximum sum of absolute differences of the labels of adjacent vertices of the grid graph P_m X P_n where the m*n labels are exactly 1, 2, ..., m*n.

Original entry on oeis.org

0, 1, 8, 3, 23, 58, 7, 44, 115
Offset: 1

Views

Author

Sela Fried, Jun 07 2025

Keywords

Comments

A(m, n) ~ Theta((m*n)^2) (see link).

Examples

			Array begins (values in parentheses are conjectural):
  [1]  0
  [2]  1    8
  [3]  3   23    58
  [4]  7   44   115   (216)
  [5] 11   71  (182)  (347)  (554)
  [6] 17  104  (271)  (508)  (815) (1192)
  [7] 23  143  (370)  (699) (1118) (1639) (2250)
  [8] 31 (188) (491)  (920) (1475) (2156) (2963) (3896)
  [9] 39 (239) (622) (1171) (1874) (2743) (3766) (4955) (6298)
		

Crossrefs

Column 1 is A047838.
Cf. A067725.

Programs

  • Python
    import itertools
    import numpy as np
    def max_difference_sum(m, n):
        nums = list(range(1, m * n + 1))
        max_sum = 0
        best_matrix = None
        for perm in itertools.permutations(nums):
            matrix = np.array(perm).reshape((m, n))
            diff_sum = np.sum(np.abs(matrix[:,1:]-matrix[:,:-1])) + np.sum(np.abs(matrix[1:,:]-matrix[:-1,:]))
            if diff_sum > max_sum:
                max_sum = diff_sum
                best_matrix = matrix.copy()
        return max_sum, best_matrix
    for m in range(1, 10):
        for n in range(1, m+1):
            max_sum, best = max_difference_sum(m, n)
            print(max_sum, end=', ')

Formula

Conjecture: A(m,2) = A067725(m-1) - 1.
Previous Showing 11-20 of 22 results. Next