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

A153642 a(n) = 4*n^2 + 24*n + 8.

Original entry on oeis.org

36, 72, 116, 168, 228, 296, 372, 456, 548, 648, 756, 872, 996, 1128, 1268, 1416, 1572, 1736, 1908, 2088, 2276, 2472, 2676, 2888, 3108, 3336, 3572, 3816, 4068, 4328, 4596, 4872, 5156, 5448, 5748, 6056, 6372, 6696, 7028, 7368, 7716, 8072, 8436, 8808, 9188
Offset: 1

Views

Author

Vincenzo Librandi, Dec 30 2008

Keywords

Comments

2*(fifth subdiagonal of triangle A144562).
Sequence gives values x of solutions (x, y) to the Diophantine equation x^3+28*x^2 = y^2. For a more comprehensive list of solutions see A155135.
For n >= 3, a(n - 1) is the number of checkmate positions with white queen and white king against black king on an n X n board. Reason: The black king can only be on the edge. There are 4*(4*n + 1) checkmate positions where the black king is in the corner, 4*(2*n + 4) checkmate positions where the black king is immediately adjacent to the corner square, and there are 4*(n - 4)*(n + 2) checkmate positions where the black king is on another edge square. That's a total of 4*n^2 + 16*n - 12 = a(n - 1) checkmate positions. - Felix Huber, Oct 29 2023

Crossrefs

Programs

Formula

a(n) = A155135(2n+8) = A155136(2n+7).
a(n) = 4*A028881(n+3).
G.f.: 4*(3 - x)*(3 - 2*x)/(1-x)^3.
a(n)= 3*a(n-1) - 3*a(n-2) + a(n-3).
E.g.f.: 4*(-2 + (2 + 7*x + x^2)*exp(x)). - G. C. Greubel, Aug 23 2016
From Amiram Eldar, Mar 02 2023: (Start)
Sum_{n>=1} 1/a(n) = 1/56 - cot(sqrt(7)*Pi)*Pi/(8*sqrt(7)).
Sum_{n>=1} (-1)^(n+1)/a(n) = 31/168 - cosec(sqrt(7)*Pi)*Pi/(8*sqrt(7)). (End)

Extensions

Edited and extended by Klaus Brockhaus, Jan 21 2009

A028883 Primes of the form k^2 - 7.

Original entry on oeis.org

2, 29, 137, 317, 569, 1289, 2297, 2909, 3593, 4349, 8093, 9209, 11657, 17417, 19037, 24329, 26237, 30269, 34589, 36857, 41609, 46649, 49277, 51977, 57593, 60509, 72893, 93629, 101117, 108893, 129593, 133949, 147449, 152093, 166457, 191837, 202493, 219017, 224669
Offset: 1

Views

Author

Keywords

Comments

Subsequence of primes of A028881. - Michel Marcus, Apr 11 2015

Crossrefs

Programs

  • Magma
    [a: n in [3..500] | IsPrime(a) where a is n^2-7]; // Vincenzo Librandi, Dec 01 2011
    
  • Maple
    A028883:=n->`if`(isprime(n^2-7), n^2-7, NULL): seq(A028883(n), n=1..500); # Wesley Ivan Hurt, Apr 11 2015
  • Mathematica
    Select[Range[3, 410]^2 - 7, PrimeQ] (* Harvey P. Dale, Sep 20 2011 *)
  • PARI
    lista(nn) = forprime (n=1, nn, if (issquare(n+7), print1(n, ", "))) \\ Michel Marcus, Apr 11 2015

Formula

a(n) = A028881(A028882(n)). - Elmo R. Oliveira, Apr 22 2025

Extensions

More terms from Michel Marcus, Apr 11 2015

A358946 Positive integers that are properly represented by each primitive binary quadratic form of discriminant 28 that is properly equivalent to the principal form [1, 4, -3].

Original entry on oeis.org

1, 2, 9, 18, 21, 29, 37, 42, 53, 57, 58, 74, 81, 93, 106, 109, 113, 114, 133, 137, 141, 149, 162, 177, 186, 189, 193, 197, 217, 218, 226, 233, 249, 261, 266, 274, 277, 281, 282, 298, 309, 317, 329, 333, 337, 354, 361, 373, 378, 386, 389, 393, 394, 401, 413, 417, 421, 434, 449, 457, 466, 477, 498, 501
Offset: 1

Views

Author

Wolfdieter Lang, Jan 10 2023

Keywords

Comments

This is a subsequence of A242662, excluding the primitive forms of discriminant 28 with only improper representations of k, like k = 4, 8, 16, 25, 32, ... .
An indefinite binary quadratic primitive form F = a*x^2 + b*x*y + c*y^2 (gcd(a, b, c) = 1) with discriminant Disc = b^2 - 4*a*c = 28 = 2^2*7 is denoted by [a, b, c], or in matrix notation by MF = Matrix([[a, b/2], [b/2, c]]). Hence F = X*MF*X^T (T for transposed), where X = (x, y). See the two links for details and references.
Properly equivalent forms F' and F are related by a matrix R of determinant +1 like MF' = R^T*MF*R, and X'^T = R^{-1}*X^T.
Each primitive form, properly equivalent to the reduced principal form F_p = [1, 4, -3] for Disc = 28 (used in A242662), represents the given nonnegative k = a(n) values (and only these) properly with X = (x, y) and gcd(x, y) = 1. Modulo an overall sign change in X one can choose x nonnegative.
There are 8 = A082174(8) primitive reduced forms of Disc = 28 leading to 2 = A087048(8) (class number) cycles each of period 4, namely the principal cycle CyP = [[1, 4, -3], [-3, 2, 2], [2, 2, -3], [-3, 4, 1]] and the one (with outer signs flipped) CyP' = [[-1, 4, 3], [3, 2, -2], [-2, 2, 3], [3, 4, -1]].
There are A358947(n) representative parallel primitive forms (rpapfs) of discriminant Disc = 28 for k = a(n). This gives the number of proper fundamental representations X = (x, y), with x >= 0, of each primitive form [a, b, c], properly equivalent to the principal form F_p of Disc = 28.
For the negative integers k properly represented by primitive forms [a, b, c] properly equivalent to the principal form of Disc = 28 see A359476. The corresponding number of fundamental proper representations is given in A359477.
This and the three related sequences originated from a proposal by Klaus Purath proving that the form FKP := [1, -2, -6] of Disc = 28 represents k = k(m) = m^2 - 7 = A028881(m), for m >= 3, with the two fundamental representations X1(m) = (m+1, 1) and X2(m) = (11*m - 29, 3*m - 8). This form FKP is properly equivalent to the principal form F_p with R = Matrix([[1, -3], [0, 1]]). Hence all k = a(n) are represented by the form FKP, and A028881 is a subsequence of the present one.

Examples

			k = 9 = a(3): F = FPell = [1, 0, -7] is properly equivalent to F_p = [1, 4, -3] by two so-called half-reduced right neighbor R(t)-transformations, with the matrix R = R(t) = Matrix([[0, -1], [1, t]]), first with t = 0 then with t = 2. For FPell representing k = 9 with x > 0 and y > 0 see X_1(9, i) = (A307168(i), A307169(i)) and X_2(9, i) = (A307172(i), A307173(i)), for i >= 0. There are also the representations with y -> -y arising from the opposite fundamental solutions.
The 2 = A358947(3) rpapfs are F1 = [9, 8, 1] and F2 = [9, 10, 2]. They lead by proper equivalence transformations to a form of the above given principal cycle CyP. F1 -> [1, 4, -3] = F_p with matrix R(6), and F2 -> [2, 2, -3] with R(3). See the FIGURE, p. 10, of the linked paper.
Besides the primitive forms FPell, F1, F2 and the four forms of CyP also F' = [-7, 0, 1], and all primitive and properly equivalent forms represent k = 9. See the mentioned FIGURE, where FPa1 = F1, FPa1 = F2, Fpa2' = F_p^{(2)} = [2, 2, -3] and FPa2'' = F_p^{(3)} = [-3, 4, 1].
		

Crossrefs

A213922 Natural numbers placed in table T(n,k) layer by layer. The order of placement: T(n,n), T(n-1,n), T(n,n-1), ... T(1,n), T(n,1). Table T(n,k) read by antidiagonals.

Original entry on oeis.org

1, 3, 4, 8, 2, 9, 15, 6, 7, 16, 24, 13, 5, 14, 25, 35, 22, 11, 12, 23, 36, 48, 33, 20, 10, 21, 34, 49, 63, 46, 31, 18, 19, 32, 47, 64, 80, 61, 44, 29, 17, 30, 45, 62, 81, 99, 78, 59, 42, 27, 28, 43, 60, 79, 100, 120, 97, 76, 57, 40, 26, 41, 58, 77, 98, 121
Offset: 1

Views

Author

Boris Putievskiy, Mar 05 2013

Keywords

Comments

Permutation of the natural numbers.
a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers.
Layer is pair of sides of square from T(1,n) to T(n,n) and from T(n,n) to T(n,1). Enumeration table T(n,k) is layer by layer. The order of the list:
T(1,1)=1;
T(2,2), T(1,2), T(2,1);
...
T(n,n), T(n-1,n), T(n,n-1), ... T(1,n), T(n,1);
...

Examples

			The start of the sequence as a table:
   1,  3,  8, 15, 24, 35, ...
   4,  2,  6, 13, 22, 33, ...
   9,  7,  5, 11, 20, 31, ...
  16, 14, 12, 10, 18, 29, ...
  25, 23, 21, 19, 17, 27, ...
  36, 34, 32, 30, 28, 26, ...
...
The start of the sequence as triangular array read by rows:
   1;
   3,  4;
   8,  2,  9;
  15,  6,  7, 16;
  24, 13,  5, 14, 25;
  35, 22, 11, 12, 23, 36;
  ...
		

Crossrefs

Cf. A060734, A060736; table T(n,k) contains: in rows A005563, A028872, A028875, A028881, A028560, A116711; in columns A000290, A008865, A028347, A028878, A028884.

Programs

  • Mathematica
    f[n_, k_] := n^2 - 2*k + 2 /; n >= k; f[n_, k_] := k^2 - 2*n + 1 /; n < k; TableForm[Table[f[n, k], {n, 1, 5}, {k, 1, 10}]]; Table[f[n - k + 1, k], {n, 5}, {k, n, 1, -1}] // Flatten (* G. C. Greubel, Aug 19 2017 *)
  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    if i >= j:
       result=i*i-2*j+2
    else:
       result=j*j-2*i+1

Formula

As a table,
T(n,k) = n*n - 2*k + 2, if n >= k;
T(n,k) = k*k - 2*n + 1, if n < k.
As a linear sequence,
a(n) = i*i - 2*j + 2, if i >= j;
a(n) = j*j - 2*i + 1, if i < j
where
i = n - t*(t+1)/2,
j = (t*t + 3*t + 4)/2 - n,
t = floor((-1 + sqrt(8*n-7))/2).

A154575 a(n) = 2*n^2 + 12*n + 4.

Original entry on oeis.org

18, 36, 58, 84, 114, 148, 186, 228, 274, 324, 378, 436, 498, 564, 634, 708, 786, 868, 954, 1044, 1138, 1236, 1338, 1444, 1554, 1668, 1786, 1908, 2034, 2164, 2298, 2436, 2578, 2724, 2874, 3028, 3186, 3348, 3514, 3684, 3858, 4036, 4218, 4404, 4594, 4788, 4986, 5188
Offset: 1

Views

Author

Vincenzo Librandi, Jan 12 2009

Keywords

Comments

Sixth diagonal of A144562.
2*a(n) + 28 is a square.

Crossrefs

Programs

  • Magma
    I:=[18, 36, 58]; [n le 3 select I[n] else 3*Self(n-1)-3*Self(n-2)+1*Self(n-3): n in [1..40]]; // Vincenzo Librandi, Feb 26 2012
    
  • Mathematica
    LinearRecurrence[{3, -3, 1}, {18, 36, 58}, 50] (* Vincenzo Librandi, Feb 26 2012 *)
    Table[2n^2+12n+4,{n,50}] (* Harvey P. Dale, Sep 18 2019 *)
  • PARI
    for(n=1, 50, print1(2*n^2+12*n+4", ")); \\ Vincenzo Librandi, Feb 26 2012

Formula

From R. J. Mathar, Jan 05 2011: (Start)
a(n) = 2*A028881(n+3).
G.f.: -2*x*(2*x-3)*(x-3)/(x-1)^3. (End)
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). - Vincenzo Librandi, Feb 26 2012
From Amiram Eldar, Feb 25 2023: (Start)
Sum_{n>=1} 1/a(n) = 1/28 - cot(sqrt(7)*Pi)*Pi/(4*sqrt(7)).
Sum_{n>=1} (-1)^(n+1)/a(n) = 31/84 - cosec(sqrt(7)*Pi)*Pi/(4*sqrt(7)). (End)
E.g.f.: 2*exp(x)*(x^2 + 7*x + 2). - Elmo R. Oliveira, Nov 02 2024

A214870 Natural numbers placed in table T(n,k) layer by layer. The order of placement: at the beginning filled odd places of layer clockwise, next - even places counterclockwise. T(n,k) read by antidiagonals.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 10, 9, 8, 13, 17, 16, 6, 14, 21, 26, 25, 11, 12, 22, 31, 37, 36, 18, 15, 20, 32, 43, 50, 49, 27, 24, 23, 30, 44, 57, 65, 64, 38, 35, 19, 33, 42, 58, 73, 82, 81, 51, 48, 28, 29, 45, 56, 74, 91, 101, 100, 66, 63, 39, 34, 41, 59, 72, 92, 111
Offset: 1

Views

Author

Boris Putievskiy, Mar 11 2013

Keywords

Comments

Permutation of the natural numbers.
a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers.
Layer is pair of sides of square from T(1,n) to T(n,n) and from T(n,n) to T(n,1).
Enumeration table T(n,k) layer by layer. The order of the list:
T(1,1)=1;
T(1,2), T(2,1), T(2,2);
. . .
T(1,n), T(3,n), ... T(n,3), T(n,1); T(n,2), T(n,4), ... T(4,n), T(2,n);
. . .

Examples

			The start of the sequence as table:
   1   2   5  10  17  26 ...
   3   4   9  16  25  36 ...
   7   8   6  11  18  27 ...
  13  14  12  15  24  35 ...
  21  22  20  23  19  28 ...
  31  32  30  33  29  34 ...
  ...
The start of the sequence as triangle array read by rows:
   1;
   2,  3;
   5,  4,  7;
  10,  9,  8, 13;
  17, 16,  6, 14, 21;
  26, 25, 11, 12, 22, 31;
  ...
		

Crossrefs

Programs

  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    if i > j:
       result=i*i-i+(j%2)*(2-(j+1)/2)+((j+1)%2)*(j/2+1)
    else:
       result=j*j-2*(i%2)*j + (i%2)*((i+1)/2+1) + ((i+1)%2)*(-i/2+1)

Formula

As table
T(n,k) = k*k-2*(n mod 2)*k+(n mod 2)*((n+1)/2+1)+((n+1) mod 2)*(-n/2+1), if n<=k;
T(n,k) = n*n-n+(k mod 2)*(2-(k+1)/2)+((k+1) mod 2)*(k/2+1), if n>k.
As linear sequence
a(n) = j*j-2*(i mod 2)*j+(i mod 2)*((i+1)/2+1)+((i+1) mod 2)*(-i/2+1), if i<=j;
a(n) = i*i-i+(j mod 2)*(2-(j+1)/2)+((j+1) mod 2)*(j/2+1), if i>j; where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).

A192032 Square array read by antidiagonals: W(m,n) (m >= 0, n >= 0) is the Wiener index of the graph G(m,n) obtained in the following way: connect by an edge the center of an m-edge star with the center of an n-edge star. The Wiener index of a connected graph is the sum of distances between all unordered pairs of vertices in the graph.

Original entry on oeis.org

1, 4, 4, 9, 10, 9, 16, 18, 18, 16, 25, 28, 29, 28, 25, 36, 40, 42, 42, 40, 36, 49, 54, 57, 58, 57, 54, 49, 64, 70, 74, 76, 76, 74, 70, 64, 81, 88, 93, 96, 97, 96, 93, 88, 81, 100, 108, 114, 118, 120, 120, 118, 114, 108, 100, 121, 130, 137, 142, 145, 146, 145, 142, 137, 130, 121
Offset: 0

Views

Author

Emeric Deutsch, Jun 30 2011

Keywords

Comments

W(n,0) = W(0,n) = A000290(n+1) = (n+1)^2.
W(n,1) = W(1,n) = A028552(n+1) = (n+1)*(n+4).
W(n,2) = W(2,n) = A028881(n+4) = n^2 + 8*n + 9.
W(n,n) = A079273(n+1) = 5*n^2 + 4*n + 1.
W(n,m) = W(m,n) (trivially).

Examples

			W(1,2)=18 because in the graph with vertex set {A,a,B,b,b'} and edge set {AB, Aa, Bb, Bb'} we have 4 pairs of vertices at distance 1 (the edges), 4 pairs at distance 2 (Ab, Ab', Ba, bb') and 2 pairs at distance 3 (ab,ab'); 4*1 + 4*2 + 2*3 = 18.
The square array starts:
   1,  4,  9, 16, 25, ...;
   4, 10, 18, 28, 30, ...;
   9, 18, 29, 42, 57, ...;
  16, 28, 42, 58, 76, ...;
		

Crossrefs

Programs

  • Maple
    W := proc (m, n) options operator, arrow: m^2+n^2+3*m*n+2*m+2*n+1 end proc: for n from 0 to 10 do seq(W(n-i, i), i = 0 .. n) end do; # yields the antidiagonals in triangular form
    W := proc (m, n) options operator, arrow: m^2+n^2+3*m*n+2*m+2*n+1 end proc: for m from 0 to 9 do seq(W(m, n), n = 0 .. 9) end do; # yields the first 10 entries of each of rows 0,1,2,...,9

Formula

W(m,n) = m^2 + n^2 + 3*m*n + 2*m + 2*n + 1.
The Wiener polynomial of the graph G(n,m) is P(m,n;t) = (m+n+1)*t + (1/2)*(m^2 + n^2 + m + n)*t^2 + m*n*t^3.
Showing 1-7 of 7 results.