A336040 Characteristic function of refactorable numbers (A033950).
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, 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, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0
Offset: 1
Examples
a(1) = 1 since d(1) = 1 and 1 divides 1. a(2) = 1 since d(2) = 2 and 2 divides 2. a(3) = 0 since d(3) = 2, but 2 does not divide 3.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
- Eric Weisstein's World of Mathematics, Refactorable Number
- Index entries for characteristic functions
Crossrefs
Programs
-
Mathematica
a[n_] := Boole @ Divisible[n, DivisorSigma[0, n]]; Array[a, 100] (* Amiram Eldar, Jul 08 2020 *)
-
PARI
a(n) = n%numdiv(n) == 0; \\ Michel Marcus, Jul 07 2020
Formula
a(n) = 1 - ceiling(n/d(n)) + floor(n/d(n)), where d(n) is the number of divisors of n (A000005).
a(n) = [A054008(n) == 0], where [ ] is the Iverson bracket. - Antti Karttunen, Nov 24 2021
a(p) = 0 for odd primes p. - Wesley Ivan Hurt, Nov 28 2021