login
a(n) = 1 if n is a highly composite number (A002182), 0 otherwise.
3

%I #7 Dec 20 2018 23:19:24

%S 1,1,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,

%T 0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,

%U 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1

%N a(n) = 1 if n is a highly composite number (A002182), 0 otherwise.

%C Characteristic function of A002182, first differences of A261100, Möbius transform of A181801.

%H Antti Karttunen, <a href="/A322586/b322586.txt">Table of n, a(n) for n = 1..83160</a>

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

%F a(1) = 1; for n > 1, a(n) = A261100(n) - A261100(n-1).

%F For all n, a(n) <= A322585(n).

%o (PARI)

%o v002182 = vector(128); v002182[1] = 1; \\ For memoization.

%o A002182(n) = { my(d,k); if(v002182[n],v002182[n], k = A002182(n-1); d = numdiv(k); while(numdiv(k) <= d, k=k+1); v002182[n] = k; k); };

%o A261100(n) = { my(k=1); while(A002182(k)<=n,k=k+1); (k-1); };

%o A322586(n) = if(1==n,1,(A261100(n)-A261100(n-1)));

%Y Cf. A002182, A181801, A261100 (partial sums), A322585.

%K nonn

%O 1

%A _Antti Karttunen_, Dec 20 2018