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.

A344603 Triangular numbers whose Hamming weight is also triangular.

Original entry on oeis.org

0, 1, 21, 28, 190, 231, 276, 378, 435, 630, 741, 903, 946, 1326, 1540, 1596, 1830, 1953, 2016, 2278, 2701, 4278, 4465, 5460, 5778, 5886, 6328, 6441, 6670, 6903, 8646, 11026, 11781, 11935, 12246, 12720, 15225, 15400, 15931, 16471, 17391, 17578, 17955, 18336, 20100
Offset: 1

Views

Author

Michel Marcus, May 24 2021

Keywords

Crossrefs

Cf. A000120.
Intersection of A000217 and A344602.

Programs

  • Maple
    q:= n-> issqr(8*add(i, i=Bits[Split](n))+1):
    select(q, [j*(j+1)/2$j=0..200])[];  # Alois P. Heinz, May 24 2021
  • Mathematica
    Select[Table[n*(n + 1)/2, {n, 0, 200}], IntegerQ @ Sqrt[8 * Plus @@ IntegerDigits[#, 2] + 1] &] (* Amiram Eldar, May 24 2021 *)
    Select[Accumulate[Range[0,200]],OddQ[Sqrt[8 DigitCount[#,2,1]+1]]&] (* Harvey P. Dale, Feb 19 2023 *)
  • PARI
    isok(n) = ispolygonal(n, 3) && ispolygonal(hammingweight(n), 3);

A381720 Integers whose Hamming weight is a cube.

Original entry on oeis.org

0, 1, 2, 4, 8, 16, 32, 64, 128, 255, 256, 383, 447, 479, 495, 503, 507, 509, 510, 512, 639, 703, 735, 751, 759, 763, 765, 766, 831, 863, 879, 887, 891, 893, 894, 927, 943, 951, 955, 957, 958, 975, 983, 987, 989, 990, 999, 1003, 1005, 1006, 1011, 1013, 1014
Offset: 1

Views

Author

Ctibor O. Zizka, Mar 05 2025

Keywords

Comments

The plot of terms of the form k - 2^floor(log_2(k)) shows quasi-periodic structures on the intervals [2^i, 2^(i+1)]. In general, all sequences of the form "Integers whose Hamming weight is f(x)", where f(x) is an integer valued function, are quasi-periodic on intervals [2^i, 2^(i+1)].
The powers of 2 (A000079) are terms.
A023690 is a subsequence.

Examples

			For k = 255: A000120(255) = 8 = 2^3 is a cube, thus 255 is a term.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) type(surd(convert(convert(n,base,2),`+`),3),integer) end proc:
    select(filter, [$0..2000]); # Robert Israel, May 18 2025
  • Mathematica
    Select[Range[0, 1200], IntegerQ[Surd[DigitCount[#, 2, 1], 3]] &] (* Amiram Eldar, Mar 05 2025 *)
  • PARI
    isok(k) = ispower(hammingweight(k), 3); \\ Michel Marcus, Mar 05 2025
    
  • Python
    from itertools import count, islice, combinations
    from sympy import integer_nthroot
    def A381720_gen(): # generator of terms
        a = []
        yield 0
        for l in count(1):
            b = 1<A381720_list = list(islice(A381720_gen(),53)) # Chai Wah Wu, Mar 06 2025
Showing 1-2 of 2 results.