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.

A143327 Table T(n,k) by antidiagonals. T(n,k) is the number of primitive (=aperiodic) k-ary words (n,k >= 1) with length less than or equal to n which are earlier in lexicographic order than any other word derived by cyclic shifts of the alphabet.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 5, 1, 1, 4, 11, 11, 1, 1, 5, 19, 35, 26, 1, 1, 6, 29, 79, 115, 53, 1, 1, 7, 41, 149, 334, 347, 116, 1, 1, 8, 55, 251, 773, 1339, 1075, 236, 1, 1, 9, 71, 391, 1546, 3869, 5434, 3235, 488, 1, 1, 10, 89, 575, 2791, 9281, 19493, 21754, 9787, 983, 1, 1, 11
Offset: 1

Views

Author

Alois P. Heinz, Aug 07 2008

Keywords

Comments

The coefficients of the polynomial of row n are given by the n-th row of triangle A134541; for example row 4 has polynomial -1+k^2+k^3.

Examples

			T(3,3) = 11, because 11 words of length <=3 over 3-letter alphabet {a,b,c} are primitive and earlier than others derived by cyclic shifts of the alphabet: a, ab, ac, aab, aac, aba, abb, abc, aca, acb, acc.
Table begins:
  1,   1,    1,     1,     1,      1,      1,       1, ...
  1,   2,    3,     4,     5,      6,      7,       8, ...
  1,   5,   11,    19,    29,     41,     55,      71, ...
  1,  11,   35,    79,   149,    251,    391,     575, ...
  1,  26,  115,   334,   773,   1546,   2791,    4670, ...
  1,  53,  347,  1339,  3869,   9281,  19543,   37367, ...
  1, 116, 1075,  5434, 19493,  55936, 137191,  299510, ...
  1, 236, 3235, 21754, 97493, 335656, 960391, 2396150, ...
		

Crossrefs

Rows n=1-4 give: A000012, A000027, A028387, A003777.
Main diagonal gives A320095.

Programs

  • Maple
    with(numtheory):
    f1:= proc (n) option remember; unapply(k^(n-1)
            -add(f1(d)(k), d=divisors(n) minus {n}), k)
         end:
    g1:= proc(n) option remember; unapply(add(f1(j)(x), j=1..n), x) end:
    T:= (n, k)-> g1(n)(k):
    seq(seq(T(n, 1+d-n), n=1..d), d=1..12);
  • Mathematica
    t[n_, k_] := Sum[k^(d-1)*MoebiusMu[j/d], {j, 1, n}, {d, Divisors[j]}]; Table[t[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Dec 13 2013 *)

Formula

T(n,k) = Sum_{j=1..n} Sum_{d|j} k^(d-1) * mu(j/d).
T(n,k) = Sum_{j=1..n} A143325(j,k).
T(n,k) = A143326(n,k) / k.

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

Original entry on oeis.org

1, 4, 15, 92, 790, 9384, 137326, 2397352, 48428487, 1111122360, 28531183329, 810554859732, 25239592620853, 854769763924104, 31278135039463245, 1229782938533709200, 51702516368332126932, 2314494592676172411516, 109912203092257573556274, 5518821052632117898282620
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 16 2020

Keywords

Crossrefs

Sums of the form Sum_{k=1..n} q^(k-1)*floor(n/k): A344820 (q=-n), A344819 (q=-4), A344818 (q=-3), A344817 (q=-2), A059851 (q=-1), A006218 (q=1), A268235 (q=2), A344814 (q=3), A344815 (q=4), A344816 (q=5), this sequence (q=n).

Programs

  • Magma
    A332533:= func< n | (&+[Floor(n/j)*n^(j-1): j in [1..n]]) >;
    [A332533(n): n in [1..40]]; // G. C. Greubel, Jun 27 2024
    
  • Maple
    seq(add(n^(k-1)*floor(n/k), k=1..n), n=1..60); # Ridouane Oudra, Mar 05 2023
  • Mathematica
    Table[(1/n) Sum[Floor[n/k] n^k, {k, 1, n}], {n, 1, 20}]
    Table[(1/n) Sum[Sum[n^d, {d, Divisors[k]}], {k, 1, n}], {n, 1, 20}]
    Table[SeriesCoefficient[(1/(1 - x)) Sum[x^k/(1 - n x^k), {k, 1, n}], {x, 0, n}], {n, 1, 20}]
  • PARI
    a(n) = sum(k=1, n, (n\k)*n^k)/n; \\ Michel Marcus, Feb 16 2020
    
  • PARI
    a(n) = sum(k=1, n, sumdiv(k, d, n^(d-1))); \\ Seiichi Manyama, May 29 2021
    
  • SageMath
    def A332533(n): return sum((n//j)*n^(j-1) for j in range(1,n+1))
    [A332533(n) for n in range(1,41)] # G. C. Greubel, Jun 27 2024

Formula

a(n) = [x^n] (1/(1 - x)) * Sum_{k>=1} x^k / (1 - n*x^k).
a(n) = (1/n) * Sum_{k=1..n} Sum_{d|k} n^d.
a(n) ~ n^(n-1). - Vaclav Kotesovec, May 28 2021
a(n) = (1/(n-1)) * Sum_{k=1..n} (n^floor(n/k) - 1), for n>=2. - Ridouane Oudra, Mar 05 2023
Showing 1-2 of 2 results.