A365215 Largest k such that the binary representation of 3^k has exactly n 1's, or -1 if no such k exists.
0, 2, 4, 3, 7, 8, -1, 9, 10, 12, 16, -1, 11, 18, 15, 24, 20, 25, 22, 21, -1, 23
Offset: 1
Links
- Vassil S. Dimitrov and Everett W. Howe, Powers of 3 with few nonzero bits and a conjecture of Erdős, arXiv:2105.06440 [math.NT], 2021.
- H. G. Senge and E. G. Straus, PV-numbers and sets of multiplicity, Periodica Mathematica Hungarica 3 (1973), 93-100.
Programs
-
Mathematica
LargestK[n_Integer] := Module[{k = 1000(*Assuming 1000 is large enough for the search. Adjust if necessary.*), binCount}, While[k >= 0, binCount = Total[IntegerDigits[3^k, 2]]; If[binCount == n, Return[k]]; k--;]; -1]; Table[LargestK[n], {n, 22}] (* Robert P. P. McKone, Aug 26 2023 *)
Comments