OFFSET
1,7
MAPLE
A037866 := proc(n)
a := 0 ;
dgs := convert(n, base, 7);
for i from 1 to nops(dgs) do
if op(i, dgs)<=3 then
a := a+1 ;
else
a := a-1 ;
end if;
end do:
a ;
end proc:
seq(A037866(n), n=1..40) ; # R. J. Mathar, Jan 27 2025
MATHEMATICA
d37[n_]:=Module[{d=IntegerDigits[n, 7]}, Count[d, _?(#<4&)]-Count[d, _?(#>3&)]]; Array[d37, 90, 0] (* Harvey P. Dale, Jun 28 2022 *)
CROSSREFS
KEYWORD
base,sign
AUTHOR
STATUS
approved
