%I M2435 #30 Mar 09 2023 08:04:53
%S 0,0,1,3,5,8,11,14,18,22,26,30,34,38,43,48,53,58,63,68,73,78,83,89,95,
%T 101,107,113,119,125,131,137,143,149,155,161,167,173,179,185,191,198,
%U 205,212,219,226,233,240,247,254,261,268,275,282,289,296
%N Number of low discrepancy sequences in base 2.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Harald Niederreiter, <a href="http://dx.doi.org/10.1016/0022-314X(88)90025-X">Low-discrepancy and low-dispersion sequences</a>, J. Number Theory 30 (1988), no. 1, 51-70.
%p N := proc(b,n)
%p option remember;
%p local d;
%p add(b^d*numtheory[mobius](n/d),d=numtheory[divisors](n)) ;
%p %/n ;
%p end proc:
%p M := proc(b,n)
%p local h;
%p if n = 0 then
%p 0;
%p else
%p add(N(b,h),h=1..n) ;
%p end if;
%p end proc:
%p nMax := proc(b,s)
%p local n;
%p for n from 0 do
%p if M(b,n) > s then
%p return n-1 ;
%p end if;
%p end do:
%p end proc:
%p A005356 := proc(s)
%p local n,b;
%p b := 2 ;
%p n := nMax(b,s) ;
%p n*(s-M(b,n))+add( (h-1)*N(b,h),h=1..n) ;
%p end proc:
%p seq(A005356(n),n=1..40) ; # _R. J. Mathar_, Jun 09 2016
%t Np[b_, n_] := Np[b, n] = Sum[b^d*MoebiusMu[n/d], {d, Divisors[n]}]/n;
%t M[b_, n_] := If[n == 0, 0, Sum[Np[b, h], {h, 1, n}]];
%t nMax[b_, s_] := Module[{n}, For[n = 0, True, n++, If[M[b, n] > s, Return[n - 1]]]];
%t a[s_] := Module[{n, b}, b = 2; n = nMax[b, s]; n*(s - M[b, n]) + Sum[(h - 1)*Np[b, h], {h, 1, n}]];
%t Table[a[n], {n, 1, 60}] (* _Jean-François Alcover_, Mar 09 2023, after _R. J. Mathar_ *)
%Y Cf. A005357 (base 3), A005377 (base 4), A005358 (base 5).
%K nonn
%O 1,4
%A _N. J. A. Sloane_, _Simon Plouffe_
%E More terms from _Sean A. Irvine_, May 27 2016