login
Expansion of Sum_{k>=0} x^2^k/(1+x^2^k+x^2^(k+1)).
9

%I #36 May 28 2024 22:13:20

%S 0,1,0,0,1,-1,0,1,0,0,0,-1,0,1,0,0,1,-1,0,1,-1,0,0,-1,0,1,0,0,1,-1,0,

%T 1,0,0,0,-1,0,1,0,0,0,-1,0,1,-1,0,0,-1,0,1,0,0,1,-1,0,1,0,0,0,-1,0,1,

%U 0,0,1,-1,0,1,-1,0,0,-1,0,1,0,0,1,-1,0,1,-1,0,0,-1,0,1,0,0,0,-1,0,1,-1,0,0,-1,0,1,0,0,1,-1,0,1,0

%N Expansion of Sum_{k>=0} x^2^k/(1+x^2^k+x^2^(k+1)).

%C Chances of values -1/0/+1 are ~ 2:5:2.

%H Antti Karttunen, <a href="/A084091/b084091.txt">Table of n, a(n) for n = 0..100000</a>

%F a(2n) = a(n) + 1 - (n+1 mod 3), a(2n+1) = 1 - (n mod 3). - _Ralf Stephan_, Sep 27 2003

%F a(n) is multiplicative with a(2^e) = (1 + (-1)^e)/2, a(3^e) = 0^e, a(p^e) = 1 if p == 1 (mod 6), a(p^e) = (-1)^e if p == 5 (mod 6). - _Michael Somos_, Jul 18 2004

%F G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^4)) where f(u, v, w) = u^2 - v^2 + 2*w*(v-u) + w-v. - _Michael Somos_, Jul 18 2004

%F G.f.: Sum_{k>=0} f(x^2^k) where f(x) := x * (1 - x) / (1 - x^3). - _Michael Somos_, Jul 18 2004

%F max(Sum_{k=0..n} a(k)) = floor(log_4(n))+1. Proof by Nikolaus Meyberg.

%F Dirichlet g.f. (conjectured): L(chi_2(3),s)/(1-2^(-s)), with chi_2(3) the nontrivial Dirichlet character modulo 3. - _Ralf Stephan_, Mar 27 2015

%F a(2*n + 1) = A057078(n). a(3*n) = 0. a(3*n + 1) = A098725(n+1). - _Michael Somos_, Jun 16 2015

%e G.f. = x + x^4 - x^5 + x^7 - x^11 + x^13 + x^16 - x^17 + x^19 - x^20 - x^23 + ...

%t a[ n_] := If[n < 1, 0, With[ {f = #/(1 + # + #^2) &}, SeriesCoefficient[ Sum[ f[x^2^k], {k, 0, Log[2, n]}], {x, 0, n}]]]; (* _Michael Somos_, Jun 16 2015 *)

%t f[p_, e_] := If[Mod[p, 6] == 1, 1, (-1)^e]; f[2, e_] := (1 + (-1)^e)/2; f[3, e_] := 0; a[n_] := Times @@ f @@@ FactorInteger[n]; a[0] = 0; a[1] = 1; Array[a, 100, 0] (* _Amiram Eldar_, Sep 04 2023 *)

%o (PARI) {a(n) = my(A, m); if( n<1, 0, A = O(x); m=1; while( m<=n, m*=2; A = x / (1 + x + x^2) + subst(A, x, x^2)); polcoeff(A, n))}; /* _Michael Somos_, Jul 18 2004 */

%o (PARI) {a(n) = my(A, p, e); if( n<1, 0, A = factor(n); prod(k=1, matsize(A)[1], [p, e] = A[k,]; if( p==2, !(e%2), p==3, 0, kronecker( -12, p)^e)))}; /* _Michael Somos_, Jun 16 2015 */

%o (PARI) {a(n) = if( n<1, 0, direuler( p=1, n, if( p==2, 1 / (1 - X^2), p==3, 1, 1 / (1 - kronecker( -12, p) * X)))[n])}; /* _Michael Somos_, Jun 16 2015 */

%o (PARI) A084091(n) = if(!n, n, my(f = factor(n)); prod(k=1, #f~, if(2==f[k, 1], !(f[k, 2]%2), if(2==(f[k, 1]%3), (-1)^f[k, 2], f[k, 1]%3)))); \\ _Antti Karttunen_, May 28 2024

%Y Cf. A002487.

%Y Positions of 0 are in A084090, of 1 in A084089, of -1 in A084088, of a(n)!=0 in A084087.

%Y Cf. A057078, A098725.

%Y Cf. A373155 (from term a(1) onward absolute values, also parity of terms).

%K sign,easy,mult

%O 0,1

%A _Ralf Stephan_, May 11 2003