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.
%I A381720 #40 May 19 2025 16:32:40 %S A381720 0,1,2,4,8,16,32,64,128,255,256,383,447,479,495,503,507,509,510,512, %T A381720 639,703,735,751,759,763,765,766,831,863,879,887,891,893,894,927,943, %U A381720 951,955,957,958,975,983,987,989,990,999,1003,1005,1006,1011,1013,1014 %N A381720 Integers whose Hamming weight is a cube. %C A381720 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)]. %C A381720 The powers of 2 (A000079) are terms. %C A381720 A023690 is a subsequence. %H A381720 Robert Israel, <a href="/A381720/b381720.txt">Table of n, a(n) for n = 1..10000</a> %e A381720 For k = 255: A000120(255) = 8 = 2^3 is a cube, thus 255 is a term. %p A381720 filter:= proc(n) type(surd(convert(convert(n,base,2),`+`),3),integer) end proc: %p A381720 select(filter, [$0..2000]); # _Robert Israel_, May 18 2025 %t A381720 Select[Range[0, 1200], IntegerQ[Surd[DigitCount[#, 2, 1], 3]] &] (* _Amiram Eldar_, Mar 05 2025 *) %o A381720 (PARI) isok(k) = ispower(hammingweight(k), 3); \\ _Michel Marcus_, Mar 05 2025 %o A381720 (Python) %o A381720 from itertools import count, islice, combinations %o A381720 from sympy import integer_nthroot %o A381720 def A381720_gen(): # generator of terms %o A381720 a = [] %o A381720 yield 0 %o A381720 for l in count(1): %o A381720 b = 1<<l-1 %o A381720 yield from sorted(sum(p)+b for i in range(1,integer_nthroot(l,3)[0]+1) for p in combinations(a,i**3-1)) %o A381720 a.append(b) %o A381720 A381720_list = list(islice(A381720_gen(),53)) # _Chai Wah Wu_, Mar 06 2025 %Y A381720 Cf. A000079, A000120, A000578, A023690. %Y A381720 Cf. A084561, A344602. %K A381720 nonn,base %O A381720 1,3 %A A381720 _Ctibor O. Zizka_, Mar 05 2025