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

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

Original entry on oeis.org

1, 4, 8, 15, 25, 33, 45, 60, 73, 95, 115, 131, 157, 181, 205, 236, 270, 297, 333, 379, 403, 443, 487, 519, 578, 632, 672, 720, 778, 826, 886, 949, 989, 1059, 1131, 1186, 1260, 1332, 1388, 1482, 1564, 1612, 1696, 1776, 1858, 1946, 2038, 2102, 2187, 2308, 2380, 2490
Offset: 1

Views

Author

Seiichi Manyama, Dec 18 2021

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[(-1)^(k + 1) * Floor[n/(2*k - 1)]^2, {k, 1, n}]; Array[a, 50] (* Amiram Eldar, Dec 18 2021 *)
  • PARI
    a(n) = sum(k=1, n, (-1)^(k+1)*(n\(2*k-1))^2);
    
  • PARI
    a(n) = sum(k=1, n, sumdiv(k, d, kronecker(-4, k/d)*(2*d-1)));
    
  • PARI
    my(N=66, x='x+O('x^N)); Vec(sum(k=1, N, (2*k-1)*x^k/(1+x^(2*k)))/(1-x))

Formula

a(n) = Sum_{k=1..n} Sum_{d|k} A101455(k/d) * (2*d - 1) = Sum_{k=1..n} 2 * A050469(k) - A002654(k) = 2 * A350166(n) - A014200(n).
G.f.: (1/(1 - x)) * Sum_{k>=1} (2*k - 1) * x^k/(1 + x^(2*k)).
Showing 1-1 of 1 results.