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.
%I A320087 #13 Dec 11 2020 05:58:35 %S A320087 1,3,11,35,115,347,1075,3235,9787,29387,88435,265315,796755,2390347, %T A320087 7173227,21519947,64566667,193700035,581120523,1743362283,5230145947, %U A320087 15690440099,47071499707,141214499227,423644035627,1270932113627,3812797935395,11438393826035 %N 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. %H A320087 Alois P. Heinz, <a href="/A320087/b320087.txt">Table of n, a(n) for n = 1..2096</a> %F A320087 a(n) = Sum_{j=1..n} Sum_{d|j} 3^(d-1) * mu(j/d). %F A320087 a(n) = A143327(n,3). %F A320087 a(n) = Sum_{j=1..n} A143325(j,3). %F A320087 a(n) = A143326(n,3) / 3. %F A320087 G.f.: (1/(1 - x)) * Sum_{k>=1} mu(k) * x^k / (1 - 3*x^k). - _Ilya Gutkovskiy_, Dec 11 2020 %p A320087 b:= n-> add(`if`(d=n, 3^(n-1), -b(d)), d=numtheory[divisors](n)): %p A320087 a:= proc(n) option remember; b(n)+`if`(n<2, 0, a(n-1)) end: %p A320087 seq(a(n), n=1..30); %t A320087 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 *) %o A320087 (PARI) a(n) = sum(j=1, n, sumdiv(j, d, 3^(d-1)*moebius(j/d))); \\ _Michel Marcus_, Dec 11 2020 %Y A320087 Column k=3 of A143327. %Y A320087 Partial sums of A034741. %Y A320087 Cf. A008683, A143325, A143326. %K A320087 nonn %O A320087 1,2 %A A320087 _Alois P. Heinz_, Oct 05 2018