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-3 of 3 results.

A102029 Smallest semiprime with Hamming weight n (i.e., smallest semiprime with exactly n ones when written in binary), or -1 if no such number exists.

Original entry on oeis.org

4, 6, 14, 15, 55, 95, 247, 447, 511, 1535, 2047, 7167, 12287, 32255, 49151, 98303, 196607, 393215, 983039, 1572863, 3145727, 6291455, 8388607, 33423359, 50331647, 117440511, 201326591, 528482303, 805306367, 1879048191, 3221225471
Offset: 1

Views

Author

Jonathan Vos Post, Jun 23 2007

Keywords

Comments

Semiprime analog of A061712. Extended by Stefan Steinerberger. Includes the subset Mersenne semiprimes A092561.

Examples

			a(1) = 4 because the first semiprime A001358(1) is 4 (base 10) which is written 100 in binary, the latter representation having exactly 1 one.
a(2) = 6 since A001358(2) = 6 = 110 (base 2) has exactly 2 ones.
a(4) = 15 since A001358(6) = 15 = 1111 (base 2) has exactly 4 ones and, as it also has no zeros, is the smallest of the Mersenne semiprimes.
		

Crossrefs

Programs

  • Mathematica
    Join[{4},Table[SelectFirst[Sort[FromDigits[#,2]&/@Permutations[ Join[ PadRight[{}, n,1],{0}]]],PrimeOmega[#]==2&],{n,2,40}]] (* Harvey P. Dale, Feb 06 2015 *)

A140330 Smallest nonprime with Hamming weight n (i.e., with exactly n 1's when written in binary).

Original entry on oeis.org

1, 6, 14, 15, 55, 63, 247, 255, 511, 1023, 2047, 4095, 12287, 16383, 32767, 65535, 196607, 262143, 983039, 1048575, 2097151, 4194303, 8388607, 16777215, 33554431, 67108863, 134217727, 268435455, 536870911, 1073741823, 3221225471
Offset: 1

Views

Author

Jonathan Vos Post, May 26 2008

Keywords

Comments

Apart from the first term, identical to A089226. - R. J. Mathar, May 31 2008

Examples

			a(10) = 1023 because 1023 base 2 = 1111111111 which has 10 1's and 1023 = 3 * 11 * 31 is nonprime.
		

Crossrefs

Cf. A061712.

Formula

a(n) = MIN{k such that k is in A018252 and A000120(k) = n}.

Extensions

More terms from R. J. Mathar, May 31 2008

A354480 a(n) is the smallest decimal palindrome with Hamming weight n (i.e., with exactly n 1's when written in binary).

Original entry on oeis.org

0, 1, 3, 7, 77, 55, 111, 191, 383, 767, 5115, 11711, 15351, 30703, 81918, 97279, 744447, 978879, 1570751, 3665663, 8387838, 66911966, 66322366, 132111231, 199212991, 389545983, 939474939, 3204444023, 3220660223, 11542724511, 34258485243, 33788788733, 34292629243
Offset: 0

Views

Author

Ilya Gutkovskiy, Jun 02 2022

Keywords

Crossrefs

Programs

  • Python
    from itertools import count, islice, product
    def pals(startd=1): # generator for base-10 palindromes
        for d in count(startd):
            for p in product("0123456789", repeat=d//2):
                if d//2 > 0 and p[0] == "0": continue
                left = "".join(p); right = left[::-1]
                for mid in [[""], "0123456789"][d%2]:
                    yield int(left + mid + right)
    def a(n):
        for p in pals(startd=len(str(2**n-1))):
            if bin(p).count("1") == n:
                return p
    print([a(n) for n in range(33)]) # Michael S. Branicky, Jun 02 2022

Extensions

a(21)-a(32) from Michael S. Branicky, Jun 02 2022
Showing 1-3 of 3 results.