login
This site is supported by donations to The OEIS Foundation.

 

Logo

The OEIS Foundation is grateful to everyone who made a donation during our Annual Appeal.     Visit the new and spectacular Pictures from the OEIS page!

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

Table of n, a(n) for n=1..90.

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

Clark Kimberling

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 | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified February 6 06:27 EST 2016. Contains 268029 sequences.