

A060035


Least m >= 0 such that 2^m has n 2's in its base3 expansion.


0



0, 1, 3, 12, 9, 16, 15, 19, 27, 30, 44, 40, 55, 52, 65, 60, 51, 75, 73, 80, 86, 82, 81, 77, 98, 85, 95, 79, 118, 141, 162, 107, 129, 105, 158, 145, 155, 143, 138, 152, 203, 176
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,3


COMMENTS

Previous name was: First power of 2 which has n 2's in its base 3 expansion, or 1 if no such power exists.
"Paul Erdős conjectured that for n > 8, 2^n is not a sum of distinct powers of 3. In terms of digits, this states that powers of 2 for n > 8 must always contain a '2' in their base 3 expansion."
The value of a(42) is conjectured to be 1 because no power of 2 up to 2^10^7 has exactly 42 2's.
After a(42), that is unknown, the sequence goes on 171, 142, 167, 197, 168, 216, 229, 193, 232, 236, 248, 226, 230, 224, 228, 303, 244, ...


REFERENCES

Ilan Vardi, "Computational Recreations in Mathematica," AddisonWesley Publishing Co., Redwood City, CA, 1991, page 20.


LINKS



EXAMPLE

a(0) = 0 because 2^0 in base 3 is {1} which has no terms equaling 2.
a(6) = 15 because 2^15 in base 3 is {1, 1, 2, 2, 2, 2, 1, 1, 2, 2} which has 6 terms equaling 2.


MAPLE

for m from 0 to 1000 do
r:= numboccur(2, convert(2^m, base, 3));
if not assigned(A[r]) then A[r]:= m fi;
od:


MATHEMATICA

a[n_] := For[k=0, True, k++, If[Count[IntegerDigits[2^k, 3], 2]==n, Return[k]]]; Table[a[n], {n, 0, 41}] (* goes into infinite loop for n > 41 *)
a[n_] := 1; Do[m = Count[IntegerDigits[2^(n), 3], 2]; If[a[m] == 1, a[m] = n], {n, 0, 1000}]; Table[a[n], {n, 0, 59}] {* L. Edson Jeffery, Dec 08 2015 *)


PROG

(PARI) isok(n, k) = {d = digits(2^k, 3); sum(i=1, #d, d[i]==2) == n; }
a(n) = {k = 0; while(! isok(n, k), k++); k; } \\ Michel Marcus, Dec 08 2015


CROSSREFS



KEYWORD

nonn,base,more


AUTHOR



EXTENSIONS

a(42) = 1 and following terms removed from data by Michel Marcus, Dec 09 2015


STATUS

approved



