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

This page as a plain text file.
%I A266342 #15 Jan 02 2016 04:12:37
%S A266342 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,
%T A266342 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,
%U A266342 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
%N 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).
%H A266342 Antti Karttunen, <a href="/A266342/b266342.txt">Table of n, a(n) for n = 1..16384</a>
%F A266342 a(n) = Sum_{d|n} [(d <= (n/d)) and (A000523(d) = A000523(n/d))].
%F A266342 (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.)
%e A266342 For n=1 we have one possibility, 1*1 = 1, thus a(1) = 1.
%e A266342 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).
%e A266342 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.)
%t A266342 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 *)
%o A266342 (PARI)
%o A266342 A000523(n) = if(n<1,0,#binary(n) - 1);
%o A266342 A266342(n) = sumdiv(n, d, ((d <= (n/d)) && (A000523(d)==A000523(n/d))));
%o A266342 for(n=1, 32768, write("b266342.txt", n, " ", A266342(n)));
%Y A266342 Cf. A000523.
%Y A266342 Cf. A266346 (positions of nonzeros), A266347 (positions of zeros).
%Y A266342 Cf. A266343 (positions of records).
%Y A266342 Cf. also A266344.
%K A266342 nonn,base
%O A266342 1,120
%A A266342 _Antti Karttunen_, Dec 27 2015