A210826 G.f.: Sum_{n>=1} a(n)*x^n/(1 - x^n) = Sum_{n>=1} x^(n^3).
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, -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, 1, 1, -1, 0, -1, 1, 0, 1, 1, -1, -1, 0, 1, -1, -1, 0, -1, 1, 0, 0, 1
Offset: 1
Examples
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) + ... = x + x^8 + x^27 + x^64 + x^125 + x^216 + x^343 + ... + x^(n^3) + ...
Links
- Paul D. Hanna, Table of n, a(n) for n = 1..1035
Programs
-
Maple
Z := proc(n,k) local a,pf,e ; a := 1 ; for pf in ifactors(n)[2] do e := pf[2] ; if modp(e,k) = 0 then ; elif modp(e,k) = 1 then a := -a ; else a := 0 ; end if; end do; a; end proc: A210826 := proc(n) Z(n,3) ; end proc: # R. J. Mathar, May 28 2016
-
Mathematica
Mod[Table[DivisorSigma[0, n], {n, 1, 100}], 3, -1] (* Geoffrey Critzer, Mar 19 2015 *)
-
PARI
{a(n) = if( n==0, 0, kronecker( -3, numdiv(n)))}; /* Michael Somos, Mar 28 2012 */
-
PARI
{a(n)=[0,1,-1][numdiv(n)%3+1]} /* a(n) == d(n) (mod 3) */
-
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))}
-
PARI
/* Vectorized form (faster): */ {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])} {sum(n=1, #A, A[n]*x^n/(1-x^n+O(x^(#A))))} /* Verify Lambert series */
-
PARI
for(n=1, 100, print1(direuler(p=2, n, (1-X)/(1-X^3))[n], ", ")) \\ Vaclav Kotesovec, Jun 14 2020
-
Python
from math import prod from sympy import factorint def A210826(n): return prod((1,-1,0)[e%3] for e in factorint(n).values()) # Chai Wah Wu, Jun 18 2024
Formula
a(n) == d(n) (mod 3), where d(n) is the number of divisors of n;
a(n) = 0 iff the number of divisors of n is divisible by 3 (A059269),
a(n) = 1 iff d(n) == 1 (mod 3),
a(n) = -1 iff d(n) == 2 (mod 3).
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
Comments