OFFSET
1,9
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..66430
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
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
More terms from Antti Karttunen, Dec 22 2017
STATUS
approved