login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A026147 a(n) = position of n-th 1 in A001285 or A010059 (Thue-Morse sequence). 10
1, 4, 6, 7, 10, 11, 13, 16, 18, 19, 21, 24, 25, 28, 30, 31, 34, 35, 37, 40, 41, 44, 46, 47, 49, 52, 54, 55, 58, 59, 61, 64, 66, 67, 69, 72, 73, 76, 78, 79, 81, 84, 86, 87, 90, 91, 93, 96, 97, 100, 102, 103, 106, 107, 109, 112, 114, 115, 117, 120, 121, 124, 126, 127, 130 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Barbeau notes that if we let A = the first 2^k terms of this sequence and B = the first 2^k terms of A181155, then the two sets A and B have the same sum of powers for first up to the k-th power. I note it holds for 0th power also. - Michael Somos, Jun 09 2013
REFERENCES
Edward J. Barbeau, Power Play, MAA, 1997. See p. 104.
LINKS
FORMULA
a(n) = 1+A001969(n).
a(n) = Sum_{k=0..2n} mod(-2 + Sum_{j=0..k} floor(C(k, j)/2)}, 3). - Paul Barry, Dec 24 2004
a(n) + A010059(n+1) = 2n + 2 for n >= 0. - Clark Kimberling, Oct 06 2014
EXAMPLE
Let k=2. Then A = {1,4,6,7} and B = {2,3,5,8} have the property that 1^0+4^0+6^0+7^0 = 2^0+3^0+5^0+8^0 = 4, 1^1+4^1+6^1+7^1 = 2^1+3^1+5^1+8^1 = 18, and 1^2+4^2+6^2+7^2 = 2^2+3^2+5^2+8^2 = 102. - Michael Somos, Jun 09 2013
MATHEMATICA
a[ n_] := If[ n < 1, 0, 2 n + Mod[ Total[ IntegerDigits[ n - 1, 2]], 2] - 1] (* Michael Somos, Jun 09 2013 *)
PROG
(PARI) a(n)=2*n+hammingweight(n-1)%2-1 \\ Charles R Greathouse IV, Mar 22 2013
(PARI) {a(n) = if( n<1, 0, 2*n + subst( Pol( binary( n-1)), x, 1)%2 - 1)} /* Michael Somos, Jun 09 2013 */
(Python)
def A026147(n): return 1+((m:=n-1).bit_count()&1)+(m<<1) # Chai Wah Wu, Mar 03 2023
CROSSREFS
Sequence in context: A286491 A133483 A153082 * A032785 A096887 A340161
KEYWORD
nonn,easy
AUTHOR
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 12:14 EDT 2024. Contains 371792 sequences. (Running on oeis4.)