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!)
A037858 Sum{d(i)-d(i-1): d(i)>d(i-1), i=1,...,m}, where Sum{d(i)*8^i: i=0,1,...,m} is base 8 representation of n. 3

%I #11 Jan 19 2018 19:36:30

%S 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,

%T 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,

%U 1,1,1,1,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,3,2,1

%N Sum{d(i)-d(i-1): d(i)>d(i-1), i=1,...,m}, where Sum{d(i)*8^i: i=0,1,...,m} is base 8 representation of n.

%C This is the base-8 down-variation sequence; see A297330.

%H Clark Kimberling, <a href="/A037858/b037858.txt">Table of n, a(n) for n = 1..10000</a>

%p A037858 := proc(n)

%p a := 0 ;

%p dgs := convert(n,base,8);

%p for i from 2 to nops(dgs) do

%p if op(i,dgs)>op(i-1,dgs) then

%p a := a+op(i,dgs)-op(i-1,dgs) ;

%p end if;

%p end do:

%p a ;

%p end proc: # _R. J. Mathar_, Oct 19 2015

%t g[n_, b_] := Differences[IntegerDigits[n, b]]; b = 8; z = 120;

%t Table[-Total[Select[g[n, b], # < 0 &]], {n, 1, z}]; (*A037858*)

%t Table[Total[Select[g[n, b], # > 0 &]], {n, 1, z}]; (*A037849*)

%Y Cf. A297330.

%K nonn,base

%O 1,16

%A _Clark Kimberling_

%E Definition swapped with A037849. - _R. J. Mathar_, Oct 19 2015

%E Updated by _Clark Kimberling_, Jan 19 2018

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 16 14:51 EDT 2024. Contains 371749 sequences. (Running on oeis4.)