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

A178065 Number of 1's in binary representation of n-th semiprime.

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, May 18 2010

Keywords

Examples

			a(1)=1 because the first semiprime is 4 = 100_2.
a(2)=2 because the second semiprime is 6 = 110_2.
		

Crossrefs

Programs

  • Maple
    N:= 10^3: # for semiprimes <= N
    P:= select(isprime,[2,seq(i,i=3..N/2,2)]):
    SP:= sort(select(`<=`,[seq(seq(P[i]*P[j],j=1..i),i=1..nops(P))],N)):
    map(t -> convert(convert(t,base,2),`+`), SP); # Robert Israel, Feb 02 2025
  • Mathematica
    s={};Do[If[PrimeOmega[n]==2,AppendTo[s,Total[IntegerDigits[n,2]]]],{n,400}];s (* James C. McMahon, Jan 02 2025 *)
  • PARI
    lista(nn) = {for (n=2, nn, if (bigomega(n)==2, print1(norml2(binary(n)), ", ")););} \\ Michel Marcus, Jun 05 2013

Extensions

a(56) corrected by R. J. Mathar, May 23 2010

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