login
Characteristic function of refactorable numbers (A033950).
10

%I #26 Nov 28 2021 10:27:07

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

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

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

%N Characteristic function of refactorable numbers (A033950).

%H Antti Karttunen, <a href="/A336040/b336040.txt">Table of n, a(n) for n = 1..65537</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/RefactorableNumber.html">Refactorable Number</a>

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

%F a(n) = 1 - ceiling(n/d(n)) + floor(n/d(n)), where d(n) is the number of divisors of n (A000005).

%F a(n) = [A054008(n) == 0], where [ ] is the Iverson bracket. - _Antti Karttunen_, Nov 24 2021

%F a(p) = 0 for odd primes p. - _Wesley Ivan Hurt_, Nov 28 2021

%e a(1) = 1 since d(1) = 1 and 1 divides 1.

%e a(2) = 1 since d(2) = 2 and 2 divides 2.

%e a(3) = 0 since d(3) = 2, but 2 does not divide 3.

%t a[n_] := Boole @ Divisible[n, DivisorSigma[0, n]]; Array[a, 100] (* _Amiram Eldar_, Jul 08 2020 *)

%o (PARI) a(n) = n%numdiv(n) == 0; \\ _Michel Marcus_, Jul 07 2020

%Y Cf. A000005, A033950, A054008, A336041 (inverse Möbius transform), A335182, A335665, A349322.

%K nonn,easy

%O 1,1

%A _Wesley Ivan Hurt_, Jul 07 2020