login
A269735
G.f.: Sum_{k >= 0} x^(2^k)*(1-x^(2^k))/(1+x^(2^k)).
4
0, 1, -1, 2, -3, 2, 0, 2, -5, 2, 0, 2, -2, 2, 0, 2, -7, 2, 0, 2, -2, 2, 0, 2, -4, 2, 0, 2, -2, 2, 0, 2, -9, 2, 0, 2, -2, 2, 0, 2, -4, 2, 0, 2, -2, 2, 0, 2, -6, 2, 0, 2, -2, 2, 0, 2, -4, 2, 0, 2, -2, 2, 0, 2, -11, 2, 0, 2, -2, 2, 0, 2, -4, 2, 0, 2, -2, 2, 0, 2, -6, 2, 0, 2, -2, 2, 0, 2, -4, 2, 0, 2, -2
OFFSET
0,4
COMMENTS
Second differences of A268289.
LINKS
MAPLE
t7:=add(x^(2^k)*(1-x^(2^k))/(1+x^(2^k)), k=0..12);
t8:=series(t7, x, 256);
# second Maple program:
b:= proc(n) option remember; `if`(n<0, 0,
add(2*i-1, i=Bits[Split](n)))
end:
a:= n-> b(n)-b(n-1):
seq(a(n), n=0..92); # Alois P. Heinz, Jan 18 2022
MATHEMATICA
Join[{0, 0}, Table[DigitCount[n, 2, 1] - DigitCount[n, 2, 0], {n, 1, 100}]] // Differences (* Jean-François Alcover, Jun 27 2022 *)
PROG
(PARI)
up_to = 1024;
A268289list(up_to) = { my(v=vector(up_to), s = 1); v[1] = s; for(n=2, up_to, s += (2*hammingweight(n) - #binary(n)); v[n] = s); (v); };
v268289 = A268289list(up_to+1);
A268289(n) = if(!n, n, v268289[n]);
almost_firstdiffs_of_A268289(n) = if(!n, 1, v268289[n+1]-v268289[n]);
A269735(n) = if(n<=1, n, almost_firstdiffs_of_A268289(n-1)-almost_firstdiffs_of_A268289(n-2)); \\ Antti Karttunen, Sep 30 2018
(PARI)
up_to_k = 16;
up_to = 1+(2^up_to_k);
x='x+O('x^(up_to+1));
v269735 = Vec(sum(k=0, up_to_k, x^(2^k)*(1-x^(2^k))/(1+x^(2^k))));
A269735(n) = if(!n, n, v269735[n]); \\ Antti Karttunen, Oct 01 2018
CROSSREFS
Sequence in context: A226556 A007325 A247920 * A187038 A332260 A056619
KEYWORD
sign
AUTHOR
N. J. A. Sloane, Mar 11 2016
STATUS
approved