login
Characteristic function of Niven (or Harshad) numbers.
8

%I #15 Jul 18 2020 11:41:31

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

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

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

%N Characteristic function of Niven (or Harshad) numbers.

%C a(A005349(n)) = 1; a(A065877(n)) = 0;

%C also a(A038186(n)) = 1.

%H Reinhard Zumkeller, <a href="/A188641/b188641.txt">Table of n, a(n) for n = 1..10000</a>

%H Eric Weisstein, <a href="http://mathworld.wolfram.com/HarshadNumber.html">Harshad Numbers</a>

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Harshad_number">Harshad number</a>

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

%F a(n) = A000007(A070635(n)).

%o (Haskell)

%o a188641 = (1 -) . signum . a070635

%Y Cf. A007953, A188642.

%K nonn,base

%O 1

%A _Reinhard Zumkeller_, Apr 07 2011