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.

Previous Showing 11-19 of 19 results.

A365214 Least k such that the binary representation of 3^k has exactly n 1's, or -1 if no such k exists.

Original entry on oeis.org

0, 1, 4, 3, 7, 5, -1, 9, 10, 12, 13, -1, 11, 14, 15, 24, 19, 25, 22, 21, -1, 23
Offset: 1

Views

Author

Pontus von Brömssen, Aug 26 2023

Keywords

Comments

Least k such that A011754(k) = n, or -1 if no such k exists.
The first 22 terms are from Dimitrov and Howe (2021). After a(22), the sequence continues (with the -1's conjectural but very likely correct) -1, 26, 28, 31, 36, 40, 34, 27, -1, 35, 49, 33, 53, 38, -1, 42, 41, 57, 48, 52, -1, -1, 46, 51, 67, 59, 62, -1, ... .

Crossrefs

A369857 Number of nonzero bits (a.k.a. binary or Hamming weight) of 7^n.

Original entry on oeis.org

1, 3, 3, 6, 5, 7, 9, 11, 14, 17, 15, 20, 11, 20, 23, 20, 22, 24, 20, 31, 30, 24, 24, 36, 29, 29, 37, 33, 37, 42, 43, 43, 40, 50, 53, 44, 39, 53, 43, 60, 57, 53, 60, 59, 62, 68, 65, 66, 59, 68, 75, 71, 84, 77, 65, 74, 81, 87, 85, 83, 77, 89, 83, 95, 84, 89, 86, 98, 102, 94, 97, 104
Offset: 0

Views

Author

M. F. Hasler, Apr 17 2024

Keywords

Comments

Conjecture: a(n)/n -> log_4(7) = 1.403677461..., i.e., about half of the bits of 7^n are nonzero.

Examples

			The first few powers of 7 and their binary representation are as follows:
   n  | 0 |  1  |    3   |     4     |       5      |        6        | ...
  ----+---+-----+--------+-----------+--------------+-----------------+----
  7^n | 1 |  7  |   49   |    343    |     2401     |      16807      | ...
  ----+---+-----+--------+-----------+--------------+-----------------+----
  bin | 1 | 111 | 110001 | 101010111 | 100101100001 | 100000110100111 | ...
  ----+---+-----+--------+-----------+--------------+-----------------+----
  a(n)| 1 |  3  |    3   |     6     |       5      |        7        | ...
  ----+---+-----+--------+-----------+--------------+-----------------+----
		

Crossrefs

Cf. A000120 (Hamming weight), A000420 (7^n).
Cf. A011754, A118738 (analog for 3^n and 5^n).

Programs

Formula

a(n) = A000120(A000420(n)). (Definition of this sequence.)

A371970 Exponents k such that the binary expansion of 3^k has an even number of ones.

Original entry on oeis.org

1, 2, 3, 5, 6, 8, 9, 12, 14, 17, 18, 21, 23, 24, 25, 26, 27, 31, 32, 33, 35, 37, 38, 39, 40, 42, 44, 45, 47, 51, 52, 55, 57, 58, 59, 60, 61, 64, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 81, 96, 99, 102, 104, 105, 106, 109, 112, 116, 127, 131, 132, 133, 134, 135, 136
Offset: 1

Views

Author

Hugo Pfoertner, Apr 24 2024

Keywords

Crossrefs

Complement of A223024.

Programs

  • Maple
    q:= n-> is(add(i, i=Bits[Split](3^n))::even):
    select(q, [$0..150])[];  # Alois P. Heinz, Apr 24 2024
  • Mathematica
    Select[Range[136], EvenQ@ DigitCount[3^#, 2, 1] &] (* Michael De Vlieger, Apr 24 2024 *)
  • PARI
    is_a371970(k) = hammingweight(3^k)%2 == 0

A093476 Index of occurrence of the first 0 bit in binary representation of 3^n.

Original entry on oeis.org

2, 3, 2, 5, 2, 2, 3, 2, 4, 2, 2, 3, 2, 3, 2, 5, 2, 2, 3, 2, 4, 2, 2, 3, 2, 3, 2, 6, 2, 2, 3, 2, 4, 2, 2, 3, 2, 4, 2, 7, 2, 2, 3, 2, 5, 2, 2, 3, 2, 4, 2, 2, 3, 2, 3, 2, 5, 2, 2, 3, 2, 4, 2, 2, 3, 2, 3, 2, 5, 2, 2, 3, 2, 4, 2, 2, 3, 2, 3, 2, 6, 2, 2, 3, 2, 4, 2, 2, 3, 2, 4, 2, 7, 2, 2, 3, 2, 5, 2, 2, 3, 2, 4, 2, 2
Offset: 2

Views

Author

Benoit Cloitre, May 22 2004

Keywords

Examples

			In binary, 3^5 = [1, 1, 1, 1, 0, 0, 1, 1] where the first 0 occurs at 5th place. Hence a(5)=5.
		

Crossrefs

Programs

  • Maple
    seq(ListTools:-Search(0, ListTools:-Reverse(convert(3^n,base,2))), n=2..200); # Robert Israel, Nov 20 2017
  • Mathematica
    Array[FirstPosition[IntegerDigits[3^#, 2], 0][[1]] &, 105, 2] (* Michael De Vlieger, Nov 20 2017 *)
  • PARI
    a(n)=if(n<2,0,s=1;while(component(binary(3^n),s)>0,s++);s)

Formula

It seems that Sum_{i=2..n} a(i) is asymptotic to c*n with c=2.7(8).....
From Robert Israel, Nov 20 2017: (Start)
a(n) = k if log_2(2 - 1/2^(k-2)) < frac(n*log_2(3)) < log_2(2 - 1/2^(k-1)). By the equidistribution theorem, this occurs with asymptotic density log_2(2-1/2^(k-1)) - log_2(2-1/2^(k-2)).
Thus c = Sum_{k>=2} k (log_2(2-1/2^(k-1)) - log_2(2 - 1/2^(k-2))) = 2 - Sum_{k>=2} log_2(1-1/2^k) = 2.791916824662... Note that A048651 is the decimal expansion of 2^(1-c). (End)

A365215 Largest k such that the binary representation of 3^k has exactly n 1's, or -1 if no such k exists.

Original entry on oeis.org

0, 2, 4, 3, 7, 8, -1, 9, 10, 12, 16, -1, 11, 18, 15, 24, 20, 25, 22, 21, -1, 23
Offset: 1

Views

Author

Pontus von Brömssen, Aug 26 2023

Keywords

Comments

Largest k such that A011754(k) = n, or -1 if no such k exists.
Senge and Straus prove that a(n) is finite for all n.
The first 22 terms are from Dimitrov and Howe (2021). After a(22), the sequence conjecturally but very likely continues -1, 26, 30, 32, 36, 40, 34, 27, -1, 39, 49, 45, 53, 38, -1, 47, 56, 57, 50, 58, -1, -1, 66, 51, 67, 59, 62, -1, ... .

Crossrefs

Programs

  • Mathematica
    LargestK[n_Integer] := Module[{k = 1000(*Assuming 1000 is large enough for the search.  Adjust if necessary.*), binCount}, While[k >= 0, binCount = Total[IntegerDigits[3^k, 2]]; If[binCount == n, Return[k]]; k--;]; -1]; Table[LargestK[n], {n, 22}] (* Robert P. P. McKone, Aug 26 2023 *)

A371971 a(n) is the least exponent m minimizing the percentage of set bits in the binary representation of prime(n)^m.

Original entry on oeis.org

24, 25, 12, 6, 16, 2, 10, 2, 7, 22, 16, 8, 15, 2, 14, 3, 20, 2, 4, 7, 21, 4, 19, 6, 13, 6, 7, 7, 3, 10, 2, 1, 9, 5, 2, 2, 6, 10, 36, 11, 13, 2, 2, 10, 9, 5, 2, 34, 5, 2, 4, 4, 8, 2, 9, 4, 6, 9, 3, 14, 38, 9, 14, 16, 2, 7, 4, 16, 3, 9, 6, 2, 4, 2, 10, 15, 10, 14, 6, 71, 31, 4
Offset: 2

Views

Author

Hugo Pfoertner, Apr 17 2024

Keywords

Crossrefs

Programs

  • PARI
    a371971(n,limit=10000) = {my(p=prime(n), q=1, m=1); for (k=1,limit, my (pp=p^k, h=hammingweight(pp), g=#binary(pp), qq=h/g); if (qq
    				

A375258 Array read by antidiagonals: T(k,n) is the least positive integer whose sum of base-2 digits is k and sum of base-3 digits is n, or -1 if there is none.

Original entry on oeis.org

1, 2, 3, -1, 6, 81, 8, 5, 28, 27, -1, 20, 7, 30, 2187, 128, 17, 14, 15, 244, 243, -1, 68, 25, 46, 31, 246, -1, 512, 8193, 26, 23, 94, 63, 6570, 19683, -1, 80, 131, 78, 47, 126, 247, 2430, 59049, 2048, 1025, 134, 53, 62, 95, 254, 255, 19926, 531441, -1, 2050, 161, 212, 79, 222, 127, 766, 2431
Offset: 1

Views

Author

Robert Israel, Aug 07 2024

Keywords

Comments

T(k,n) is the least positive integer x, if it exists, such that A000120(x) = k and A053735(x) = n.
T(k,n) == n (mod 2) unless T(k,n) = -1, since A053735(x) == x (mod 2). In particular, T(1, n) = -1 if n >= 3 is odd.
Dimitrov and Howe prove that for n > 25, the sum of binary digits of 3^n is > 22. In particular, this implies T(7,1) = T(12,1) = T(21,1) = -1, since none of the first 25 powers of 3 work.

Examples

			Array starts
     1,     2,    -1,     8,    -1,   128,    -1,   512, ...
     3,     6,     5,    20,    17,    68,  8193,    80, ...
    81,    28,     7,    14,    25,    26,   131,   134, ...
    27,    30,    15,    46,    23,    78,    53,   212, ...
  2187,   244,    31,    94,    47,    62,    79,   158, ...
   243,   246,    63,   126,    95,   222,   125,   238, ...
    -1,  6570,   247,   254,   127,   382,   223,   446, ...
 19683,  2430,   255,   766,   507,   510,   383,   958, ...
		

Crossrefs

Programs

  • Maple
    T:= Matrix(8,8,-1):
    for x from 1 to 10^5 do
      k:= convert(convert(x,base,2),`+`);
      n:= convert(convert(x,base,3),`+`);
      if k <= 8 and n <= 8 and T[k,n] = -1 then T[k,n]:= x; fi
    od:
    T;

A070972 Length of longest run of consecutive 1's in binary expansion of 3^n (A004656).

Original entry on oeis.org

1, 2, 1, 2, 1, 4, 2, 2, 2, 3, 3, 7, 6, 4, 5, 4, 3, 4, 4, 4, 6, 5, 5, 4, 3, 2, 10, 8, 7, 5, 4, 5, 7, 9, 8, 6, 5, 7, 11, 10, 8, 6, 6, 4, 9, 7, 6, 4, 9, 8, 6, 9, 8, 6, 5, 5, 3, 4, 7, 5, 10, 8, 7, 6, 6, 6, 6, 4, 4, 7, 7, 5, 5, 5, 5, 5, 5, 9, 8, 6, 5, 6, 5, 6, 5, 5, 4, 6, 5, 10, 8, 7, 5, 6, 6, 6, 7, 7, 6, 7, 5, 5, 5, 9
Offset: 0

Views

Author

Frank Schwellinger (nummer_eins(AT)web.de), Jan 03 2003

Keywords

Examples

			3^11 = (101011001111111011) binary, so a(11) = 7.
		

Crossrefs

Cf. A004656 and A011754.

Programs

  • Mathematica
    f[n_Integer] := Block[{p = Flatten[ Position[ Prepend[ IntegerDigits[2*3^n, 2], 0], 0]]}, Max[Drop[p, 1] - Drop[p, -1]] - 1]; Table[ f[n], {n, 0, 103}]

Extensions

Edited by Robert G. Wilson v, Jan 04 2002

A118736 Number of zeros in binary expansion of 3^n.

Original entry on oeis.org

0, 0, 2, 1, 4, 2, 4, 7, 7, 7, 7, 5, 10, 10, 9, 9, 15, 13, 15, 14, 15, 14, 16, 15, 23, 22, 18, 13, 20, 21, 23, 24, 25, 19, 25, 24, 31, 25, 25, 30, 36, 26, 29, 30, 36, 38, 28, 37, 36, 45, 39, 35, 41, 50, 47, 46, 50, 51, 50, 46, 40, 41, 50, 43, 46, 53, 60, 60, 53, 55, 47, 45, 57, 58
Offset: 0

Views

Author

Zak Seidov, May 22 2006

Keywords

Crossrefs

Cf. A011754 (number of ones in binary expansion of 3^n).

Programs

  • Mathematica
    f[n_] := DigitCount[3^n, 2, 0]; Table[f[n], {n, 0, 73}] (* Ray Chandler, Sep 29 2006 *)
  • PARI
    a(n) = #select(x->(x==0), binary(3^n)); \\ Michel Marcus, Apr 14 2020
Previous Showing 11-19 of 19 results.