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

A344596 a(n) = Sum_{k=1..n} mu(k) * (floor(n/k)^3 - floor((n-1)/k)^3).

Original entry on oeis.org

1, 6, 18, 30, 60, 66, 126, 132, 198, 204, 330, 276, 468, 414, 552, 552, 816, 630, 1026, 840, 1116, 1050, 1518, 1128, 1740, 1476, 1890, 1692, 2436, 1704, 2790, 2256, 2820, 2544, 3384, 2556, 3996, 3186, 3960, 3408, 4920, 3420, 5418, 4260, 5112, 4686, 6486, 4560, 6930, 5340, 6816
Offset: 1

Views

Author

Seiichi Manyama, May 24 2021

Keywords

Crossrefs

Essentially 6*A102309 and 6*A326419.

Programs

  • Mathematica
    a[n_] := Sum[MoebiusMu[k] * First @ Differences @ (Quotient[{n - 1, n}, k]^3), {k, 1, n}]; Array[a, 50] (* Amiram Eldar, May 24 2021 *)
  • PARI
    a(n) = sum(k=1, n, moebius(k)*((n\k)^3-((n-1)\k)^3));
    
  • PARI
    a(n) = if(n<2, n, 3*sumdiv(n, d, moebius(n/d)*(d-1)*d));
    
  • PARI
    my(N=66, x='x+O('x^N)); Vec(sum(k=1, N, moebius(k)*x^k*(1+4*x^k+x^(2*k))/(1-x^k)^3))
    
  • PARI
    my(N=66, x='x+O('x^N)); Vec(x+6*sum(k=1, N, moebius(k)*x^(2*k)/(1-x^k)^3))
    
  • Python
    from sympy import mobius, divisors
    def A344596(n): return 3*sum(mobius(n//d)*d*(d-1) for d in divisors(n,generator=True)) if n>1 else 1 # Chai Wah Wu, May 09 2025

Formula

Sum_{k=1..n} a(k) * floor(n/k) = n^3.
Sum_{k=1..n} a(k) = A071778(n).
a(n) = 3 * Sum_{d|n} mu(n/d) * (d-1) * d for n > 1.
G.f.: Sum_{k >= 1} mu(k) * x^k * (1 + 4*x^k + x^(2*k))/(1 - x^k)^3.
G.f.: x + 6 * Sum_{k>=1} mu(k) * x^(2*k)/(1 - x^k)^3.
a(2^k) = 3*2^(k-2)*(3*2^k-2) for k>0. - Chai Wah Wu, May 10 2025

A383783 a(n) = Sum_{k=1..2^n} mu(k) * (floor(2^n/k)^4 - floor((2^n-1)/k)^4).

Original entry on oeis.org

1, 14, 160, 1520, 13216, 110144, 899200, 7266560, 58425856, 468583424, 3753379840, 30045900800, 240442679296, 1923843375104, 15391954862080, 123140470538240, 985143091265536, 7881222038749184, 63050085546065920, 504401921315962880, 4035220318323736576
Offset: 0

Views

Author

Chai Wah Wu, May 09 2025

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[MoebiusMu[k]*(Floor[2^n/k]^4-Floor[(2^n-1)/k]^4),{k,2^n}]; Array[a,21,0] (* James C. McMahon, May 10 2025 *)
  • PARI
    a(n) = sum(k=1, 2^n, moebius(k) * ((2^n\k)^4 - ((2^n-1)\k)^4)); \\ Michel Marcus, May 10 2025
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A082540(n):
        if n == 0:
            return 0
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A082540(k1)
            j, k1 = j2, n//j2
        return n*(n**3-1)-c+j
    def A383783(n): return A082540(m:=1<A082540(m-1)
    

Formula

a(n) = A344597(2^n) = A082540(2^n) - A082540(2^n-1).
Showing 1-2 of 2 results.