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.

A006331 a(n) = n*(n+1)*(2*n+1)/3.

Original entry on oeis.org

0, 2, 10, 28, 60, 110, 182, 280, 408, 570, 770, 1012, 1300, 1638, 2030, 2480, 2992, 3570, 4218, 4940, 5740, 6622, 7590, 8648, 9800, 11050, 12402, 13860, 15428, 17110, 18910, 20832, 22880, 25058, 27370, 29820, 32412, 35150, 38038, 41080, 44280
Offset: 0

Views

Author

Keywords

Comments

Triangles in rhombic matchstick arrangement of side n.
Maximum accumulated number of electrons at energy level n. - Scott A. Brown, Feb 28 2000
Let M_n denote the n X n matrix M_n(i,j)=i^2+j^2; then the characteristic polynomial of M_n is x^n - a(n)x^(n-1) - .... - Michael Somos, Nov 14 2002
Convolution of odds (A005408) and evens (A005843). - Graeme McRae, Jun 06 2006
a(n) is the number of non-monotonic functions with domain {0,1,2} and codomain {0,1,...,n}. - Dennis P. Walsh, Apr 25 2011
For any odd number 2n+1, find Sum_{aJ. M. Bergot, Jul 16 2011
a(n) gives the number of (n+1) X (n+1) symmetric (0,1)-matrices containing three ones (see [Cameron]). - L. Edson Jeffery, Feb 18 2012
a(n) is the number of 4-tuples (w,x,y,z) with all terms in {0,...,n} and |w - x| < y. - Clark Kimberling, Jun 02 2012
Partial sums of A001105. - Omar E. Pol, Jan 12 2013
Total number of square diagonals (of any size) in an n X n square grid. - Wesley Ivan Hurt, Mar 24 2015
Number of diagonal attacks of two queens on (n+1) X (n+1) chessboard. - Antal Pinter, Sep 20 2015
a(n) is the minimum value obtainable by partitioning either the set {x in the natural numbers | 1 <= x <= 2n} or the set {x in the natural numbers | 0 <= x <= 2n+1} into pairs, taking the product of all such pairs, and taking the sum of all such products. - Thomas Anton, Oct 21 2020
a(n) is the irregularity of the n-th power of a path of length at least 3*n. (The irregularity of a graph is the sum of the differences between the degrees over all edges of the graph.) - Allan Bickle, Jun 16 2023
a(n) is the maximum possible total number of inversions in all rows and all columns of a Latin square of order n+1. - Ivaylo Kortezov, Jun 28 2025

Examples

			For n=2, a(2)=10 since there are 10 non-monotonic functions f from {0,1,2} to {0,1,2}, namely, functions f = <f(1),f(2),f(3)> given by <0,1,0>, <0,2,0>, <0,2,1>, <1,0,1>, <1,0,2>, <1,2,0>, <1,2,1>, <2,0,1>, <2,0,2>, and <2,1,2>. - _Dennis P. Walsh_, Apr 25 2011
Let n=4, 2*n+1 = 9. Since 9 = 1+8 = 3+6 = 5+4 = 7+2, a(4) = 1*8 + 3*6 + 5*4 + 7*2 = 60. - _Vladimir Shevelev_, May 11 2012
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A row of A132339.
Cf. A002378, A046092, A028896 (irregularities of maximal k-degenerate graphs).

Programs

  • Haskell
    a006331 n = sum $ zipWith (*) [2*n-1, 2*n-3 .. 1] [2, 4 ..]
    -- Reinhard Zumkeller, Feb 11 2012
  • Magma
    [n*(n+1)*(2*n+1)/3: n in [0..40]]; // Vincenzo Librandi, Aug 15 2011
    
  • Maple
    A006331 := proc(n)
        n*(n+1)*(2*n+1)/3 ;
    end proc:
    seq(A006331(n),n=0..80) ; # R. J. Mathar, Sep 27 2013
  • Mathematica
    Table[n(n+1)(2n+1)/3,{n,0,40}] (* or *) LinearRecurrence[{4,-6,4,-1},{0,2,10,28},50] (* Harvey P. Dale, Apr 12 2013 *)
  • PARI
    a(n)=if(n<0,0,n*(n+1)*(2*n+1)/3)
    

Formula

G.f.: 2*x*(1 + x)/(1 - x)^4. - Simon Plouffe (in his 1992 dissertation)
a(n) = 2*binomial(n+1,3) + 2*binomial(n+2,3).
a(n) = 2*A000330(n) = A002492(n)/2.
a(n) = Sum_{i=0..n} T(i,n-i), array T as in A048147. - N. J. A. Sloane, Dec 11 1999
From the formula for the sum of squares of positive integers 1^2 + 2^2 + 3^2 + ... + n^2 = n*(n+1)(2*n+1)/6, if we multiply both sides by 2 we get Sum_{k=0..n} 2*k^2 = n*(n+1)*(2*n+1)/3, which is an alternative formula for this sequence. - Mike Warburton, Sep 08 2007
10*a(n) = A016755(n) - A001845(n); since A016755 are odd cubes and A001845 centered octahedral numbers, 10*a(n) are the "odd cubes without their octahedral contents." - Damien Pras, Mar 19 2011
a(n) = sum(a*b), where the summing is over all unordered partitions 2*n+1=a+b. - Vladimir Shevelev, May 11 2012
a(n) = binomial(2*n+2, 3)/2. - Ronan Flatley, Dec 13 2012
a(n) = A000292(n) + A002411(n). - Omar E. Pol, Jan 11 2013
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4) for n>3, with a(0)=0, a(1)=2, a(2)=10, a(3)=28. - Harvey P. Dale, Apr 12 2013
a(n) = A208532(n+1,2). - Philippe Deléham, Dec 05 2013
Sum_{n>0} 1/a(n) = 9 - 12*log(2). - Enrique Pérez Herrero, Dec 03 2014
a(n) = A000292(n-1) + (n+1)*A000217(n). - J. M. Bergot, Sep 02 2015
a(n) = 2*(A000332(n+3) - A000332(n+1)). - Antal Pinter, Sep 20 2015
From Bruno Berselli, May 17 2018: (Start)
a(n) = n*A002378(n) - Sum_{k=0..n-1} A002378(k) for n>0, a(0)=0. Also:
A163102(n) = n*a(n) - Sum_{k=0..n-1} a(k) for n>0, A163102(0)=0. (End)
a(n) = A005900(n) - A000290(n) = A096000(n) - A000578(n+1) = A000578(n+1) - A084980(n+1) = A000578(n+1) - A077415(n)-1 = A112524(n) + 1 = A188475(n) - 1 = A061317(n) - A100178(n) = A035597(n+1) - A006331(n+1). - Bruce J. Nicholson, Jun 24 2018
E.g.f.: (1/3)*exp(x)*x*(6 + 9*x + 2*x^2). - Stefano Spezia, Jan 05 2020
Sum_{n>=1} (-1)^(n+1)/a(n) = 3*Pi - 9. - Amiram Eldar, Jan 04 2022

A069011 Triangle with T(n,k) = n^2 + k^2.

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 9, 10, 13, 18, 16, 17, 20, 25, 32, 25, 26, 29, 34, 41, 50, 36, 37, 40, 45, 52, 61, 72, 49, 50, 53, 58, 65, 74, 85, 98, 64, 65, 68, 73, 80, 89, 100, 113, 128, 81, 82, 85, 90, 97, 106, 117, 130, 145, 162, 100, 101, 104, 109, 116, 125, 136, 149, 164, 181, 200
Offset: 0

Views

Author

Henry Bottomley, Apr 02 2002

Keywords

Comments

For any i,j >=0 a(i)*a(j) is a member of this sequence, since (a^2 + b^2)*(c^2 + d^2) = (a*c + b*d)^2 + (a*d - b*c)^2. - Boris Putievskiy, May 05 2013
A227481(n) = number of squares in row n. - Reinhard Zumkeller, Oct 11 2013
Norm of the complex numbers n +- i*k and k +- i*n, where i denotes the imaginary unit. - Stefano Spezia, Aug 07 2025

Examples

			Triangle T(n,k) begins:
    0;
    1,   2;
    4,   5,   8;
    9,  10,  13,  18;
   16,  17,  20,  25,  32;
   25,  26,  29,  34,  41,  50;
   36,  37,  40,  45,  52,  61,  72;
   49,  50,  53,  58,  65,  74,  85,  98;
   64,  65,  68,  73,  80,  89, 100, 113, 128;
   81,  82,  85,  90,  97, 106, 117, 130, 145, 162;
  100, 101, 104, 109, 116, 125, 136, 149, 164, 181, 200;
  ...
		

Crossrefs

Cf. A001481 for terms in this sequence, A000161 for number of times each term appears, A048147 for square array.
Column k=0 gives A000290.
Main diagonal gives A001105.
Row sums give A132124.
T(2n,n) gives A033429.

Programs

  • Haskell
    a069011 n k = a069011_tabl !! n !! k
    a069011_row n = a069011_tabl !! n
    a069011_tabl = map snd $ iterate f (1, [0]) where
       f (i, xs@(x:_)) = (i + 2, (x + i) : zipWith (+) xs [i + 1, i + 3 ..])
    -- Reinhard Zumkeller, Oct 11 2013
  • Mathematica
    Table[n^2 + k^2, {n, 0, 12}, {k, 0, n}] (* Paolo Xausa, Aug 07 2025 *)

Formula

T(n+1,k+1) = T(n,k) + 2*(n+k+1), k=0..n; T(n+1,0) = T(n,0) + 2*n + 1. - Reinhard Zumkeller, Oct 11 2013
G.f.: x*(1 + 2*y + 5*x^3*y^2 - x^2*y*(2 + 5*y) + x*(1 - 4*y + 2*y^2))/((1 - x)^3*(1 - x*y)^3). - Stefano Spezia, Aug 04 2025

A277557 The ordered image of the 1-to-1 mapping of an integer ordered pair (x,y) into an integer using Cantor's pairing function, where 0 < x < y, gcd(x,y)=1 and x+y odd.

Original entry on oeis.org

8, 18, 19, 32, 33, 34, 50, 52, 53, 72, 73, 74, 75, 76, 98, 99, 100, 101, 102, 103, 128, 131, 133, 134, 162, 163, 164, 165, 166, 167, 168, 169, 200, 201, 202, 203, 204, 205, 206, 207, 208, 242, 244, 247, 248, 250, 251, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 338
Offset: 1

Views

Author

Frank M Jackson, Oct 19 2016

Keywords

Comments

The mapping of the ordered pair (x,y) to an integer uses Cantor's pairing function to generate the integer as (x+y)(x+y+1)/2+y. Also for every ordered pair (x,y) such that 0 < x < y, gcd(x,y)=1 and x+y odd, there exists a primitive Pythagorean triple (PPT) (a, b, c) such that a = y^2-x^2, b = 2xy, c = x^2+y^2. Therefore each term in the sequence represents a unique PPT.
Numbers n for which 0 < A025581(n) < A002262(n) and A025581(n)+A002262(n) is odd, and gcd(A025581(n), A002262(n)) = 1. [The definition expressed with A-numbers.] - Antti Karttunen, Nov 02 2016
See also the triangle T(y, x) with the values for PPTs given in A278147. - Wolfdieter Lang, Nov 24 2016

Examples

			a(5)=33 because the ordered pair (2,5) maps to 33 by Cantor's pairing function (see below) and is the 5th such occurrence. Also x=2, y=5 generates a PPT with sides (21,20,29).
Note: Cantor's pairing function is simply A001477 in its two-argument tabular form A001477(k, n) = n + (k+n)*(k+n+1)/2, thus A001477(2,5) = 5 + (2+5)*(2+5+1)/2 = 33. - _Antti Karttunen_, Nov 02 2016
		

Crossrefs

Cf. A020882 (is obtained when A048147(a(n)) is sorted into ascending order), A008846 (same with duplicates removed).

Programs

  • Mathematica
    Cantor[{i_, j_}] := (i+j)(i+j+1)/2+j; getparts[n_] := Reverse@Select[Reverse[IntegerPartitions[n, {2}], 2], GCD@@#==1 &]; pairs=Flatten[Table[getparts[2n+1], {n, 1, 20}], 1]; Table[Cantor[pairs[[n]]], {n, 1, Length[pairs]}]

A340129 a(n) is the number of solutions of the Diophantine equation x^2 + y^2 = z^5 + z, gcd(x, y, z) = 1, x <= y, where z = A008784(n).

Original entry on oeis.org

1, 1, 2, 4, 2, 2, 4, 4, 2, 2, 4, 4, 4, 4, 4, 2, 4, 2, 2, 2, 16, 4, 4, 4, 2, 4, 2, 4, 4, 8, 8, 8, 4, 4, 4, 2, 8, 4, 16, 4, 16, 4, 2, 4, 16, 4, 4, 16, 4, 8, 8, 8, 4, 4, 8, 4, 8, 4, 4, 4, 16, 4, 4, 8, 2, 16, 2, 32, 2, 16, 4, 4, 2, 4, 8, 16, 4, 8, 4, 8, 4, 4, 8, 4, 16
Offset: 1

Views

Author

Bernard Schott, Jan 17 2021

Keywords

Comments

The idea of this sequence comes from the 6th problem of the 21st British Mathematical Olympiad in 1985 where it is asked to show that this equation has infinitely many solutions (see link Olympiads and reference Gardiner).
Indeed, this Diophantine equation x^2 + y^2 = z^5 + z with gcd(x, y, z) = 1 has solutions iff z is in A008784.
When z is in A008784, there exist (u, v), gcd(u, v) = 1 such that z = u^2 + v^2; then, (u*z^2-v)^2 + (u+v*z^2)^2 = z^5 + z. Hence, with x = min(u*z^2-v, u+v*z^2) and y = max(u*z^2-v, u+v*z^2), the equation x^2 + y^2 = z^5 + z is satisfied. So this equation has infinitely many solutions since it has at least one solution for each term of A008784.
For instance, for z = 10 we have:
with (u,v) = (1,3), then x = 1*10^2-3 = 97 and y = 1+3*10^2 = 301,
with (u,v) = (3,1), then x = 3+1*10^2 = 103 and y = 3*10^2-1 = 299,
so finally 97^2 + 301^2 = 103^2 + 299^2 = 10^5 + 10.
Note that some z, among them 10, have other solutions not of this form.

Examples

			For z = A008784(1) = 1, 1^2 + 1^2 = 1^5 + 1 is the only solution, so a(1) = 1.
For z = A008784(3) = 5, 23^2 + 51^2 = 27^2 + 49^2 = 5^5 + 5 so a(3) = 2.
For z = A008784(4) = 10, (97, 301, 10), (103, 299, 10), (119, 293, 10) and (163, 271, 10) are solutions, so a(4) = 4.
		

References

  • A. Gardiner, The Mathematical Olympiad Handbook: An Introduction to Problem Solving, Oxford University Press, 1997, reprinted 2011, Problem 6, pp. 63 and 167-168 (1985).

Crossrefs

Programs

  • Mathematica
    f[n_] := Length @ Solve[x^2 + y^2 == n^5 + n && GCD @@ {x, y, n} == 1 && 0 <= x <= y, {x, y}, Integers]; f /@ Select[Range[500], IntegerExponent[#, 2] < 2 && AllTrue[FactorInteger[#][[;; , 1]], Mod[#1, 4] < 3 &] &] (* Amiram Eldar, Jan 22 2021 *)
  • PARI
    f(z) = {if (issquare(Mod(-1, z)), my(nb = 0, s = z^5+z, d, j); for (i=1, sqrtint(s), if (issquare(d = s - i^2), j = sqrtint(d); if ((j<=i) && gcd([i, j, z]) == 1, nb++););); nb;);}
    lista(nn) = {for (n=1, nn, if (issquare(Mod(-1, n)), print1(f(n), ", ")););} \\ Michel Marcus, Jan 20 2021

Extensions

More terms from Michel Marcus, Jan 20 2021

A373710 Triangle read by rows: T(n,k) is the area of the square whose vertices divide the sides n of a circumscribed square into integer sections k and n - k, 0 <= k <= floor(n/2).

Original entry on oeis.org

0, 1, 4, 2, 9, 5, 16, 10, 8, 25, 17, 13, 36, 26, 20, 18, 49, 37, 29, 25, 64, 50, 40, 34, 32, 81, 65, 53, 45, 41, 100, 82, 68, 58, 52, 50, 121, 101, 85, 73, 65, 61, 144, 122, 104, 90, 80, 74, 72, 169, 145, 125, 109, 97, 89, 85, 196, 170, 148, 130, 116, 106, 100, 98
Offset: 0

Views

Author

Felix Huber, Jun 17 2024

Keywords

Comments

For a sketch see linked illustration "Square in square".

Examples

			Triangle T(n,k) begins:
   n\k   0     1     2     3     4     5     6     7   ...
   0     0
   1     1
   2     4     2
   3     9     5
   4    16    10     8
   5    25    17    13
   6    36    26    20    18
   7    49    37    29    25
   8    64    50    40    34    32
   9    81    65    53    45    41
  10   100    82    68    58    52    50
  11   121   101    85    73    65    61
  12   144   122   104    90    80    74    72
  13   169   145   125   109    97    89    85
  14   196   170   148   130   116   106   100    98
  ...
		

Crossrefs

Cf. A000290(first column), A005563 (second column), A048147 (rows: first half of each diagonal there), A087475 (third column), A189834 (fourth column), A241751 (fifth column).

Programs

  • Maple
    A373710:=(n,k)->n^2+2*k^2-2*n*k;
    seq(seq(A373710(n,k),k=0..floor(n/2)),n=0..14);

Formula

T(n,k) = n^2 + 2*k^2 - 2*n*k, 0 <= k <= floor(n/2).
Sequence of row n = r: a(i) = 2*i^2 - 4*i - 2*r*i + r^2 + 2*r + 2, 1 <= i <= floor(r/2 + 1).
Sequence of column k = c: a(j) = j^2 - 2*j + 2*c*j + 2*c^2 - 2*c + 1, j >= 1.

A157927 Joint-rank array of the numbers i^2+j^2, where i>=0, j>=0.

Original entry on oeis.org

1, 2, 2, 4, 3, 4, 7, 5, 5, 7, 10, 8, 6, 8, 10, 14, 11, 9, 9, 11, 14, 19, 15, 13, 12, 13, 15, 19, 24, 20, 16, 14, 14, 16, 20, 24, 30, 25, 21, 18, 17, 18, 21, 25, 30, 37, 31, 27, 23, 22, 22, 23, 27, 31, 37, 44, 38, 32, 28, 26, 25, 26, 28, 32, 38, 44
Offset: 1

Views

Author

Clark Kimberling, Dec 17 2010

Keywords

Comments

The definition of joint-rank array given at A182801 is
here extended to arrays R={f(i,j)} for which the numbers
f(i,j) are not necessarily distinct. Specifically, all
duplicates are assigned the same rank when all the numbers
in R are jointly ranked. Let {a(i,j)} denote the
resulting joint-rank array. In case all f(i,j) are
positive integers, a(i,j)=f(i,j)-L(i,j), where L(i,j) is
the number of numbers in R that are <=f(i,j).
(Row 1)=A047808.

Examples

			A corner of the array R={i^2+j^2} is
0....1....4....9...16...
1....2....5...10...17...
4....5....8...13...20...
9...10...13...18...25...
Replace each term of R by its rank:
1....2....4....7...10...
2....3....5....8...11...
4....5....6....9...13...
7....8....9...12...14...
		

Crossrefs

A349039 Square array T(n, k) read by antidiagonals, n, k >= 0; T(n, k) = n^2 - n*k + k^2.

Original entry on oeis.org

0, 1, 1, 4, 1, 4, 9, 3, 3, 9, 16, 7, 4, 7, 16, 25, 13, 7, 7, 13, 25, 36, 21, 12, 9, 12, 21, 36, 49, 31, 19, 13, 13, 19, 31, 49, 64, 43, 28, 19, 16, 19, 28, 43, 64, 81, 57, 39, 27, 21, 21, 27, 39, 57, 81, 100, 73, 52, 37, 28, 25, 28, 37, 52, 73, 100, 121, 91, 67, 49, 37, 31, 31, 37, 49, 67, 91, 121
Offset: 0

Views

Author

Rémy Sigrist, Nov 06 2021

Keywords

Comments

T(n, k) is the norm of the Eisenstein integer n + k*w (where w = -1/2 + sqrt(-3)/2 is a primitive cube root of unity).
All terms belong to A003136.

Examples

			Array T(n, k) begins:
  n\k|    0   1   2   3   4   5   6   7   8   9   10
  ---+----------------------------------------------
    0|    0   1   4   9  16  25  36  49  64  81  100
    1|    1   1   3   7  13  21  31  43  57  73   91
    2|    4   3   4   7  12  19  28  39  52  67   84
    3|    9   7   7   9  13  19  27  37  49  63   79
    4|   16  13  12  13  16  21  28  37  48  61   76
    5|   25  21  19  19  21  25  31  39  49  61   75
    6|   36  31  28  27  28  31  36  43  52  63   76
    7|   49  43  39  37  37  39  43  49  57  67   79
    8|   64  57  52  49  48  49  52  57  64  73   84
    9|   81  73  67  63  61  61  63  67  73  81   91
   10|  100  91  84  79  76  75  76  79  84  91  100
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := n^2 - n*k + k^2; Table[T[k, n - k], {n, 0, 11}, {k, 0, n}] // Flatten (* Amiram Eldar, Nov 08 2021 *)
  • PARI
    T(n,k) = n^2 - n*k + k^2

Formula

T(n, k) = T(k, n).
T(n, 0) = T(n, n) = n^2.
T(n, k) = A048147(n, k) - A004247(n, k).
G.f.: (x - 5*x*y + y*(1 + y) + x^2*(1 + y^2))/((1 - x)^3*(1 - y)^3). - Stefano Spezia, Nov 08 2021
Showing 1-7 of 7 results.