login
Numbers n such that string 4,0 occurs in the base 8 representation of n but not of n-1.
0

%I #9 Sep 13 2018 11:47:35

%S 32,96,160,224,256,288,352,416,480,544,608,672,736,768,800,864,928,

%T 992,1056,1120,1184,1248,1280,1312,1376,1440,1504,1568,1632,1696,1760,

%U 1792,1824,1888,1952,2016,2048,2144,2208,2272,2304

%N Numbers n such that string 4,0 occurs in the base 8 representation of n but not of n-1.

%p # return true if s is a sublist of L

%p subL := proc(L::list,s::list)

%p local ldiff,ls,i;

%p ls := nops(s) ;

%p ldiff := nops(L)-ls ;

%p for i from 1 to ldiff+1 do

%p if L[i..i+ls-1] = s then

%p return true;

%p end if;

%p end do:

%p false;

%p end proc:

%p has40 := proc(n)

%p option remember;

%p subL(convert(n,base,8),[0,4]) ;

%p end proc:

%p isA044219 := proc(n)

%p has40(n) and not has40(n-1) ;

%p end proc:

%p for n from 1 to 4000 do

%p if isA044219(n) then printf("%d,",n) ; end if;

%p end do: # _R. J. Mathar_, May 28 2016

%t SequencePosition[Table[If[SequenceCount[IntegerDigits[n,8],{4,0}]>0,1,0],{n,2400}],{0,1}][[All,2]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Sep 13 2018 *)

%Y Cf. A044600.

%K nonn,base

%O 1,1

%A _Clark Kimberling_