login
Number of i such that d(i) <= d(i-1), where Sum_{i=0..m} d(i)*6^i is the base-6 representation of n.
9

%I #30 Nov 19 2025 09:58:22

%S 0,0,0,0,0,0,1,1,1,1,1,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,0,0,0,0,0,

%T 1,1,1,1,1,1,1,1,2,2,2,2,2,1,1,2,2,2,2,1,1,1,2,2,2,1,1,1,1,2,2,1,1,1,

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

%N Number of i such that d(i) <= d(i-1), where Sum_{i=0..m} d(i)*6^i is the base-6 representation of n.

%C Equivalently, number of nonnegative terms in the first differences of the digits of the base-6 representation of n. - _Paolo Xausa_, Nov 18 2025

%H Chris R. Rehmann, <a href="/A037813/b037813.txt">Table of n, a(n) for n = 1..10000</a>

%p A037813 := proc(n)

%p a := 0 ;

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

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

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

%p a := a+1 ;

%p end if;

%p end do:

%p a ;

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

%t A037813[n_] := Count[Differences[IntegerDigits[n, 6]], _?NonNegative];

%t Array[A037813, 100] (* _Paolo Xausa_, Nov 18 2025 *)

%o (MATLAB) n = 1:10000; a = arrayfun(@(m) sum(diff(dec2base(m,6)-'0')>=0),n); % _Chris R. Rehmann_, Nov 17 2025

%Y Cf. A007092, A037828.

%Y Cf. A037809, A037810, A037811, A037812, A037814, A037815, A037816, A037817.

%K nonn,base,easy

%O 1,43

%A _Clark Kimberling_

%E Sign in Name corrected by _R. J. Mathar_, Oct 16 2015