|
|
A260683
|
|
Number of 2's in the expansion of 2^n in base 3.
|
|
3
|
|
|
0, 1, 0, 2, 1, 1, 1, 2, 0, 4, 2, 4, 3, 3, 2, 6, 5, 5, 3, 7, 4, 7, 5, 4, 1, 5, 2, 8, 8, 7, 9, 9, 8, 7, 7, 8, 4, 6, 8, 9, 11, 11, 7, 11, 10, 8, 9, 8, 8, 10, 11, 16, 13, 10, 9, 12, 13, 16, 12, 13, 15, 15, 11, 15, 16, 14, 14, 12, 14, 15, 14, 16, 11, 18, 11, 17, 10
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
COMMENTS
|
Erdős conjectures that a(n) > 0 for n > 8.
|
|
REFERENCES
|
R. K. Guy, Unsolved Problems in Number Theory, B33. [Does not seem to be in section B33.]
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
For n=5, the expansion of 2^n in number base 3 is 1012, thus: a(n)=1
For n=10, the expansion of 2^n in number base 3 is 1101221, thus: a(n)=2
|
|
MAPLE
|
seq(numboccur(2, convert(2^n, base, 3)), n=0..100); # Robert Israel, Nov 15 2015
|
|
MATHEMATICA
|
S={}; n=-1; While[n<150, n++; A=IntegerDigits[2^n, 3]; k=Count[A, 2]; AppendTo[S, k]]; S
|
|
PROG
|
(PARI) c(k, d, b) = {my(c=0, f); while (k>b-1, f=k-b*(k\b); if (f==d, c++); k\=b); if (k==d, c++); return(c)}
for(n=0, 300, print1(c(2^n, 2, 3)", ")) \\ Altug Alkan, Nov 15 2015
(PARI) a(n) = #select(x->(x==2), digits(2^n, 3)); \\ Michel Marcus, Nov 28 2018
(Perl) use ntheory ":all"; sub a260683 { scalar grep { $_==2 } todigits(vecprod((2) x shift), 3) } # Dana Jacobsen, Aug 16 2016
|
|
CROSSREFS
|
Cf. A000108 (conjecture that A000108(n) is 6m+1 only for n = 0, 1 and 5 follows from Erdős's one).
Cf. A005836 (for numbers with no 2 in base 3).
|
|
KEYWORD
|
base,easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|