login
A044219
Numbers n such that string 4,0 occurs in the base 8 representation of n but not of n-1.
0
32, 96, 160, 224, 256, 288, 352, 416, 480, 544, 608, 672, 736, 768, 800, 864, 928, 992, 1056, 1120, 1184, 1248, 1280, 1312, 1376, 1440, 1504, 1568, 1632, 1696, 1760, 1792, 1824, 1888, 1952, 2016, 2048, 2144, 2208, 2272, 2304
OFFSET
1,1
MAPLE
# return true if s is a sublist of L
subL := proc(L::list, s::list)
local ldiff, ls, i;
ls := nops(s) ;
ldiff := nops(L)-ls ;
for i from 1 to ldiff+1 do
if L[i..i+ls-1] = s then
return true;
end if;
end do:
false;
end proc:
has40 := proc(n)
option remember;
subL(convert(n, base, 8), [0, 4]) ;
end proc:
isA044219 := proc(n)
has40(n) and not has40(n-1) ;
end proc:
for n from 1 to 4000 do
if isA044219(n) then printf("%d, ", n) ; end if;
end do: # R. J. Mathar, May 28 2016
MATHEMATICA
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 *)
CROSSREFS
Cf. A044600.
Sequence in context: A195088 A050429 A362841 * A044600 A189884 A175165
KEYWORD
nonn,base
STATUS
approved