login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A005599
Running sum of every third term in the {+1,-1}-version of Thue-Morse sequence A010060.
(Formerly M0468)
5
0, 1, 2, 3, 4, 5, 6, 7, 6, 7, 8, 9, 10, 11, 12, 11, 12, 13, 14, 15, 16, 17, 18, 19, 18, 19, 20, 21, 20, 19, 18, 19, 18, 19, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29, 30, 29, 30, 31, 32, 33, 34, 35, 36, 35, 36, 35, 34, 33, 34, 35, 36, 35, 36, 37, 38, 39, 40, 41, 42, 43, 42, 43, 44, 45, 46, 47, 48, 47, 48, 49, 50
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
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
See A000120 for "wt" (the binary weight of n).
Sequence in context: A161209 A279513 A000026 * A071934 A337642 A373227
KEYWORD
nonn,easy,nice
AUTHOR
M. R. Schroeder
STATUS
approved