login
Write a "1" for each distinct prime divisor p of n in the (pi(p) - 1)-th place, ignoring multiplicity.
4

%I #39 Feb 10 2020 16:32:55

%S 0,1,10,1,100,11,1000,1,10,101,10000,11,100000,1001,110,1,1000000,11,

%T 10000000,101,1010,10001,100000000,11,100,100001,10,1001,1000000000,

%U 111,10000000000,1,10010,1000001,1100,11,100000000000,10000001,100010,101,1000000000000,1011,10000000000000,10001,110

%N Write a "1" for each distinct prime divisor p of n in the (pi(p) - 1)-th place, ignoring multiplicity.

%C 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).

%C a(n) = A054841(n) with all nonzero digits converted to 1's.

%C 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.

%C a(p) = 1 in the leftmost place followed by (pi(p)-1) zeros.

%C 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.

%C 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.

%H Antti Karttunen, <a href="/A276379/b276379.txt">Table of n, a(n) for n = 1..1001</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%H <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a>

%F a(n) = A054841(A007947(n)) = A007088(A087207(n)). - _Antti Karttunen_, Jun 18 2017

%F G.f.: Sum_{k>=1} 10^(k-1) * x^prime(k) / (1 - x^prime(k)). - _Ilya Gutkovskiy_, Feb 10 2020

%e a(1) = 0 since 1 is the empty product. a(0) is undefined.

%e 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.

%e 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.

%e a(70) = 1101, since its prime divisors are 2, 5 and 7.

%p a:= n-> add(10^numtheory[pi](i[1]), i=ifactors(n)[2])/10:

%p seq(a(n), n=1..53); # _Alois P. Heinz_, Feb 10 2020

%t 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 *)

%t FromDigits[IntegerDigits[#, 2]] & /@ Table[Floor@ Total[2^(PrimePi /@ FactorInteger[n][[All, 1]] - 1)], {n, 45}] (* latter program after _Jean-François Alcover_ at A087207 *)

%Y Cf. A027748, A054841 (write multiplicity instead of 1 in the (pi(p)-1)th place), A079067 (reverse 0's and 1's in a(n) and convert to decimal), A087207 (a(n) interpreted as a binary number), A273258 (a(n) reversed and converted to decimal).

%Y Sequence A087207 shown in base-2.

%K easy,nonn,base

%O 1,3

%A _Michael De Vlieger_, Sep 02 2016