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.

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

Original entry on oeis.org

1, -4, -13, -9, -34, 11, -38, -38, -38, 87, -34, -70, -239, 6, 231, 231, -58, -58, -419, -519, -78, 527, -2, -2, -2, 843, 843, 647, -194, -1319, -2280, -2280, -1191, 254, 1479, 1479, 110, 1915, 3436, 3436, 1755, -450, -2299, -2783, -2783, -138, -2347, -2347, -2347, -2347, 254, -422
Offset: 1

Views

Author

Seiichi Manyama, Apr 01 2023

Keywords

Crossrefs

Partial sums of A359485.
Cf. A336276.

Programs

  • Mathematica
    f[p_, e_] := If[e == 1, -p^2, 0]; f[2, e_] := Switch[e, 1, -5, 2, 4, , 0]; s[1] = 1; s[n] := Times @@ f @@@ FactorInteger[n]; Accumulate[Array[s, 100]] (* Amiram Eldar, May 10 2023 *)
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A360390(n):
        if n <= 1:
            return 1
        c, j = 0, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c -= (j2*(j2-1)*((j2<<1)-1)-j*(j-1)*((j<<1)-1))//6*A360390(k1)
            j, k1 = j2, n//j2
        return c-(n*(n+1)*((n<<1)+1)-j*(j-1)*((j<<1)-1))//6 # Chai Wah Wu, Apr 01 2023

Formula

Sum_{k=1..n} k^2 * a(floor(n/k)) = 0 for n > 1.
G.f. A(x) satisfies x * (1 - x) = Sum_{k>=1} k^2 * (1 - x^k) * A(x^k).