login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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).
7
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,120
LINKS
FORMULA
a(n) = Sum_{d|n} [(d <= (n/d)) and (A000523(d) = A000523(n/d))].
(In the above formula [ ] stands for Iverson bracket, resulting in 1 only if d is less than or equal to n/d and the binary lengths of d and n/d are equal, and 0 otherwise.)
EXAMPLE
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.)
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 *)
PROG
(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)));
CROSSREFS
Cf. A000523.
Cf. A266346 (positions of nonzeros), A266347 (positions of zeros).
Cf. A266343 (positions of records).
Cf. also A266344.
Sequence in context: A216579 A229878 A235145 * A285936 A322358 A322437
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Dec 27 2015
STATUS
approved