This site is supported by donations to The OEIS Foundation.

Annual Appeal: Please make a donation (tax deductible in USA) to keep the OEIS running. Over 5000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A037876 (1/2)*Sum{|d(i)-e(i)|}, where Sum{d(i)*8^i} is base 8 representation of n and e(i) are digits d(i) in nonincreasing order, for i=0,1,...,m. 2
 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 3, 2, 1, 0, 0, 0, 0, 0, 4, 3, 2, 1, 0, 0, 0, 0, 5, 4, 3, 2, 1, 0, 0, 0, 6, 5, 4, 3, 2, 1, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 3, 2, 1 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,16 LINKS MAPLE A037876 := proc(n)     local a, dgs, dgsE ;     a := 0 ;     dgs := convert(n, base, 8);     dgsE := sort(dgs, `>`) ;     for i from 1 to nops(dgs) do         a := a+ abs(op(i, dgs)-op(i, dgsE)) ;     end do:     a/2 ; end proc: # R. J. Mathar, Oct 19 2015 CROSSREFS Sequence in context: A219481 A074079 A037858 * A263774 A161519 A068101 Adjacent sequences:  A037873 A037874 A037875 * A037877 A037878 A037879 KEYWORD nonn,base AUTHOR EXTENSIONS Definition swapped with A037885. - R. J. Mathar, Oct 19 2015 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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.