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.

A093995 n^2 appears n times, triangle read by rows.

Original entry on oeis.org

1, 4, 4, 9, 9, 9, 16, 16, 16, 16, 25, 25, 25, 25, 25, 36, 36, 36, 36, 36, 36, 49, 49, 49, 49, 49, 49, 49, 64, 64, 64, 64, 64, 64, 64, 64, 81, 81, 81, 81, 81, 81, 81, 81, 81, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121
Offset: 1

Views

Author

Reinhard Zumkeller, May 24 2004

Keywords

Comments

Row sums give A000578.
Triangle sums give A000537.

Examples

			First few rows of the triangle are:
   1;
   4,  4;
   9,  9,  9;
  16, 16, 16, 16;
  25, 25, 25, 25, 25;
  36, 36, 36, 36, 36, 36;
  49, 49, 49, 49, 49, 49, 49;
  ...
		

Crossrefs

Programs

  • Haskell
    a093995 n k = a093995_tabl !! (n-1) !! (k-1)
    a093995_row n = a093995_tabl !! (n-1)
    a093995_tabl = zipWith replicate [1..] $ tail a000290_list
    a093995_list = concat a093995_tabl
    -- Reinhard Zumkeller, Nov 11 2012, Mar 18 2011, Oct 17 2010
    
  • Magma
    [n^2: k in [1..n], n in [1..13]]; // G. C. Greubel, Dec 27 2021
    
  • Maple
    seq(seq(n^2, i=1..n), n=1..20); # Ridouane Oudra, Jun 18 2019
  • Mathematica
    Flatten[Table[Table[n^2,{n}],{n,11}]]  (* Harvey P. Dale, Feb 18 2011 *)
    Table[PadRight[{},n,n^2],{n,12}]//Flatten (* Harvey P. Dale, Jun 28 2023 *)
  • Python
    from math import isqrt
    def A093995(n): return ((m:=isqrt(k:=n<<1))+(k>m*(m+1)))**2 # Chai Wah Wu, Nov 07 2024
  • Sage
    flatten([[n^2 for k in (1..n)] for n in (1..13)]) # G. C. Greubel, Dec 27 2021
    

Formula

T(n, k) = n^2, 1<=k<=n.
a(n) = floor(sqrt(2*n - 1) + 1/2)^2. - Ridouane Oudra, Jun 18 2019
From G. C. Greubel, Dec 27 2021: (Start)
T(n, n-k) = T(n, k).
Sum_{k=1..floor(n/2)} T(n, k) = [n=1] + A265645(n+1).
Sum_{k=1..floor(n/2)} T(n-k, k) = (1/48)*n*(n-1)*(7*(2*n-1) + 3*(-1)^n).
T(2*n-1, n) = A016754(n).
T(2*n, n) = A016742(n). (End)

Extensions

Edited by N. J. A. Sloane, Jul 03 2008 at the suggestion of R. J. Mathar
Definition clarified by N. J. A. Sloane, Nov 09 2024