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.
%I A260683 #51 May 09 2024 05:13:30 %S A260683 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, %T A260683 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, %U A260683 15,11,15,16,14,14,12,14,15,14,16,11,18,11,17,10 %N A260683 Number of 2's in the expansion of 2^n in base 3. %C A260683 Erdős conjectures that a(n) > 0 for n > 8. %D A260683 R. K. Guy, Unsolved Problems in Number Theory, B33. [Does not seem to be in section B33.] %H A260683 Robert Israel, <a href="/A260683/b260683.txt">Table of n, a(n) for n = 0..10000</a> %H A260683 Paul Erdős, <a href="https://www.jstor.org/stable/2689842">Some unconventional problems in number theory</a>, Mathematics Magazine, Vol. 52, No. 2 (1979), pp. 67-70. %F A260683 a(n) = A020915(n) - A104320(n) - A036461(n). - _Altug Alkan_, Nov 15 2015 %F A260683 a(n) = A081603(A000079(n)). - _Michel Marcus_, Dec 03 2015 %e A260683 For n=5, the expansion of 2^n in number base 3 is 1012, thus: a(n)=1 %e A260683 For n=10, the expansion of 2^n in number base 3 is 1101221, thus: a(n)=2 %p A260683 seq(numboccur(2, convert(2^n,base,3)),n=0..100); # _Robert Israel_, Nov 15 2015 %t A260683 S={};n=-1;While[n<150,n++;A=IntegerDigits[2^n,3];k=Count[A,2];AppendTo[S, k]];S %o A260683 (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)} %o A260683 for(n=0, 300, print1(c(2^n, 2, 3)", ")) \\ _Altug Alkan_, Nov 15 2015 %o A260683 (PARI) a(n) = #select(x->(x==2), digits(2^n, 3)); \\ _Michel Marcus_, Nov 28 2018 %o A260683 (PARI) a(n) = hammingweight(digits(2^n, 3)\2); \\ _Ruud H.G. van Tol_, May 09 2024 %o A260683 (Perl) use ntheory ":all"; sub a260683 { scalar grep { $_==2 } todigits(vecprod((2) x shift), 3) } # _Dana Jacobsen_, Aug 16 2016 %Y A260683 Cf. A004642 (2^n in base 3), A020915 (number of terms), A036461 (number of 1's), A104320 (number of 0's). %Y A260683 Cf. A000108 (conjecture that A000108(n) is 6m+1 only for n = 0, 1 and 5 follows from Erdős's one). %Y A260683 Cf. A005836 (for numbers with no 2 in base 3). %K A260683 base,easy,nonn %O A260683 0,4 %A A260683 _Emmanuel Vantieghem_, Nov 15 2015