login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A265157 Number of 2's in the base-3 representation of 2^n - 1. 1
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, 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, 14, 11, 14, 16, 13, 14, 11, 14, 14, 14, 15 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,10

LINKS

Indranil Ghosh, Table of n, a(n) for n = 0..1000

FORMULA

a(n) = A081603(A000225(n)). - Michel Marcus, Dec 03 2015

a(n) = A260683(n) - A000035(n). - Robert Israel, Dec 03 2015

MATHEMATICA

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)*)

Table[DigitCount[2^n-1, 3, 2], {n, 0, 80}] (* Harvey P. Dale, Dec 04 2015 *)

PROG

(PARI) a(n) = {my(d = digits(n, 3)); sum(k=1, #d, d[k]==2); } \\ Michel Marcus, Dec 03 2015

CROSSREFS

Cf. A000079 (2^n), A000225 (2*n - 1).

Cf. A260683 (Number of 2's in the expansion of 2^n in base 3).

Cf. A000035, A081603.

Sequence in context: A324030 A275821 A291674 * A054263 A308656 A178775

Adjacent sequences:  A265154 A265155 A265156 * A265158 A265159 A265160

KEYWORD

nonn,base

AUTHOR

L. Edson Jeffery, Dec 02 2015

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 8 21:44 EDT 2020. Contains 333329 sequences. (Running on oeis4.)