A143325 Table T(n,k) by antidiagonals. T(n,k) is the number of length n primitive (=aperiodic or period n) k-ary words (n,k >= 1) which are earlier in lexicographic order than any other word derived by cyclic shifts of the alphabet.
1, 1, 0, 1, 1, 0, 1, 2, 3, 0, 1, 3, 8, 6, 0, 1, 4, 15, 24, 15, 0, 1, 5, 24, 60, 80, 27, 0, 1, 6, 35, 120, 255, 232, 63, 0, 1, 7, 48, 210, 624, 1005, 728, 120, 0, 1, 8, 63, 336, 1295, 3096, 4095, 2160, 252, 0, 1, 9, 80, 504, 2400, 7735, 15624, 16320, 6552, 495, 0, 1, 10, 99
Offset: 1
Examples
T(4,2)=6, because 6 words of length 4 over 2-letter alphabet {a,b} are primitive and earlier than others derived by cyclic shifts of the alphabet: aaab, aaba, aabb, abaa, abba, abbb; note that aaaa and abab are not primitive and words beginning with b can be derived by shifts of the alphabet from words in the list; secondly note that the words in the list need not be Lyndon words, for example aaba can be derived from aaab by a cyclic rotation of the positions. Table begins: 1, 1, 1, 1, 1, 1, 1, 1, ... 0, 1, 2, 3, 4, 5, 6, 7, ... 0, 3, 8, 15, 24, 35, 48, 63, ... 0, 6, 24, 60, 120, 210, 336, 504, ... 0, 15, 80, 255, 624, 1295, 2400, 4095, ... 0, 27, 232, 1005, 3096, 7735, 16752, 32697, ... 0, 63, 728, 4095, 15624, 46655, 117648, 262143, ... 0, 120, 2160, 16320, 78000, 279720, 823200, 2096640, ...
Links
Crossrefs
Programs
-
Maple
with(numtheory): f1:= proc(n) option remember; unapply(k^(n-1)-add(f1(d)(k), d=divisors(n)minus{n}), k) end; T:= (n,k)-> f1(n)(k); seq(seq(T(n, 1+d-n), n=1..d), d=1..12);
-
Mathematica
t[n_, k_] := Sum[k^(d-1)*MoebiusMu[n/d], {d, Divisors[n]}]; Table[t[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Jan 21 2014, from first formula *)
Formula
A054718 Number of ternary sequences with primitive period n.
1, 3, 6, 24, 72, 240, 696, 2184, 6480, 19656, 58800, 177144, 530640, 1594320, 4780776, 14348640, 43040160, 129140160, 387400104, 1162261464, 3486725280, 10460350992, 31380882456, 94143178824, 282428998560, 847288609200, 2541864234000, 7625597465304
Offset: 0
Keywords
Comments
Equivalently, output sequences with primitive period n from a simple cycling shift register.
Links
- Seiichi Manyama, Table of n, a(n) for n = 0..2095 (terms 0..650 from Alois P. Heinz)
- E. N. Gilbert and J. Riordan, Symmetry types of periodic sequences, Illinois J. Math., 5 (1961), 657-665.
Programs
-
Maple
with(numtheory): a:= n-> `if`(n=0, 1, add(mobius(d)*3^(n/d), d=divisors(n))): seq(a(n), n=0..30); # Alois P. Heinz, Oct 21 2012
-
Mathematica
a[0] = 1; a[n_] := Sum[MoebiusMu[d]*3^(n/d), {d, Divisors[n]}]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Mar 11 2014, after Alois P. Heinz *)
-
PARI
a(n) = if(n==0,1,sumdiv(n,d, moebius(d) * 3^(n/d) )); \\ Joerg Arndt, Apr 14 2013
Formula
a(n) = Sum_{d|n} mu(d)*3^(n/d).
a(0) = 1, a(n) = n * A027376(n).
a(n) = 3 * A034741(n).
G.f.: 1 + 3 * Sum_{k>=1} mu(k) * x^k / (1 - 3*x^k). - Ilya Gutkovskiy, Apr 14 2021
A295505 a(n) = Sum_{d|n} mu(n/d)*4^(d-1).
1, 3, 15, 60, 255, 1005, 4095, 16320, 65520, 261885, 1048575, 4193220, 16777215, 67104765, 268435185, 1073725440, 4294967295, 17179802640, 68719476735, 274877644740, 1099511623665, 4398045462525, 17592186044415, 70368739967040, 281474976710400
Offset: 1
Keywords
Links
- Seiichi Manyama, Table of n, a(n) for n = 1..1661
Crossrefs
Programs
-
Mathematica
Table[Sum[MoebiusMu[n/d]4^(d-1),{d,Divisors[n]}],{n,30}] (* Harvey P. Dale, Nov 08 2020 *) nmax = 20; Rest[CoefficientList[Series[Sum[MoebiusMu[k] * x^k / (1 - 4*x^k), {k, 1, nmax}], {x, 0, nmax}], x]] (* Vaclav Kotesovec, Dec 11 2020 *)
-
PARI
{a(n) = sumdiv(n, d, moebius(n/d)*4^(d-1))}
Formula
a(n) = A054719(n)/4 for n > 0.
G.f.: Sum_{k>=1} mu(k)*x^k/(1 - 4*x^k). - Ilya Gutkovskiy, Oct 25 2018
A295506 a(n) = Sum_{d|n} mu(n/d)*5^(d-1).
1, 4, 24, 120, 624, 3096, 15624, 78000, 390600, 1952496, 9765624, 48824880, 244140624, 1220687496, 6103514976, 30517500000, 152587890624, 762939059400, 3814697265624, 19073484374880, 95367431624976, 476837148437496, 2384185791015624, 11920928906172000
Offset: 1
Keywords
Links
- Seiichi Manyama, Table of n, a(n) for n = 1..1431
Crossrefs
Programs
-
Mathematica
nmax = 20; Rest[CoefficientList[Series[Sum[MoebiusMu[k] * x^k / (1 - 5*x^k), {k, 1, nmax}], {x, 0, nmax}], x]] (* Vaclav Kotesovec, Dec 11 2020 *)
-
PARI
{a(n) = sumdiv(n, d, moebius(n/d)*5^(d-1))}
Formula
a(n) = A054720(n)/5 for n > 0.
G.f.: Sum_{k>=1} mu(k)*x^k/(1 - 5*x^k). - Ilya Gutkovskiy, Oct 25 2018
A320087 Number of primitive (=aperiodic) ternary words 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.
1, 3, 11, 35, 115, 347, 1075, 3235, 9787, 29387, 88435, 265315, 796755, 2390347, 7173227, 21519947, 64566667, 193700035, 581120523, 1743362283, 5230145947, 15690440099, 47071499707, 141214499227, 423644035627, 1270932113627, 3812797935395, 11438393826035
Offset: 1
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..2096
Programs
-
Maple
b:= n-> add(`if`(d=n, 3^(n-1), -b(d)), d=numtheory[divisors](n)): a:= proc(n) option remember; b(n)+`if`(n<2, 0, a(n-1)) end: seq(a(n), n=1..30);
-
Mathematica
nmax = 20; Rest[CoefficientList[Series[1/(1-x) * Sum[MoebiusMu[k] * x^k / (1 - 3*x^k), {k, 1, nmax}], {x, 0, nmax}], x]] (* Vaclav Kotesovec, Dec 11 2020 *)
-
PARI
a(n) = sum(j=1, n, sumdiv(j, d, 3^(d-1)*moebius(j/d))); \\ Michel Marcus, Dec 11 2020
Formula
a(n) = Sum_{j=1..n} Sum_{d|j} 3^(d-1) * mu(j/d).
a(n) = A143327(n,3).
a(n) = Sum_{j=1..n} A143325(j,3).
a(n) = A143326(n,3) / 3.
G.f.: (1/(1 - x)) * Sum_{k>=1} mu(k) * x^k / (1 - 3*x^k). - Ilya Gutkovskiy, Dec 11 2020
Comments