login
Positive integers having distinct base-7 run lengths.
17

%I #13 Jan 04 2021 18:18:59

%S 1,2,3,4,5,6,8,16,24,32,40,48,49,56,57,58,59,60,61,62,65,73,81,89,97,

%T 98,106,112,113,114,115,116,117,118,122,130,138,146,147,155,163,168,

%U 169,170,171,172,173,174,179,187,195,196,204,212,220,224,225,226,227,228

%N Positive integers having distinct base-7 run lengths.

%H David A. Corneth, <a href="/A044818/b044818.txt">Table of n, a(n) for n = 1..10000</a>

%e 40=55_7 has a single run length of 2 and is in the sequence. 211=421_7 has three runs of length 1 as is not in the sequence. - _R. J. Mathar_, Jan 18 2018

%p rlset := proc(L::list)

%p local lset,rl,i ;

%p lset := [] ;

%p rl := 1 ;

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

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

%p rl := rl+1 ;

%p else

%p lset := [op(lset),rl] ;

%p rl := 1;

%p end if;

%p end do:

%p lset := [op(lset),rl] ;

%p end proc:

%p isA044818 := proc(n)

%p local dgs,rl;

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

%p rl := rlset(dgs) ;

%p if nops(rl) = nops( convert(rl,set)) then

%p true;

%p else

%p false;

%p end if;

%p end proc:

%p for n from 1 to 400 do

%p if isA044818(n) then

%p printf("%d,",n) ;

%p end if;

%p end do: # _R. J. Mathar_, Jan 18 2018

%Y Cf. A044813, A044814, A044815, A044816, A044817, A044818, A044819, A044820, A044821, A044822, A044823, A044824, A044825, A044826, A044827 (base 2 to base 16).

%K nonn,base

%O 1,2

%A _Clark Kimberling_