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
A339684 a(n) = Sum_{d|n} 4^(d-1).
1, 5, 17, 69, 257, 1045, 4097, 16453, 65553, 262405, 1048577, 4195413, 16777217, 67112965, 268435729, 1073758277, 4294967297, 17179935765, 68719476737, 274878169413, 1099511631889, 4398047559685, 17592186044417, 70368748389461, 281474976710913
Offset: 1
Keywords
Links
- Seiichi Manyama, Table of n, a(n) for n = 1..1000
Crossrefs
Programs
-
Magma
A339684:= func< n | (&+[4^(d-1): d in Divisors(n)]) >; [A339684(n): n in [1..40]]; // G. C. Greubel, Jun 25 2024
-
Mathematica
Table[Sum[4^(d - 1), {d, Divisors[n]}], {n, 1, 25}] nmax = 25; CoefficientList[Series[Sum[x^k/(1 - 4 x^k), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
-
PARI
a(n) = sumdiv(n, d, 4^(d-1)); \\ Michel Marcus, Dec 13 2020
-
SageMath
def A339684(n): return sum(4^(k-1) for k in (1..n) if (k).divides(n)) [A339684(n) for n in range(1,41)] # G. C. Greubel, Jun 25 2024
Formula
G.f.: Sum_{k>=1} x^k / (1 - 4*x^k).
G.f.: Sum_{k>=1} 4^(k-1) * x^k / (1 - x^k).
a(n) ~ 4^(n-1). - Vaclav Kotesovec, Jun 05 2021
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
A320088 Number of primitive (=aperiodic) 4-ary 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, 4, 19, 79, 334, 1339, 5434, 21754, 87274, 349159, 1397734, 5590954, 22368169, 89472934, 357908119, 1431633559, 5726600854, 22906403494, 91625880229, 366503524969, 1466015148634, 5864060611159, 23456246655574, 93824986622614, 375299963333014, 1501199853398419
Offset: 1
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..1661
Programs
-
Maple
b:= n-> add(`if`(d=n, 4^(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 - 4*x^k), {k, 1, nmax}], {x, 0, nmax}], x]] (* Vaclav Kotesovec, Dec 11 2020 *)
-
PARI
a(n) = sum(j=1, n, sumdiv(j, d, 4^(d-1)*moebius(j/d))); \\ Michel Marcus, Dec 11 2020
Formula
a(n) = Sum_{j=1..n} Sum_{d|j} 4^(d-1) * mu(j/d).
a(n) = A143327(n,4).
a(n) = Sum_{j=1..n} A143325(j,4).
a(n) = A143326(n,4) / 4.
G.f.: (1/(1 - x)) * Sum_{k>=1} mu(k) * x^k / (1 - 4*x^k). - Ilya Gutkovskiy, Dec 11 2020
Comments