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

A344725 Square array T(n,k), n >= 1, k >= 1, read by antidiagonals downwards, where T(n,k) = Sum_{j=1..n} floor(n/j)^k.

Original entry on oeis.org

1, 1, 3, 1, 5, 5, 1, 9, 11, 8, 1, 17, 29, 22, 10, 1, 33, 83, 74, 32, 14, 1, 65, 245, 274, 136, 52, 16, 1, 129, 731, 1058, 644, 254, 66, 20, 1, 257, 2189, 4162, 3160, 1396, 382, 92, 23, 1, 513, 6563, 16514, 15692, 8054, 2502, 596, 115, 27, 1, 1025, 19685, 65794, 78256, 47452, 17086, 4388, 833, 147, 29
Offset: 1

Views

Author

Seiichi Manyama, May 27 2021

Keywords

Examples

			Square array begins:
   1,  1,   1,    1,    1,     1, ...
   3,  5,   9,   17,   33,    65, ...
   5, 11,  29,   83,  245,   731, ...
   8, 22,  74,  274, 1058,  4162, ...
  10, 32, 136,  644, 3160, 15692, ...
  14, 52, 254, 1396, 8054, 47452, ...
		

Crossrefs

Columns k=1..5 give A006218, A222548, A318742, A318743, A318744.
T(n,n) gives A332469.

Programs

  • Mathematica
    T[n_, k_] := Sum[Quotient[n, j]^k, {j, 1, n}]; Table[T[k, n - k + 1], {n, 1, 10}, {k, 1, n}] // Flatten (* Amiram Eldar, May 27 2021 *)
  • PARI
    T(n, k) = sum(j=1, n, (n\j)^k);
    
  • PARI
    T(n, k) = sum(j=1, n, sumdiv(j, d, d^k-(d-1)^k));
    
  • Python
    from math import isqrt
    from itertools import count, islice
    def A344725_T(n,k): return -(s:=isqrt(n))**(k+1)+sum((q:=n//w)*(w**k-(w-1)**k+q**(k-1)) for w in range(1,s+1))
    def A344725_gen(): # generator of terms
         return (A344725_T(k+1,n-k) for n in count(1) for k in range(n))
    A344725_list = list(islice(A344725_gen(),30)) # Chai Wah Wu, Oct 26 2023

Formula

G.f. of column k: (1/(1 - x)) * Sum_{j>=1} (j^k - (j - 1)^k) * x^j/(1 - x^j).
T(n,k) = Sum_{j=1..n} Sum_{d|j} d^k - (d - 1)^k.

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

Original entry on oeis.org

1, 3, 9, 12, 22, 30, 44, 48, 71, 83, 105, 115, 141, 157, 201, 206, 240, 266, 304, 318, 378, 402, 448, 460, 519, 547, 623, 641, 699, 747, 809, 815, 907, 943, 1035, 1064, 1138, 1178, 1286, 1302, 1384, 1448, 1534, 1560, 1710, 1758, 1852, 1866, 1977, 2039, 2179, 2209, 2315, 2395, 2535
Offset: 1

Views

Author

Seiichi Manyama, May 27 2021

Keywords

Crossrefs

Column k=2 of A344726.

Programs

  • Mathematica
    a[n_] := Sum[(-1)^(k + 1) * Quotient[n, k]^2, {k, 1, n}]; Array[a, 50] (* Amiram Eldar, May 27 2021 *)
    Accumulate[Table[-2*DivisorSigma[0, 2*n] + 3*DivisorSigma[0, n] + 2*DivisorSigma[1, 2*n] - 4*DivisorSigma[1, n], {n, 1, 50}]] (* Vaclav Kotesovec, May 28 2021 *)
  • PARI
    a(n) = sum(k=1, n, (-1)^(k+1)*(n\k)^2);
    
  • PARI
    a(n) = sum(k=1, n, sumdiv(k, d, (-1)^(k/d+1)*(2*d-1)));
    
  • PARI
    my(N=66, x='x+O('x^N)); Vec(sum(k=1, N, (2*k-1)*x^k/(1+x^k))/(1-x))

Formula

a(n) = Sum_{k=1,..n} Sum_{d|k} (-1)^(k/d + 1) * (2*d - 1).
G.f.: (1/(1 - x)) * Sum_{k>=1} (2*k - 1) * x^k/(1 + x^k).
a(n) ~ Pi^2 * n^2 / 12. - Vaclav Kotesovec, May 28 2021

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

Original entry on oeis.org

1, 6, 14, 31, 45, 81, 101, 150, 191, 253, 285, 401, 439, 527, 623, 752, 802, 979, 1035, 1233, 1369, 1509, 1577, 1901, 2020, 2186, 2362, 2642, 2728, 3136, 3228, 3549, 3765, 3983, 4215, 4772, 4882, 5126, 5382, 5932, 6054, 6630, 6758, 7202, 7664, 7960, 8100, 8936
Offset: 1

Views

Author

Seiichi Manyama, Dec 14 2021

Keywords

Crossrefs

Column 2 of A350106.

Programs

  • Mathematica
    a[n_] := Sum[k * Floor[n/k]^2, {k, 1, n}]; Array[a, 50] (* Amiram Eldar, Dec 14 2021 *)
    Accumulate[Table[2*k*DivisorSigma[0, k] - DivisorSigma[1, k], {k, 1, 100}]] (* Vaclav Kotesovec, Dec 16 2021 *)
  • PARI
    a(n) = sum(k=1, n, k*(n\k)^2);
    
  • PARI
    a(n) = sum(k=1, n, k*sumdiv(k, d, (2*d-1)/d));
    
  • PARI
    my(N=66, x='x+O('x^N)); Vec(sum(k=1, N, (2*k-1)*x^k/(1-x^k)^2)/(1-x))
    
  • PARI
    a(n) = sum(k=1, n, 2*k*numdiv(k)-sigma(k));
    
  • Python
    from math import isqrt
    def A350107(n): return -(s:=isqrt(n))**3*(s+1)+sum((q:=n//k)*((k<<1)*((q<<1)+1)-q-1) for k in range(1,s+1))>>1 # Chai Wah Wu, Oct 24 2023

Formula

a(n) = Sum_{k=1..n} k * Sum_{d|k} (2*d - 1)/d = 2 * A143127(n) - A024916(n).
G.f.: (1/(1 - x)) * Sum_{k>=1} (2*k - 1) * x^k/(1 - x^k)^2.
a(n) = Sum_{k=1..n} 2 * k * tau(k) - sigma(k).

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

Original entry on oeis.org

1, 8, 44, 417, 4545, 69905, 1207937, 24904806, 575256641, 14947281595, 427836523971, 13429362462839, 457637290140469, 16843379604615375, 665494379869134005, 28102480944522059434, 1262906802939553227382, 60182948301301262753877
Offset: 1

Views

Author

Seiichi Manyama, Dec 15 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[k^n Floor[n/k]^2,{k,n}],{n,20}] (* Harvey P. Dale, Feb 11 2022 *)
  • PARI
    a(n) = sum(k=1, n, k^n*(n\k)^2);
    
  • PARI
    a(n) = sum(k=1, n, 2*k*sigma(k, n-1)-sigma(k, n));
    
  • Python
    from math import isqrt
    from sympy import bernoulli
    def A350128(n): return (((s:=isqrt(n))+1)*(1-s)*(bernoulli(n+1,s+1)-(b:=bernoulli(n+1)))+sum(k**n*(n+1)*(((q:=n//k)+1)*(q-1))+(1-2*k)*(b-bernoulli(n+1,q+1)) for k in range(1,s+1)))//(n+1) # Chai Wah Wu, Oct 21 2023

Formula

a(n) = Sum_{k=1..n} 2 * k * sigma_{n-1}(k) - sigma_{n}(k).
a(n) ~ n^n / (1 - exp(-1)). - Vaclav Kotesovec, Dec 16 2021

A236632 Sum of all divisors of all positive integers <= n minus the total number of divisors of all positive integers <= n.

Original entry on oeis.org

0, 1, 3, 7, 11, 19, 25, 36, 46, 60, 70, 92, 104, 124, 144, 170, 186, 219, 237, 273, 301, 333, 355, 407, 435, 473, 509, 559, 587, 651, 681, 738, 782, 832, 876, 958, 994, 1050, 1102, 1184, 1224, 1312, 1354, 1432, 1504, 1572, 1618, 1732, 1786, 1873, 1941
Offset: 1

Views

Author

Omar E. Pol, Jan 31 2014

Keywords

Examples

			For n = 6 the sets of divisors of the positive integers <= 6 are {1}, {1, 2}, {1, 3}, {1, 2, 4}, {1, 5}, {1, 2, 3, 6}. There are 14 total divisors and their sum is 1 + 3 + 4 + 7 + 6 + 12 = 33, so a(6) = 33 - 14 = 19.
		

Crossrefs

Partial sums of A065608.

Programs

  • Magma
    [(&+[DivisorSigma(1, k) - DivisorSigma(0, k) : k in [1..n]]): n in [1..60]]; // Vincenzo Librandi, Aug 02 2019
    
  • Maple
    A236632:=n->(1/2)*add(floor(n/i)*floor((n-i)/i), i=1..n): seq(A236632(n), n=1..100); # Wesley Ivan Hurt, Jan 30 2016
    N:= 1000: # to get a(1) to a(N)
    A065608:= Vector(N):
    for a from 1 to floor(sqrt(N)) do for b from a to N/a do
       if b = a then
         A065608[a*b] := A065608[a*b] + a - 1
       else
         A065608[a*b] := A065608[a*b] + a + b - 2;
       fi
    od od:
    ListTools:-PartialSums(convert(A065608,list)); # Robert Israel, May 16 2016
  • Mathematica
    Table[Sum[Floor[n/i]*Floor[(n - i)/i], {i, n}]/2, {n, 50}] (* Wesley Ivan Hurt, Jan 30 2016 *)
    Table[Sum[Binomial[Floor[n/i], 2], {i, n}], {n, 51}] (* Michael De Vlieger, May 15 2016 *)
    Accumulate@ Table[DivisorSum[n, # - 1 &], {n, 51}] (* or *)
    Table[Sum [(k - 1) Floor[n/k], {k, n}], {n, 51}] (* Michael De Vlieger, Apr 03 2017 *)
  • PARI
    a(n) = sum(i=1, n, sigma(i)) - sum(i=1, n, numdiv(i)); \\ Michel Marcus, Feb 01 2014
    
  • Python
    from math import isqrt
    def A236632(n): return (s:=isqrt(n))**2*(1-s)+sum((q:=n//k)*((k<<1)+q-3) for k in range(1,s+1))>>1 # Chai Wah Wu, Oct 23 2023

Formula

a(n) = A024916(n) - A006218(n).
a(n) = (1/2) * Sum_{i=1..n} floor(n/i) * floor((n-i)/i). - Wesley Ivan Hurt, Jan 30 2016
a(n) = Sum_{i=1..n} binomial(floor(n/i),2). - Wesley Ivan Hurt, May 08 2016
a(n) = Sum_{k=1..n} (k-1) * floor(n/k). - Wesley Ivan Hurt, Apr 02 2017
a(n) = (1/2)*(A222548(n) - A006218(n)). - Ridouane Oudra, Aug 01 2019

A332623 a(n) = Sum_{k=1..n} ceiling(n/k)^2.

Original entry on oeis.org

1, 5, 14, 25, 43, 58, 87, 106, 141, 171, 212, 239, 302, 333, 386, 439, 507, 546, 631, 674, 765, 834, 911, 962, 1091, 1157, 1246, 1331, 1450, 1513, 1666, 1733, 1866, 1967, 2080, 2181, 2373, 2452, 2577, 2694, 2883, 2970, 3171, 3262, 3437, 3600, 3749, 3848, 4107, 4225
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 17 2020

Keywords

Crossrefs

Programs

  • Magma
    [&+[Ceiling(n/k)^2:k in [1..n]]:n in [1..50]]; // Marius A. Burtea, Feb 17 2020
    
  • Mathematica
    Table[Sum[Ceiling[n/k]^2, {k, 1, n}], {n, 1, 50}]
    Table[n + Sum[2 DivisorSigma[1, k] + DivisorSigma[0, k], {k, 1, n - 1}], {n, 1, 50}]
    nmax = 50; CoefficientList[Series[x/(1 - x)^2 + x/(1 - x) Sum[(2 k + 1) x^k/(1 - x^k), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
  • Python
    from math import isqrt
    def A332623(n): return n-(s:=isqrt(n-1))**2*(s+2)+sum((q:=(n-1)//k)*((k<<1)+q+3) for k in range(1,s+1)) # Chai Wah Wu, Oct 24 2023

Formula

G.f.: x/(1 - x)^2 + (x/(1 - x)) * Sum_{k>=1} (2*k + 1) * x^k / (1 - x^k).
a(n) = n + Sum_{k=1..n-1} (2*sigma(k) + d(k)).
a(n) ~ n^2 * Pi^2 / 6. - Vaclav Kotesovec, Feb 20 2020

A332569 a(n) = Sum_{k=1..n} floor(n/k) * ceiling(n/k).

Original entry on oeis.org

1, 5, 12, 23, 36, 54, 74, 97, 125, 156, 186, 226, 268, 306, 354, 409, 458, 515, 574, 636, 710, 778, 838, 922, 1013, 1086, 1168, 1264, 1350, 1452, 1556, 1651, 1762, 1864, 1966, 2105, 2234, 2332, 2448, 2594, 2726, 2864, 3004, 3132, 3294, 3444, 3564, 3736, 3917, 4067
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 16 2020

Keywords

Crossrefs

Programs

  • Magma
    [&+[Floor(n/k)*Ceiling(n/k):k in [1..n]]:n in [1..50]]; // Marius A. Burtea, Feb 16 2020
    
  • Mathematica
    Table[Sum[Ceiling[n/k] Floor[n/k], {k, 1, n}], {n, 1, 50}]
    Table[1 + Sum[DivisorSigma[1, k] + DivisorSigma[1, k + 1], {k, 1, n - 1}], {n, 1, 50}]
    nmax = 50; CoefficientList[Series[((1 + x)/(1 - x)) Sum[x^k/(1 - x^k)^2, {k, 1, nmax}], {x, 0, nmax}], x] // Rest
  • PARI
    a(n) = sum(k=1, n, my(q=n/k); floor(q) * ceil(q)); \\ Michel Marcus, Feb 17 2020
    
  • Python
    from math import isqrt
    from sympy import divisor_sigma
    def A332569(n): return -(s:=isqrt(n))**2*(s+1)+sum((q:=n//k)*((k<<1)+q+1) for k in range(1,s+1))-divisor_sigma(n) # Chai Wah Wu, Oct 23 2023

Formula

G.f.: ((1 + x) / (1 - x)) * Sum_{k>=1} x^k / (1 - x^k)^2.
a(n) = 1 + Sum_{k=1..n-1} (sigma(k) + sigma(k+1)) for n > 0.
a(n) ~ (Pi*n)^2/6. - Vaclav Kotesovec, Jun 24 2021

A360610 Triangle read by rows: T(n,k) is the number of squares of side length k that can be placed inside a square of side length n without overlap, 1 <= k <= n.

Original entry on oeis.org

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

Views

Author

Torlach Rush, Feb 13 2023

Keywords

Comments

T(n,k) is square 1 <= k <= n.
Alternative triangle construction: Write each column k as each square repreated k times.
T(*,1) is A000290.
T(*,2) is A008794.
T(*,3) is A211547.
T(*,4) is A295643(n+4).
T(*,5) is A287392(n+1).
Row sums of triangle are A222548.
This assumes the sides of the small squares are parallel to those of the large square. If the small squares are allowed to be rotated, better packings may exist (see e.g. the Friedman link).

Examples

			Sum_{T(1,*)} = A222548(1) = 1;
Sum_{T(2,*)} = A222548(2) = 5;
Sum_{T(3,*)} = A222548(3) = 11.
Triangle begins:
    1;
    4,  1;
    9,  1, 1;
   16,  4, 1, 1;
   25,  4, 1, 1, 1;
   36,  9, 4, 1, 1, 1;
   49,  9, 4, 1, 1, 1, 1;
   64, 16, 4, 4, 1, 1, 1, 1;
   81, 16, 9, 4, 1, 1, 1, 1, 1;
  100, 25, 9, 4, 4, 1, 1, 1, 1, 1;
  ...
		

Crossrefs

Programs

  • Python
    def T(n, k): return (n//k)**2

Formula

T(n,k) = floor(n/k)^2.
Previous Showing 11-18 of 18 results.