OFFSET
0,3
REFERENCES
J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 98.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
J. Coquet, A summation formula related to the binary digits, Invent. Math. 73 (1983) 107-115.
P. Flajolet et al., Mellin Transforms And Asymptotics: Digital Sums, Theoret. Computer Sci. 23 (1994), 291-314.
P. J. Grabner and H.-K. Hwang, Digital sums and divide-and-conquer recurrences: Fourier expansions and absolute convergence, Constructive Approximation, Jan. 2005, Volume 21, Issue 2, pp 149-179.
Roswitha Hofer, Coquet-type formulas for the rarefied weighted Thue-Morse sequence Discrete Mathematics 311.16 (2011): 1724-1734.
D. J. Newman, On the number of binary digits in a multiple of three, Proc. Amer. Math. Soc., 21 (1969), 719-721.
Simon Plouffe, Approximations de séries génératrices et quelques conjectures, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009.
Simon Plouffe, 1031 Generating Functions, Appendix to Thesis, Montreal, 1992
M. R. Schroeder & N. J. A. Sloane, Correspondence, 1991
FORMULA
a(n) = Sum( (-1)^wt(3*k),k=0..n-1). See Allouche-Shallit for asymptotics. - From N. J. A. Sloane, Jul 22 2012
The generating function -(2*z^4+z^3+z+1)*(z^3-z^2-1)/(z^6+z^5+z^4+z^3+z^2+z+1)/(z-1)^2 proposed in the Plouffe thesis is wrong.
MAPLE
A000120 := proc(n) local w, m, i; w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end: wt := A000120;
f:=n->add( (-1)^wt(3*k), k=0..n-1);
[seq(f(n), n=0..50)]; # N. J. A. Sloane, Jul 22 2012
A005599 := proc(n)
add( A106400(3*i), i=0..n-1) ;
end proc: # R. J. Mathar, Jul 22 2012
MATHEMATICA
wt[n_] := DigitCount[n, 2, 1]; a[n_] := Sum[(-1)^wt[3*k], {k, 0, n-1}]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Feb 03 2014, after N. J. A. Sloane *)
PROG
(Haskell)
a005599 n = a005599_list !! n
a005599_list = scanl (+) 0 $ f a106400_list
where f (x:_:_:xs) = x : f xs
-- Reinhard Zumkeller, May 26 2013
(PARI) a(n) = sum(k=0, n-1, (-1)^hammingweight(3*k)); \\ Michel Marcus, Jul 03 2017
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
M. R. Schroeder
STATUS
approved