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!)
A044931 a(n) = so-se, where so(se)=sum of odd(even) base 9 run lengths of n. 4
1, 1, 1, 1, 1, 1, 1, 1, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, -1, 3, 3, 3, 3, 3, 3, 3, 3, -1, 3, -1, -1, -1, -1, -1, -1, -1, 3, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,9
LINKS
EXAMPLE
From Antti Karttunen, Dec 16 2017: (Start)
For n = 82 = 1*(9^2) + 0*(9^1) + 1*(9^0), thus written as "101" in base 9, there are three odd runs (each of length 1) and no even runs, so a(82) = 3*1 = 3.
For n = 7383, "11113" in base 9, there is an even run of length 4 and an odd run of length 1, thus a(7383) = 1-4 = -3.
(End)
MATHEMATICA
Array[Total[Length /@ #1] - Total[Length /@ Complement[#2, #1]] & @@ {Select[#, OddQ@ Length@ # &], #} &@ Split@ IntegerDigits[#, 9] &, 100] (* Michael De Vlieger, Dec 16 2017 *)
PROG
(PARI) A044931(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 += ((-1)^rl)*rl; prev_d = d; rl = 1)); -(s + ((-1)^rl)*rl); }; \\ Antti Karttunen, Dec 16 2017
CROSSREFS
Sequence in context: A231560 A113679 A262438 * A178487 A280560 A044932
KEYWORD
sign,base
AUTHOR
EXTENSIONS
More terms from Antti Karttunen, Dec 16 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 April 19 08:39 EDT 2024. Contains 371782 sequences. (Running on oeis4.)