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.

A175396 Numbers whose sum of squares of digits is a square.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 34, 40, 43, 50, 60, 68, 70, 80, 86, 90, 100, 122, 148, 184, 200, 212, 221, 236, 244, 263, 269, 296, 300, 304, 326, 340, 362, 366, 400, 403, 418, 424, 430, 442, 447, 474, 481, 488, 500, 600, 608, 623, 629, 632, 636, 663
Offset: 1

Views

Author

Ctibor O. Zizka, Apr 30 2010

Keywords

Comments

Previous name: Numbers n such that Sum_{i=1..r, x(i)^2} is a perfect square, where x(i) = digits of n. r=1+floor(log_10 n).

Examples

			34 is a term: 3^2 + 4^2 = 25 = 5^2.
122 is a term: 1^2 + 2^2 + 2^2 = 9 = 3^2.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 666], IntegerQ[Sqrt[Plus @@ (IntegerDigits[#]^2)]] &] (* Ivan Neretin, Aug 03 2015 *)
  • PARI
    isok(n) = {my(digs = digits(n)); issquare(sum(i=1, #digs, digs[i]^2))} \\ Michel Marcus, Jun 02 2013
    
  • Python
    from math import isqrt
    def ok(n): s = sum(int(i)**2 for i in str(n)); return isqrt(s)**2 == s
    print(*[k for k in range(664) if ok(k)], sep = ', ')  # Ya-Ping Lu, Jul 07 2025

Extensions

Corrected and extended by Neven Juric, Jul 12 2010
Simpler definition by Michel Marcus, Jun 02 2013

A348906 Squares with a square number of 1's in their binary expansion.

Original entry on oeis.org

0, 1, 4, 16, 64, 169, 225, 256, 676, 900, 1024, 2209, 2704, 3600, 4096, 5625, 7921, 8836, 10201, 10816, 12321, 13689, 14400, 16384, 19321, 20449, 22201, 22500, 23409, 26569, 27889, 28561, 29929, 30625, 31684, 32041, 35344, 38809, 40401, 40804, 43264, 49284, 52441
Offset: 1

Views

Author

Ctibor O. Zizka, Nov 03 2021

Keywords

Comments

If a number k is of the form 2^(2*r), r >= 0, then k is included in this sequence.

Examples

			225 is in the sequence because it is a square and the number of 1's in the binary expansion of 225 is 4 which is a square.
		

Crossrefs

Intersection of A000290 and A084561.

Programs

  • Maple
    q:= n-> issqr(add(i, i=Bits[Split](n))):
    select(q, [i^2$i=0..250])[];  # Alois P. Heinz, Nov 03 2021
  • Mathematica
    Select[Range[0, 300]^2, IntegerQ @ Sqrt[DigitCount[#, 2, 1]] &] (* Amiram Eldar, Nov 03 2021 *)
  • PARI
    isok(k) = issquare(k) && issquare(hammingweight(k)); \\ Michel Marcus, Nov 03 2021

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