A266342 a(n) = number of ways n can be expressed as a product of two natural numbers that have same number of significant digits in base-2 representation (up to the ordering of unequal factors).
1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 2
Offset: 1
Examples
For n=1 we have one possibility, 1*1 = 1, thus a(1) = 1. For n=2 we have no choices, as the binary representation of 1 which is "1" is shorter than the binary representation of 2 which is "10", thus a(2) = 0 (and likewise for any prime). For n=120 we have two choices, either 8*15 (in binary "1000" * "1111") or 10*12 ("1010" * "1100"), thus a(120) = 2. (15*8 and 8*15 are not counted separately.)
Links
- Antti Karttunen, Table of n, a(n) for n = 1..16384
Crossrefs
Programs
-
Mathematica
Map[Length, Table[Flatten@ Map[Differences@ IntegerLength[#, 2] &, Transpose@ {#, n/#}] &@ TakeWhile[Divisors@ n, # <= Sqrt@ n &], {n, 120}] /. k_ /; k > 0 -> Nothing] (* Michael De Vlieger, Dec 30 2015, Version 7.0 *)
-
PARI
A000523(n) = if(n<1,0,#binary(n) - 1); A266342(n) = sumdiv(n, d, ((d <= (n/d)) && (A000523(d)==A000523(n/d)))); for(n=1, 32768, write("b266342.txt", n, " ", A266342(n)));
Comments