The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A285779 Parity index: number of integers z with 1 <= z <= n for which A010060(z) = A010060(n), negated if A010060(n) = 1. 1
 0, -1, -2, 1, -3, 2, 3, -4, -5, 4, 5, -6, 6, -7, -8, 7, -9, 8, 9, -10, 10, -11, -12, 11, 12, -13, -14, 13, -15, 14, 15, -16, -17, 16, 17, -18, 18, -19, -20, 19, 20, -21, -22, 21, -23, 22, 23, -24, 24, -25, -26, 25, -27, 26, 27, -28, -29, 28, 29, -30, 30, -31, -32, 31, -33, 32, 33, -34, 34, -35, -36, 35, 36 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 COMMENTS Signs are given by A010059 or A010060, the Thue-Morse sequence. Here, zero has positive sign. Like A130472, this sequence maps the natural numbers to the integers. Positive terms are one less than the corresponding term in A008619. This was a test problem for seqr, a genetic programming integer sequence recognizer, which discovered a method for generating terms of the sequence given the bits of n in descending order. Iterating over the bits of n in ascending order yields a sequence with more irregular behavior, differing in absolute value by up to 2: 0, -1, -2, 0, -3, +3, +3, +2, -5, 5, 5, ... Consecutive terms of A285779 usually differ in absolute value by 1 or 2, but consecutive terms differing only in sign occur irregularly. This happens first for a(11) = -6 and a(12) = +6. LINKS G. C. Greubel, Table of n, a(n) for n = 0..10000 MATHEMATICA Function[s, Table[(2 Boole[# == 0] - 1) Count[Take[s, n], z_ /; z == #] &@ s[[n]], {n, 0, Length@ s}]]@ Array[ThueMorse, 72] (* Michael De Vlieger, May 10 2017, Version 10.2 *) PROG (PARI) a(n) = {my(v = 1); forstep(b = length(binary(n)) - 1, 0, -1, if(bittest(n, b), v = bitxor(-v, 2^b)); ); v = bitnegimply(v, 1); return(v / 2)} CROSSREFS Cf. A010059, A010060, A130472, A008619 Sequence in context: A196191 A137661 A289152 * A319320 A305194 A303362 Adjacent sequences:  A285776 A285777 A285778 * A285780 A285781 A285782 KEYWORD sign,easy AUTHOR Reikku Kulon, Apr 25 2017 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified April 18 12:45 EDT 2021. Contains 343088 sequences. (Running on oeis4.)