cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 27 2015

Keywords

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

Crossrefs

Cf. A000523.
Cf. A266346 (positions of nonzeros), A266347 (positions of zeros).
Cf. A266343 (positions of records).
Cf. also A266344.

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)));

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