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.

A212314 Numbers m such that B(m^3) = 3*B(m), where B(m) is the binary weight of m (A000120).

Original entry on oeis.org

0, 5, 9, 10, 17, 18, 20, 33, 34, 36, 39, 40, 49, 65, 66, 68, 69, 72, 78, 80, 98, 105, 129, 130, 132, 135, 136, 138, 144, 156, 160, 169, 196, 199, 209, 210, 229, 257, 258, 260, 263, 264, 270, 272, 276, 277, 288, 291, 297, 312, 313, 320, 338, 359, 365, 392, 395, 398, 418
Offset: 1

Views

Author

Alex Ratushnyak, Oct 24 2013

Keywords

Comments

2*k is a term if and only if k is a term. - Robert Israel, Nov 06 2022

Crossrefs

Programs

  • Maple
    select(n -> convert(convert(n^3,base,2),`+`) = 3*convert(convert(n,base,2),`+`), [$0..1000]); # Robert Israel, Nov 06 2022
  • PARI
    isok(m) = hammingweight(m^3) == 3*hammingweight(m); \\ Michel Marcus, Nov 06 2022
  • Python
    import math
    for n in range(10000):
        c1 = c2 = 0
        t = n
        while t:
            c1+=t&1
            t>>=1
        t = n*n*n
        while t:
            c2+=t&1
            t>>=1
        if c1*3==c2: print(str(n), end=',')
    
  • Sage
    s = lambda n: sum((n^3).digits(2)) - 3*sum(n.digits(2))
    [n for n in (0..418) if s(n)==0]  # Peter Luschny, Oct 24 2013
    

Formula

A000120(a(n)^3) = A000120(a(n)) * 3.

A382631 Integers whose binary representation contains exactly four 1's, no two 1's being adjacent.

Original entry on oeis.org

85, 149, 165, 169, 170, 277, 293, 297, 298, 325, 329, 330, 337, 338, 340, 533, 549, 553, 554, 581, 585, 586, 593, 594, 596, 645, 649, 650, 657, 658, 660, 673, 674, 676, 680, 1045, 1061, 1065, 1066, 1093, 1097, 1098, 1105, 1106, 1108, 1157, 1161, 1162, 1169, 1170
Offset: 1

Views

Author

Chai Wah Wu, Apr 07 2025

Keywords

Comments

Subsequence of A003714 and of A014312.

Examples

			85 = 1010101_2, 1066 = 10000101010_2.
		

Crossrefs

Programs

  • Python
    def A382631_gen(): # generator of terms
        n = 15
        yield 85
        while True: yield int(bin(n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b)[2:].replace('1','01'),2)
    A382631_list = list(islice(A382631_gen(),30))
Showing 1-2 of 2 results.