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

A068340 a(n) = Sum_{k=1..n} mu(k)*k, where mu(k) is the Moebius function.

Original entry on oeis.org

1, -1, -4, -4, -9, -3, -10, -10, -10, 0, -11, -11, -24, -10, 5, 5, -12, -12, -31, -31, -10, 12, -11, -11, -11, 15, 15, 15, -14, -44, -75, -75, -42, -8, 27, 27, -10, 28, 67, 67, 26, -16, -59, -59, -59, -13, -60, -60, -60, -60, -9, -9, -62, -62, -7, -7, 50, 108, 49
Offset: 1

Views

Author

Leroy Quet, Feb 27 2002

Keywords

Comments

Row sums of triangle A143158. - Gary W. Adamson, Jul 27 2008

Crossrefs

Programs

  • Haskell
    a068340 n = a068340_list !! (n-1)
    a068340_list = scanl1 (+) a055615_list
    -- Reinhard Zumkeller, Sep 04 2015
    
  • Maple
    with(numtheory):
    a:= proc(n) a(n):= mobius(n)*n +a(n-1) end: a(0):=0:
    seq(a(n), n=1..100);  # Alois P. Heinz, Oct 21 2012
  • Mathematica
    Table[Sum[MoebiusMu[k]k,{k,n}],{n,60}] (* Harvey P. Dale, Feb 01 2012 *)
  • PARI
    a(n) = sum(k=1, n, k*moebius(k)); \\ Michel Marcus, Jan 14 2023
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A068340(n):
        if n <= 1:
            return 1
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c -= (j2*(j2-1)-j*(j-1)>>1)*A068340(k1)
            j, k1 = j2, n//j2
        return c-(n*(n+1)-(j-1)*j>>1) # Chai Wah Wu, Apr 04 2023

Formula

G.f. A(x) satisfies x = Sum_{k>=1} k * (1 - x^k) * A(x^k). - Seiichi Manyama, Apr 01 2023
Sum_{k=1..n} k * a(floor(n/k)) = 1. - Seiichi Manyama, Apr 03 2023

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

Original entry on oeis.org

1, 5, -4, 28, 3, -33, -82, 174, 174, 74, -47, -335, -504, -700, -475, 1573, 1284, 1284, 923, 123, 564, 80, -449, -2753, -2753, -3429, -3429, -4997, -5838, -4938, -5899, 10485, 11574, 10418, 11643, 11643, 10274, 8830, 10351, 3951, 2270, 4034, 2185, -1687, -1687, -3803
Offset: 1

Views

Author

Seiichi Manyama, Apr 02 2023

Keywords

Crossrefs

Partial sums of A361987.
Cf. A336276.

Programs

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

Formula

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

A332793 a(1) = 1; a(n) = n * Sum_{d|n, d < n} (-1)^(n/d) * a(d) / d.

Original entry on oeis.org

1, 2, -3, 8, -5, -6, -7, 32, 0, -10, -11, -24, -13, -14, 15, 128, -17, 0, -19, -40, 21, -22, -23, -96, 0, -26, 0, -56, -29, 30, -31, 512, 33, -34, 35, 0, -37, -38, 39, -160, -41, 42, -43, -88, 0, -46, -47, -384, 0, 0, 51, -104, -53, 0, 55, -224, 57, -58, -59, 120
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 24 2020

Keywords

Crossrefs

Cf. A002129, A038838 (positions of 0's), A055615, A067856, A327268, A361987.
Partial sums give A361982.
Dirichlet inverse of A181983.

Programs

  • Mathematica
    a[1] = 1; a[n_] := n Sum[If[d < n, (-1)^(n/d) a[d]/d, 0], {d, Divisors[n]}]; Table[a[n], {n, 1, 60}]
    terms = 60; A[] = 0; Do[A[x] = x + Sum[(-1)^k k A[x^k], {k, 2, terms}] + O[x]^(terms + 1) // Normal, terms + 1]; CoefficientList[A[x], x] // Rest
    f[p_, e_] := If[p == 2, p^(2*e - 1), -p*Boole[e == 1]]; a[1] = 1; a[n_] := Times @@ (f @@@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, Dec 02 2020 *)

Formula

G.f. A(x) satisfies: A(x) = x + Sum_{k>=2} (-1)^k * k * A(x^k).
Dirichlet g.f.: 1 / (zeta(s-1) * (1 - 2^(2 - s))).
a(n) = Sum_{d|n} A327268(d).
Multiplicative with a(2^e) = 2^(2*e-1), and a(p^e) = -p if e=1 and 0 for e>1, for odd primes p. - Amiram Eldar, Dec 02 2020

A362021 a(n) = Sum_{k=1..n} (-1)^(n-k) * k * mu(k), where mu(k) is the Moebius function.

Original entry on oeis.org

1, -3, 0, 0, -5, 11, -18, 18, -18, 28, -39, 39, -52, 66, -51, 51, -68, 68, -87, 87, -66, 88, -111, 111, -111, 137, -137, 137, -166, 136, -167, 167, -134, 168, -133, 133, -170, 208, -169, 169, -210, 168, -211, 211, -211, 257, -304, 304, -304, 304, -253, 253, -306, 306, -251, 251, -194, 252, -311
Offset: 1

Views

Author

Seiichi Manyama, Apr 04 2023

Keywords

Crossrefs

Programs

  • PARI
    a(n) = sum(k=1, n, (-1)^(n-k)*k*moebius(k));

Formula

G.f.: (Sum_{k>=1} k * mu(k) * x^k) / (1 + x).
G.f. A(x) satisfies x = Sum_{k>=1} k * (1 + x^k) * A(x^k).
a(n) = -a(n-1) + A055615(n) for n > 1.
Showing 1-4 of 4 results.