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 21-30 of 853 results. Next

A265917 a(n) = floor(A070939(n)/A000120(n)) where A070939(n) is the binary length of n and A000120(n) is the binary weight of n.

Original entry on oeis.org

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

Views

Author

Alex Ratushnyak, Dec 18 2015

Keywords

Comments

1/a(n) gives a very rough approximation of the density of 1-bits in the binary representation (A007088) of n. This is 1 if more than half of the bits of n are 1. - Antti Karttunen, Dec 19 2015

Crossrefs

Programs

  • Mathematica
    Table[Floor[IntegerLength[n, 2]/Total@ IntegerDigits[n, 2]], {n, 120}] (* Michael De Vlieger, Dec 21 2015 *)
  • PARI
    a(n) = #binary(n)\hammingweight(n); \\ Michel Marcus, Dec 19 2015
  • Python
    for n in range(1, 88):
        print(str((len(bin(n))-2) // bin(n).count('1')), end=',')
    

A320673 Positive integers m with binary expansion (b_1, ..., b_k) (where k = A070939(m)) such that b_i = [m == 0 (mod i)] for i = 1..k (where [] is an Iverson bracket).

Original entry on oeis.org

1, 50, 52, 104, 114, 3460, 12298, 29442, 31368, 856592, 1713184, 54822416, 109578256, 109644832, 219156512, 219289664, 438313024, 438579328, 876626048, 877158656, 1034367516, 1753252096, 1754317312, 112208117792, 113290248736, 224416235584, 226580497472
Offset: 1

Views

Author

Rémy Sigrist, Oct 19 2018

Keywords

Comments

In other words, the binary representation of a term of this sequence encodes the first divisors and nondivisors of this term respectively as ones and zeros.
Is this sequence infinite?
See A320674 and A320675 for similar sequences.

Examples

			The first terms, alongside their binary representation and the divisors encoded therein, are:
  n  a(n)   bin(a(n))        First divisors
  -  -----  ---------------  --------------------
  1      1  1                1
  2     50  110010           1, 2, 5
  3     52  110100           1, 2, 4
  4    104  1101000          1, 2, 4
  5    114  1110010          1, 2, 3, 6
  6   3460  110110000100     1, 2, 4, 5, 10
  7  12298  11000000001010   1, 2, 11, 13
  8  29442  111001100000010  1, 2, 3, 6, 7, 14
  9  31368  111101010001000  1, 2, 3, 4, 6, 8, 12
		

Crossrefs

Programs

  • PARI
    is(n) = my (b=binary(n)); b==vector(#b, k, n%k==0)
    
  • Python
    from itertools import count, islice
    def A320673_gen(startvalue=0): # generator of terms >= startvalue
        return filter(lambda n:not any(int(b)==bool(n%i) for i,b in enumerate(bin(n)[2:],1)),count(max(startvalue,0)))
    A320673_list = list(islice(A320673_gen(),10)) # Chai Wah Wu, Dec 12 2022

A379537 Frugal numbers in base 2: numbers k such that A377369(k) < A070939(k).

Original entry on oeis.org

1, 27, 32, 49, 64, 81, 121, 125, 128, 135, 147, 162, 169, 189, 192, 243, 250, 256, 289, 297, 320, 338, 343, 351, 361, 363, 375, 384, 405, 448, 486, 507, 512, 513, 529, 539, 567, 576, 578, 605, 621, 625, 637, 640, 648, 675, 686, 704, 722, 729, 750, 768, 783, 832
Offset: 1

Views

Author

Paolo Xausa, Dec 25 2024

Keywords

Comments

A frugal number in base 2 is a number with more bits than the total number of bits of its prime factorization (including exponents > 1).
Following the definition by Pinch (1998), 1 is considered a frugal number.
Some authors call these numbers "economical numbers", as in A046759 which, according to the definition provided here, lists frugal numbers in base 10 (additionally, A046759 does not include 1).

Examples

			32 is a term because 32 = 2^5 = 10_2^101_2; the total number of bits of (10_2, 101_2) = 5 < the number of bits of 32 = 100000_2 (6).
135 is a term because 135 = 3^3*5 = 11_2^11_2*101_2; the total number of bits of (11_2, 11_2, 101_2) = 7 < the number of bits of 135 = 10000111_2 (8).
		

Crossrefs

Row n = 2 of A379538.

Programs

  • Mathematica
    A379537Q[k_] := Total[BitLength[Select[Flatten[FactorInteger[k]], # > 1 &]]] < BitLength[k];
    Select[Range[1000], A379537Q]

A232085 Primes that can be written in binary representation as concatenation of two primes. That is, primes representable as p * 2^L + q, where p and q are primes, and L is the length of binary representation of q: L = A070939(q).

Original entry on oeis.org

11, 23, 29, 31, 43, 47, 59, 61, 71, 79, 83, 109, 113, 127, 151, 157, 167, 179, 181, 191, 229, 233, 239, 241, 251, 271, 283, 317, 349, 353, 359, 367, 373, 379, 383, 431, 433, 439, 457, 463, 467, 479, 487, 491, 509, 541, 563, 599, 607, 631, 643, 661, 691, 701, 709, 719
Offset: 1

Views

Author

Alex Ratushnyak, Nov 17 2013

Keywords

Comments

A subsequence of A090423.

Crossrefs

A232238 Primes p such that p+2 and q are primes, where q is concatenation of binary representations of p and p+2: q = p * 2^L + p+2, where L is the length of binary representation of p+2: L=A070939(p+2).

Original entry on oeis.org

3, 5, 17, 71, 269, 1049, 1151, 1721, 5099, 5279, 5657, 6299, 6569, 6779, 7307, 7589, 16451, 16649, 16691, 19079, 19139, 19211, 19841, 19961, 20771, 20981, 21011, 21059, 21599, 22619, 22961, 23201, 23369, 23741, 23909, 24419, 26729, 26951, 27689, 28109, 28409, 28751, 29129
Offset: 1

Views

Author

Alex Ratushnyak, Nov 20 2013

Keywords

Examples

			3 is 11 in binary, 5 is 101. Because 11101 = 29d is a prime, 3 is in the sequence.
5 is 101 in binary, 7 is 111, and because 101111 = 47d is a prime, 5 is in the sequence.
		

Crossrefs

Formula

A232236(n) = a(n) * 2^A070939(a(n)+2) + a(n)+2.

A265370 a(0) = 0; for n >= 1, a(n) = A070939(A078510(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 16 2015

Keywords

Comments

Number of significant bits in the binary representation of n-th Spironacci number, A078510(n).

Crossrefs

Cf. also A020909.

Formula

a(0) = 0; for n >= 1, a(n) = A070939(A078510(n)).

A265918 a(n) = A070939(n) mod A000120(n), where A070939(n) is the binary length of n and A000120(n) is the binary weight of n.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 2, 1, 0, 0, 0, 2, 0, 2, 2, 1, 0, 2, 2, 1, 2, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 3, 2, 1, 1, 1, 3, 1, 3, 3
Offset: 1

Views

Author

Alex Ratushnyak, Dec 18 2015

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Mod[IntegerLength[n, 2], Total@ IntegerDigits[n, 2]], {n, 120}] (* Michael De Vlieger, Dec 21 2015 *)
  • PARI
    a(n) = #binary(n) % hammingweight(n); \\ Michel Marcus, Dec 19 2015
  • Python
    for n in range(1, 88): print((len(bin(n))-2) % bin(n).count('1'), end=', ')
    

A283982 a(0) = 0, and for n > 0, a(n) = A070939(n) - A280700(n).

Original entry on oeis.org

0, 0, 0, 1, 0, 2, 1, 0, 0, 3, 2, 1, 1, 0, 1, 1, 0, 4, 3, 2, 2, 1, 2, 2, 1, 0, 2, 2, 1, 1, 2, 1, 0, 5, 4, 3, 3, 2, 3, 3, 2, 1, 3, 3, 2, 2, 3, 2, 1, 0, 3, 3, 2, 2, 3, 2, 1, 1, 3, 2, 2, 1, 0, 2, 0, 6, 5, 4, 4, 3, 4, 4, 3, 2, 4, 4, 3, 3, 4, 3, 2, 1, 4, 4, 3, 3, 4, 3, 2, 2, 4, 3, 3, 2, 1, 3, 1, 0, 4, 4, 3, 3, 4, 3, 2, 2, 4, 3, 3, 2, 1, 3, 1, 1, 4, 3, 3, 2, 1, 3, 2
Offset: 0

Views

Author

Antti Karttunen, Mar 19 2017

Keywords

Crossrefs

Programs

Formula

a(0) = 0, for n > 0, a(n) = A070939(n) - A280700(n).
a(n) = A283981(n) - A124757(n).

A293198 a(n) is the least positive k such that f(k) = f(k + n) where f(k) = A000120(k) / A070939(k).

Original entry on oeis.org

1, 5, 1, 9, 3, 21, 1, 2, 2, 19, 2, 38, 3, 37, 1, 33, 15, 35, 38, 37, 84, 35, 76, 12, 7, 10, 9, 10, 3, 4, 1, 10, 4, 2, 5, 2, 2, 6, 5, 2, 2, 5, 2, 9, 4, 6, 5, 2, 2, 5, 2, 6, 5, 5, 2, 5, 7, 137, 138, 134, 3, 133, 1, 129, 63, 131, 134, 133, 140, 131, 138, 137, 152, 139, 134, 133, 148, 131, 146, 56, 336, 135, 150, 52
Offset: 0

Views

Author

Altug Alkan, Oct 05 2017

Keywords

Comments

Numbers m such that a(2^m*(2^(m + 1) - 1) + 1) = 2^m are 0, 1, 2, 3, 4, 5, 6, 8, 9, 11, 14, 15, 18, 20, 21, ...
Numbers t such that a(t) = 2 are 7, 8, 10, 33, 35, 36, 39, 40, 42, 47, 48, 50, ...
Numbers t such that a(t) > t are 0, 1, 3, 5, 9, 11, 13, 15, 17, 18, 19, 20, 21, ...

Examples

			a(5) = 21 because 21 = 2^4 + 2^2 + 2^0, 21 + 5 = 2^4 + 2^3 + 2^1; A000120(21) / A070939(21) = A000120(21 + 5) / A070939(21 + 5) and 21 is the least number with this property.
		

Crossrefs

Programs

  • PARI
    a(n) = {my(k=1); while (hammingweight(k+n)/#binary(k+n) != hammingweight(k) /#binary(k), k++); k;}

Formula

a(n) <> n for all n >= 0.
a(n) <= 5*n for all n >= 1.
a(2^m - 1) = 1 for all m >= 1.
a(2^m - 2^2) = 2^2 - 1 for all m >= 3.
a(2^m - 2^3) = 2^3 - 1 for all m >= 5.
a(2^m - 2^4) = 2^4 - 1 for all m >= 7.
a(2^m - 2^5) = 2^5 - 1 for all m >= 10.
a(2^m - 2^6) = 2^6 - 1 for all m >= 13.
a(2^m - 2^7) = 2^7 - 1 for all m >= 17.
a(2^m - 2^8) = 2^8 - 1 for all m >= 21.
a(2^m - 2^9) = 2^9 - 1 for all m >= 26.
a(2^(p - 1)) = 2^(p - 1) - 1 and a(2^(p - 1) - 1) = 2^p + 1 for all primes p.
a(2^(p - 1) + 1) = 2^p + 3 for all primes p >= 5.

A309576 Table read by rows: T(n, k) is the last k bits of n interpreted as a base-2 representation of a number and converted to decimal, 0 <= k <= A070939(n).

Original entry on oeis.org

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

Views

Author

Peter Kagey, Aug 08 2019

Keywords

Examples

			For n = 26 and k = 3, T(26, 3) = 2 because 26 = 11010_2, and looking at only the last three bits gives 010_2 = 2.
Table begins:
  n\k| 0 1 2 3 4
  ---+-----------
   1 | 0 1
   2 | 0 0 2
   3 | 0 1 3
   4 | 0 0 0 4
   5 | 0 1 1 5
   6 | 0 0 2 6
   7 | 0 1 3 7
   8 | 0 0 0 0 8
   9 | 0 1 1 1 9
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := BitAnd[n, 2^k-1]; Table[T[n, k], {n, 1, 20}, {k, 0, BitLength[n]}] // Flatten (* Amiram Eldar, Aug 09 2019 *)
  • Ruby
    def t(n,k); n & (1 << k) - 1 end

Formula

T(n,0) = 0 and T(n, A070939(n)) = n.
Previous Showing 21-30 of 853 results. Next