OFFSET
1,3
COMMENTS
a(n) notes the distinct prime divisors p of n by writing "1" in the (pi(n)-1)-th place. Zeros hold the places of primes q less than the greatest prime divisor p that do not divide n. Thus a(n) consists of 1's and 0's like a binary number where each bit value, instead of representing 2^k, represents prime(k + 1).
a(n) = A054841(n) with all nonzero digits converted to 1's.
a(n) = a(A007947(n)), that is, a number n shares a value of a(n) with the largest squarefree divisor A007947(n). Thus a(18) = a(6) = 11.
a(p) = 1 in the leftmost place followed by (pi(p)-1) zeros.
This function is akin to A054841(n) except we don't note the multiplicity e of p in n, rather merely note "1" if e > 0.
Unlike A054841(1024) = 10, there are no overflows in a(n) into the next place that encodes prime(p+1) due to "carry". 1024 = 2^10, thus a(1024) = a(2^e) = 1, with e >= 1 = 1.
LINKS
FORMULA
G.f.: Sum_{k>=1} 10^(k-1) * x^prime(k) / (1 - x^prime(k)). - Ilya Gutkovskiy, Feb 10 2020
EXAMPLE
a(1) = 0 since 1 is the empty product. a(0) is undefined.
a(6) = a(12) = 11, since 6 and 12 are products of the 1st and 2nd primes (i.e., 2 and 3). Thus we write 1's in the corresponding places. Any number n that is the product only of powers e >= 1 of 2 and 3 (e.g., 24, 96, 144, etc.) has a(n) = 11.
a(42) = 1011, since the prime divisors of 42 are 2, 3 and 7. Any number n that is the product only of powers e >= 1 of all of 2, 3 and 7 has a(n) = 1011.
a(70) = 1101, since its prime divisors are 2, 5 and 7.
MAPLE
a:= n-> add(10^numtheory[pi](i[1]), i=ifactors(n)[2])/10:
seq(a(n), n=1..53); # Alois P. Heinz, Feb 10 2020
MATHEMATICA
f[n_] := If[n == 1, {0}, Function[k, ReplacePart[Table[0, {PrimePi[k[[-1, 1]]]}], #] &@ Map[PrimePi@ First@ # -> 1 &, k]]@ FactorInteger@ n]; Table[FromDigits@ Reverse@ f@ n, {n, 45}] (* or *)
FromDigits[IntegerDigits[#, 2]] & /@ Table[Floor@ Total[2^(PrimePi /@ FactorInteger[n][[All, 1]] - 1)], {n, 45}] (* latter program after Jean-François Alcover at A087207 *)
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Michael De Vlieger, Sep 02 2016
STATUS
approved