cp's OEIS Frontend

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.

Showing 1-4 of 4 results.

A104320 Number of zeros in ternary representation of 2^n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 1, 1, 1, 4, 1, 0, 4, 2, 3, 3, 3, 3, 3, 7, 7, 9, 5, 6, 6, 4, 4, 3, 5, 6, 7, 9, 9, 10, 6, 6, 9, 9, 8, 9, 8, 7, 13, 12, 13, 9, 5, 9, 8, 6, 16, 13, 9, 10, 11, 11, 7, 14, 13, 13, 9, 12, 14, 15, 15, 11, 11, 17, 15, 19, 14, 19, 12, 18, 15, 11, 10, 16, 15, 14, 14, 13, 17, 14
Offset: 0

Views

Author

Reinhard Zumkeller, Mar 01 2005

Keywords

Comments

Conjecture from N. J. A. Sloane: a(n) > 0 for n > 15, see A102483.

Examples

			n=13: 2^13=8192 -> '102020102', a(13) = 4.
		

Crossrefs

Programs

  • Magma
    [Multiplicity(Intseq(2^n,3),0):n in [0..90]]; // Marius A. Burtea, Nov 17 2019
  • Maple
    f:= n -> numboccur(0, convert(2^n,base,3)):
    map(f, [$0..100]); # Robert Israel, Nov 17 2019
  • Mathematica
    Table[DigitCount[2^n,3,0],{n,0,90}] (* Harvey P. Dale, May 06 2014 *)
  • PARI
    a(n) = my(d=vecsort(digits(2^n, 3))); #setintersect(d, vector(#d)) \\ Felix Fröhlich, Nov 17 2019
    
  • PARI
    a(n) = #select(d->!d, digits(2^n, 3)); \\ Ruud H.G. van Tol, May 09 2024
    

Formula

a(n) = A077267(A000079(n)).
a(A104321(n))=n and a(m)<>n for m < A104321(n).

A375472 Least k such that the ternary representation of 2^k has exactly 2*n 1's, or -1 if no such k exists.

Original entry on oeis.org

1, 2, 8, 14, 24, 26, 42, 45, 50, 53, 70, 74, 96, 76, 124, 98, 116, 121, 143, 141, 179, 150, 187, 181, 192, 215, 209, 233, 220, 257, 245, 264, 243, 278, 260, 310, 297, 303, 315, 339, 329, 387, 341, 357, 354, 366, 403, 420, 350, 400, 411, 415, 474, 455, 466, 442
Offset: 0

Views

Author

Pontus von Brömssen, Aug 17 2024

Keywords

Examples

			For n = 3, the smallest power of 2 with exactly 2*3 = 6 1's in its ternary representation is 2^14 = 211110211_3, so a(3) = 14.
		

Crossrefs

Programs

  • PARI
    a(n) = my(k=1); while (#select(x->(x==1), digits(2^k, 3)) != 2*n, k++); k; \\ Michel Marcus, Aug 17 2024

Formula

Conjecture: a(n) ~ 6*log_2(3)*n = 6*A020857*n.

A060035 Least m >= 0 such that 2^m has n 2's in its base-3 expansion.

Original entry on oeis.org

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
Offset: 0

Views

Author

Robert G. Wilson v, Mar 17 2001

Keywords

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, ...

Examples

			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.
		

References

  • Ilan Vardi, "Computational Recreations in Mathematica," Addison-Wesley Publishing Co., Redwood City, CA, 1991, page 20.

Crossrefs

Programs

  • 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:
    seq(A[i],i=0..41); # Robert Israel, Dec 08 2015
  • 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 *)
  • 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

Extensions

Corrected and extended by Sascha Kurz, Jan 31 2003
Zero prepended to sequence by L. Edson Jeffery, Dec 08 2015
New name from L. Edson Jeffery, Dec 08 2015
a(42) = -1 and following terms removed from data by Michel Marcus, Dec 09 2015

A036462 Conjecturally, a power of 2 written in base 3 cannot have this many 0's.

Original entry on oeis.org

115, 124, 139, 243, 367, 445, 783, 914, 958, 1095, 1112, 1200, 1239, 1312, 1487, 1752, 1902, 2013, 2504, 2583, 2620, 2697, 2725, 2754, 2881, 3015, 3365, 3443, 3612, 3673, 3980, 3984, 4002, 4105, 4184, 4212, 4315, 4343, 4394, 4477, 4516, 4862, 4918, 5100
Offset: 1

Views

Author

Keywords

Comments

Conjecture 1: Sequence A104320 never obtains the values in this sequence, so A104321(a(n)) is undefined. Conjecture 2: This sequence is infinite. - David W. Wilson, Oct 21 2016, edited by Antti Karttunen, Oct 29 2016

Crossrefs

Showing 1-4 of 4 results.