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 A265157 #26 Oct 13 2017 00:18:08 %S A265157 0,0,0,1,1,0,1,1,0,3,2,3,3,2,2,5,5,4,3,6,4,6,5,3,1,4,2,7,8,6,9,8,8,6, %T A265157 7,7,4,5,8,8,11,10,7,10,10,7,9,7,8,9,11,15,13,9,9,11,13,15,12,12,15, %U A265157 14,11,14,16,13,14,11,14,14,14,15 %N A265157 Number of 2's in the base-3 representation of 2^n - 1. %H A265157 Indranil Ghosh, <a href="/A265157/b265157.txt">Table of n, a(n) for n = 0..1000</a> %F A265157 a(n) = A081603(A000225(n)). - _Michel Marcus_, Dec 03 2015 %F A265157 a(n) = A260683(n) - A000035(n). - _Robert Israel_, Dec 03 2015 %t A265157 n = -1; While[n < 71, n++; s = IntegerDigits[2^n - 1, 3]; k = Count[s, 2]; AppendTo[a, k]]; a (* after _Emmanuel Vantieghem_ (see A260683)*) %t A265157 Table[DigitCount[2^n-1,3,2],{n,0,80}] (* _Harvey P. Dale_, Dec 04 2015 *) %o A265157 (PARI) a(n) = {my(d = digits(n, 3)); sum(k=1, #d, d[k]==2);} \\ _Michel Marcus_, Dec 03 2015 %Y A265157 Cf. A000079 (2^n), A000225 (2*n - 1). %Y A265157 Cf. A260683 (Number of 2's in the expansion of 2^n in base 3). %Y A265157 Cf. A000035, A081603. %K A265157 nonn,base %O A265157 0,10 %A A265157 _L. Edson Jeffery_, Dec 02 2015