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

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

A285188 a(n) = Sum_{k=1..n} (k^2*floor(k/2)).

Original entry on oeis.org

0, 4, 13, 45, 95, 203, 350, 606, 930, 1430, 2035, 2899, 3913, 5285, 6860, 8908, 11220, 14136, 17385, 21385, 25795, 31119, 36938, 43850, 51350, 60138, 69615, 80591, 92365, 105865, 120280, 136664, 154088, 173740, 194565, 217893, 242535, 269971
Offset: 1

Views

Author

Néstor Jofré, Apr 24 2017

Keywords

Examples

			For n = 4, a(4) = 1^2*floor(1/2)  + 2^2*floor(2/2) + 3^2*floor(3/2) + 4^2*floor(4/2) =  0 + 4 + 9 + 32 = 45.
		

Crossrefs

Cf. A049779.
Partial sums of A265645.

Programs

  • MATLAB
    s = @(n) sum((1:n).^2.*floor((1:n)/2)); %summation handle function
             s_cf = @(n) 1/8*n^2*(n+1)^2 - 2/3*floor((n+1)/2)^3 + 1/6*floor((n+1)/2); %faster closed-form handle function
    
  • Maple
    seq( n*(n+1)*(3*n^2+n-1+3*(-1)^n)/24, n=1..100); # Robert Israel, Apr 26 2017
  • PARI
    a(n) = sum(k=1, n, k^2*(k\2)); \\ Michel Marcus, Apr 24 2017

Formula

Theorem: a(n) = (1/8)*n^2*(n+1)^2 - (2/3)*floor((n+1)/2)^3 + (1/6)*floor((n+1)/2).
From Chai Wah Wu, Apr 24 2017: (Start)
a(n) = 2*a(n-1) + 2*a(n-2) - 6*a(n-3) + 6*a(n-5) - 2*a(n-6) - 2*a(n-7) + a(n-8) for n > 8.
G.f.: x^2*(x^4 + 3*x^3 + 11*x^2 + 5*x + 4)/((1 - x)^5*(1 + x)^3). (End)
a(n) = n*(n+1)*(3*n^2+n-1+3*(-1)^n)/24. - Robert Israel, Apr 26 2017

A303692 a(n) = n^2*(2*n - 3 - (-1)^n)/4.

Original entry on oeis.org

0, 0, 9, 16, 50, 72, 147, 192, 324, 400, 605, 720, 1014, 1176, 1575, 1792, 2312, 2592, 3249, 3600, 4410, 4840, 5819, 6336, 7500, 8112, 9477, 10192, 11774, 12600, 14415, 15360, 17424, 18496, 20825, 22032, 24642, 25992, 28899, 30400, 33620, 35280, 38829, 40656
Offset: 1

Views

Author

Wesley Ivan Hurt, Apr 28 2018

Keywords

Comments

Total area of all squares with side length n such that n = s + t and s < t where s and t are positive integers.

Crossrefs

Cf. A265645.

Programs

  • Magma
    [n^2*(2*n-3-(-1)^n)/4: n in [1..50]]; // Vincenzo Librandi, Apr 30 2018
    
  • Mathematica
    Table[n^2 (2 n - 3 - (-1)^n)/4, {n, 40}]
    CoefficientList[ Series[(x^5 + 7x^4 + 7x^3 + 9x^2)/((x - 1)^4 (x + 1)^3), {x, 0, 43}], x] (* or *)
    LinearRecurrence[{1, 3, -3, -3, 3, 1, -1}, {0, 0, 9, 16, 50, 72, 147}, 44] (* Robert G. Wilson v, Apr 28 2018 *)
  • PARI
    a(n) = (n-1)\2*n^2; \\ Altug Alkan, Apr 30 2018

Formula

a(n) = Sum_{i=1..floor((n-1)/2)} n^2.
a(n) = n^2 * floor((n-1)/2).
G.f.: x^2*(x^3 + 7*x^2 + 7*x + 9)/((x - 1)^4*(x + 1)^3).
Sum_{n>=3} 1/a(n) = 9/2 - 7*Pi^2/24 - 2*log(2). - Vaclav Kotesovec, May 02 2018
Showing 1-3 of 3 results.