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 A210826 #69 Jun 18 2024 14:09:26 %S A210826 1,-1,-1,0,-1,1,-1,1,0,1,-1,0,-1,1,1,-1,-1,0,-1,0,1,1,-1,-1,0,1,1,0, %T A210826 -1,-1,-1,0,1,1,1,0,-1,1,1,-1,-1,-1,-1,0,0,1,-1,1,0,0,1,0,-1,-1,1,-1, %U A210826 1,1,-1,0,-1,1,0,1,1,-1,-1,0,1,-1,-1,0,-1,1,0,0,1 %N A210826 G.f.: Sum_{n>=1} a(n)*x^n/(1 - x^n) = Sum_{n>=1} x^(n^3). %C A210826 Compare to Liouville's function lambda (A008836) which satisfies the Lambert series identity: Sum_{n>=1} lambda(n)*x^n/(1-x^n) = Sum_{n>=1} x^(n^2). %C A210826 This is a multiplicative sequence with Dirichlet g.f. zeta(3s)/zeta(s) and inverse Mobius transform in A010057. - _R. J. Mathar_, Mar 31 2012 %H A210826 Paul D. Hanna, <a href="/A210826/b210826.txt">Table of n, a(n) for n = 1..1035</a> %F A210826 a(n) == d(n) (mod 3), where d(n) is the number of divisors of n; %F A210826 a(n) = 0 iff the number of divisors of n is divisible by 3 (A059269), %F A210826 a(n) = 1 iff d(n) == 1 (mod 3), %F A210826 a(n) = -1 iff d(n) == 2 (mod 3). %F A210826 Multiplicative with a(p^e) = -1 + ((e+2) mod 3). Thus the Dirichlet g.f. is indeed zeta(3s)/zeta(s). Also sumdiv(n,d,a(d))=1 iff n is a cube, else sumdiv(n,d,a(d))=0 hence Sum_{k=1..n} a(k)*floor(n/k) = floor(n^(1/3)). - _Benoit Cloitre_, Oct 28 2012 %e A210826 G.f.: x/(1-x) - x^2/(1-x^2) - x^3/(1-x^3) - x^5/(1-x^5) + x^6/(1-x^6) - x^7/(1-x^7) + x^8/(1-x^8) + x^10/(1-x^10) - x^11/(1-x^11) + ... + a(n)*x^n/(1-x^n) + ... %e A210826 = x + x^8 + x^27 + x^64 + x^125 + x^216 + x^343 + ... + x^(n^3) + ... %p A210826 Z := proc(n,k) %p A210826 local a,pf,e ; %p A210826 a := 1 ; %p A210826 for pf in ifactors(n)[2] do %p A210826 e := pf[2] ; %p A210826 if modp(e,k) = 0 then %p A210826 ; %p A210826 elif modp(e,k) = 1 then %p A210826 a := -a ; %p A210826 else %p A210826 a := 0 ; %p A210826 end if; %p A210826 end do; %p A210826 a; %p A210826 end proc: %p A210826 A210826 := proc(n) %p A210826 Z(n,3) ; %p A210826 end proc: # _R. J. Mathar_, May 28 2016 %t A210826 Mod[Table[DivisorSigma[0, n], {n, 1, 100}], 3, -1] (* _Geoffrey Critzer_, Mar 19 2015 *) %o A210826 (PARI) {a(n) = if( n==0, 0, kronecker( -3, numdiv(n)))}; /* _Michael Somos_, Mar 28 2012 */ %o A210826 (PARI) {a(n)=[0,1,-1][numdiv(n)%3+1]} /* a(n) == d(n) (mod 3) */ %o A210826 (PARI) {a(n)=local(CUBES=sum(k=1, floor(n^(1/3)), x^(k^3))); if(n==1, 1, polcoeff(CUBES-sum(m=1, n-1, a(m)*x^m/(1-x^m+x*O(x^n))), n))} %o A210826 (PARI) /* Vectorized form (faster): */ %o A210826 {A=[1]; for(i=1, 256, print1(A[#A], ", "); A=concat(A, 0); A[#A]=polcoeff(sum(k=1, ceil((#A)^(1/3)), x^(k^3)) - sum(m=1, #A-1, A[m]*x^m/(1-x^m+x*O(x^#A))), #A)); print1(A[#A])} %o A210826 {sum(n=1, #A, A[n]*x^n/(1-x^n+O(x^(#A))))} /* Verify Lambert series */ %o A210826 (PARI) for(n=1, 100, print1(direuler(p=2, n, (1-X)/(1-X^3))[n], ", ")) \\ _Vaclav Kotesovec_, Jun 14 2020 %o A210826 (Python) %o A210826 from math import prod %o A210826 from sympy import factorint %o A210826 def A210826(n): return prod((1,-1,0)[e%3] for e in factorint(n).values()) # _Chai Wah Wu_, Jun 18 2024 %Y A210826 Cf. A008836, A010057, A059269, A212793 (Dirichlet inverse), A219009. %K A210826 sign,mult %O A210826 1,1 %A A210826 _Paul D. Hanna_, Mar 27 2012