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 A046211 #36 Apr 17 2022 20:32:05 %S A046211 1,1,3,6,16,39,104,270,729,1960,5368,14742,40880,113828,318864,896670, %T A046211 2532160,7174089,20390552,58112088,166037352,475467916,1364393896, %U A046211 3922625070,11297181456,32588003000,94143178827,272342710380,788854912240,2287679086056,6641649422408,19302293185470 %N A046211 Number of ternary Lyndon words whose digits sum to 1 (or 2) mod 3; number of trace 1 (or 2) monic irreducible polynomials over GF(3). %C A046211 Also number of ternary Lyndon words of trace 1 over GF(3). %C A046211 Also number of ternary Lyndon words of trace 2 over GF(3). %H A046211 G. C. Greubel, <a href="/A046211/b046211.txt">Table of n, a(n) for n = 1..2000</a> %H A046211 F. Ruskey, <a href="http://combos.org/TSlyndon">Number of q-ary Lyndon words with given trace mod q</a> %H A046211 F. Ruskey, <a href="http://combos.org/Tpoly">Number of monic irreducible polynomials over GF(q) with given trace</a> %H A046211 F. Ruskey, <a href="http://combos.org/TlyndonFk">Number of Lyndon words over GF(q) with given trace</a> %H A046211 <a href="/index/Lu#Lyndon">Index entries for sequences related to Lyndon words</a> %F A046211 a(n) = 1/(3*n) * Sum_{d divides n, gcd(d, 3)=1} mu(d) * 3^{n/d}. %F A046211 a(n) ~ 3^(n-1) / n. - _Vaclav Kotesovec_, Apr 18 2016 %e A046211 a(4)= 6 = |{ 0001, 0022, 0112, 0121, 0211, 1222 }|. %t A046211 a[n_] := 1/(3n) DivisorSum[n, If[GCD[#, 3] == 1, MoebiusMu[#]*3^(n/#), 0] &]; Array[a, 32] (* _Jean-François Alcover_, Dec 07 2015 *) %o A046211 (PARI) a(n) = 1/(3*n) * sumdiv(n, d, if(gcd(d, 3)==1, moebius(d)*3^(n/d), 0 ) ); /* _Joerg Arndt_, Aug 17 2012 */ %Y A046211 Cf. A008683 (mu), A046209. %K A046211 nonn %O A046211 1,3 %A A046211 _Frank Ruskey_, Dec 13 1999