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

A332469 a(n) = Sum_{k=1..n} floor(n/k)^n.

Original entry on oeis.org

1, 5, 29, 274, 3160, 47452, 825862, 16843268, 387702833, 10009826727, 285360679985, 8918294547447, 302888236005847, 11112685321898449, 437898668488710801, 18447025705612363530, 827242514466399305122, 39346558271561286347116, 1978421007121668206129316
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 13 2020

Keywords

Crossrefs

Programs

  • Magma
    [&+[Floor(n/k)^n:k in [1..n]]:n in [1..20]]; // Marius A. Burtea, Feb 13 2020
    
  • Mathematica
    Table[Sum[Floor[n/k]^n, {k, 1, n}], {n, 1, 19}]
    Table[SeriesCoefficient[1/(1 - x) Sum[(k^n - (k - 1)^n) x^k/(1 - x^k), {k, 1, n}], {x, 0, n}], {n, 1, 19}]
  • PARI
    a(n)={sum(k=1, n, floor(n/k)^n)} \\ Andrew Howroyd, Feb 13 2020
    
  • Python
    from math import isqrt
    def A332469(n): return -(s:=isqrt(n))**(n+1)+sum((q:=n//k)*(k**n-(k-1)**n+q**(n-1)) for k in range(1,s+1)) # Chai Wah Wu, Oct 26 2023

Formula

a(n) = [x^n] (1/(1 - x)) * Sum_{k>=1} (k^n - (k - 1)^n) * x^k / (1 - x^k).
a(n) ~ n^n. - Vaclav Kotesovec, Jun 11 2021

A344527 Square array T(n,k), n >= 1, k >= 1, read by antidiagonals, where T(n,k) is the number of ordered k-tuples (x_1, x_2, ..., x_k) with gcd(x_1, x_2, ..., x_k) = 1 (1 <= {x_1, x_2, ..., x_k} <= n).

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 7, 7, 1, 1, 15, 25, 11, 1, 1, 31, 79, 55, 19, 1, 1, 63, 241, 239, 115, 23, 1, 1, 127, 727, 991, 607, 181, 35, 1, 1, 255, 2185, 4031, 3091, 1199, 307, 43, 1, 1, 511, 6559, 16255, 15559, 7501, 2303, 439, 55, 1, 1, 1023, 19681, 65279, 77995, 45863, 16531, 3823, 637, 63, 1
Offset: 1

Views

Author

Seiichi Manyama, May 22 2021

Keywords

Examples

			G.f. of column 3: (1/(1 - x)) * Sum_{i>=1} mu(i) * (x^i + 4*x^(2*i) + x^(3*i))/(1 - x^i)^3.
Square array begins:
  1,  1,   1,    1,    1,     1, ...
  1,  3,   7,   15,   31,    63, ...
  1,  7,  25,   79,  241,   727, ...
  1, 11,  55,  239,  991,  4031, ...
  1, 19, 115,  607, 3091, 15559, ...
  1, 23, 181, 1199, 7501, 45863, ...
		

Crossrefs

Columns k=1..6 give A000012, A018805, A071778, A082540, A082544, A343978.
T(n,n) gives A332468.

Programs

  • Mathematica
    T[n_, k_] := Sum[MoebiusMu[j] * Quotient[n, j]^k, {j, 1, n}]; Table[T[k, n - k + 1], {n, 1, 11}, {k, 1, n}] // Flatten (* Amiram Eldar, May 22 2021 *)
  • PARI
    T(n, k) = sum(j=1, n, moebius(j)*(n\j)^k);
    
  • PARI
    T(n, k) = n^k-sum(j=2, n, T(n\j, k));
    
  • Python
    from functools import lru_cache
    from itertools import count, islice
    @lru_cache(maxsize=None)
    def A344527_T(n,k):
        if n == 0:
            return 0
        c, j, k1 = 1, 2, n//2
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A344527_T(k1,k)
            j, k1 = j2, n//j2
        return n*(n**(k-1)-1)-c+j
    def A344527_gen(): # generator of terms
        return (A344527_T(k+1, n-k) for n in count(1) for k in range(n))
    A344527_list = list(islice(A344527_gen(),30)) # Chai Wah Wu, Nov 02 2023

Formula

G.f. of column k: (1/(1 - x)) * Sum_{i>=1} mu(i) * ( Sum_{j=1..k} A008292(k, j) * x^(i*j) )/(1 - x^i)^k.
T(n,k) = Sum_{j=1..n} mu(j) * floor(n/j)^k.
T(n,k) = n^k - Sum_{j=2..n} T(floor(n/j),k).

A344429 a(n) = Sum_{k=1..n} mu(k) * k^n.

Original entry on oeis.org

1, -3, -34, -96, -3399, 30239, -624046, -4482626, -32249230, 9768165230, -186975207617, -2150337557747, -327482869358214, 6894274639051756, 539094536846680025, 8044964790023844733, -707278869236116107432, -12275330572755863672628, -2190860499375418948848067
Offset: 1

Views

Author

Seiichi Manyama, May 19 2021

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[MoebiusMu[k] * k^n, {k,1,n}]; Array[a, 20] (* Amiram Eldar, May 19 2021 *)
  • PARI
    a(n) = sum(k=1, n, moebius(k)*k^n);
    
  • Python
    from functools import lru_cache
    from math import comb
    from sympy import bernoulli
    @lru_cache(maxsize=None)
    def faulhaber(n,p):
        """ Faulhaber's formula for calculating Sum_{k=1..n} k^p
            requires sympy version 1.12+ where bernoulli(1) = 1/2
        """
        return sum(comb(p+1,k)*bernoulli(k)*n**(p-k+1) for k in range(p+1))//(p+1)
    @lru_cache(maxsize=None)
    def A344429(n,m=None):
        if n <= 1:
            return 1
        if m is None:
            m=n
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (faulhaber(j-1,m)-faulhaber(j2-1,m))*A344429(k1,m)
            j, k1 = j2, n//j2
        return c+faulhaber(j-1,m)-faulhaber(n,m) # Chai Wah Wu, Nov 02 2023
Showing 1-3 of 3 results.