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!)
A044949 Number of runs of odd length in the base-9 representation of n. 2
1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 3, 3, 3, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,9
LINKS
FORMULA
As 731 = 1*(9^3) + 0*(9^2) + 0*(9^1) + 2*(9^0), it is written in base 9 (A007095) as "1002". There is one run of even length, and two runs of length 1 (thus of odd length), thus a(731) = 2. - Antti Karttunen, Dec 22 2017
MATHEMATICA
Array[Count[Map[Length, Split@ IntegerDigits[#, 9]], _?OddQ] &, 105] (* Michael De Vlieger, Dec 22 2017 *)
PROG
(PARI) A044949(n) = { my(rl=0, d, prev_d = -1, s=0); while(n>0, d = (n%9); n = ((n-d)/9); if(d==prev_d, rl++, s += (rl%2); prev_d = d; rl = 1)); (s + (rl%2)); }; \\ Antti Karttunen, Dec 22 2017
CROSSREFS
Sequence in context: A044946 A044947 A044948 * A044950 A161872 A278248
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
More terms from Antti Karttunen, Dec 22 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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 12 12:28 EDT 2024. Contains 375092 sequences. (Running on oeis4.)