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.

A118720 Cubes which are divisible by the sum of their digits.

Original entry on oeis.org

1, 8, 27, 216, 512, 1000, 1728, 4913, 5832, 8000, 13824, 17576, 19683, 27000, 35937, 46656, 59319, 64000, 74088, 110592, 125000, 157464, 185193, 216000, 287496, 314432, 328509, 343000, 373248, 421875, 474552, 512000, 592704, 658503, 729000
Offset: 1

Views

Author

Luc Stevens (lms022(AT)yahoo.com), May 21 2006

Keywords

Comments

Intersection of A000578 and A005349. - Robert Israel, Jun 27 2017

Examples

			4913 is in the sequence because it is a cube, the sum of its digits is 4+9+1+3=17 and 4913 is divisible by 17.
		

Crossrefs

Programs

  • Maple
    select(t -> t mod convert(convert(t,base,10),`+`) = 0, map(t -> t^3, [$1..100])); # Robert Israel, Jun 28 2017
  • Mathematica
    Select[Range[100]^3,Divisible[#,Total[IntegerDigits[#]]]&]  (* Harvey P. Dale, Apr 25 2011 *)
  • PARI
    isok(n) = ispower(n,3) && ((n % sumdigits(n)) == 0); \\ Michel Marcus, Jun 28 2017

A385656 Numbers k such that the sum of the decimal digits of k^2 divides k^2.

Original entry on oeis.org

1, 2, 3, 6, 9, 10, 12, 15, 18, 20, 21, 24, 30, 36, 39, 42, 45, 48, 49, 51, 52, 54, 60, 63, 65, 66, 68, 72, 78, 80, 84, 88, 90, 96, 100, 102, 104, 105, 108, 110, 111, 112, 117, 120, 126, 132, 138, 140, 144, 148, 150, 156, 162, 168, 174, 180, 182, 190, 198, 200, 201, 204, 207
Offset: 1

Views

Author

Vighnesh Patil, Jul 06 2025

Keywords

Examples

			15 is a term 15^2 = 225; digit sum of 225 = 2 + 2 + 5 = 9; 225 mod 9 = 0, so 15 is included.
18 is a term 18^2 = 324; digit sum of 324 = 3 + 2 + 4 = 9; 324 mod 9 = 0, so 16 is included.
		

Crossrefs

Programs

  • Maple
    digitSum := n -> add(i,i=convert(n, base, 10)):
    isok := n -> modp(n^2, digitSum(n^2)) = 0:
    select(isok, [$1..400])[];
  • Mathematica
    DigitSum[n_] := Total[IntegerDigits[n]];
    Select[Range[400], Mod[#^2, DigitSum[#^2]] == 0 &]
  • PARI
    isok(k) = (k^2 % sumdigits(k^2)) == 0; \\ Michel Marcus, Jul 06 2025
  • Python
    def digit_sum(n): return sum(int(d) for d in str(n))
    def ok(n): return (n**2) % digit_sum(n**2) == 0
    print([n for n in range(1, 1000) if ok(n)])
    

Formula

a(n) = sqrt(A118547(n)). - Michel Marcus, Jul 07 2025

A339999 Squares that are divisible by both the sum of their digits and the product of their nonzero digits.

Original entry on oeis.org

1, 4, 9, 36, 100, 144, 400, 900, 1296, 2304, 2916, 3600, 10000, 11664, 12100, 14400, 22500, 32400, 40000, 41616, 82944, 90000, 121104, 122500, 129600, 152100, 176400, 186624, 202500, 219024, 230400, 260100, 291600, 360000, 419904, 435600, 504100
Offset: 1

Views

Author

Keywords

Examples

			For the perfect square 144 = 12^2, the sum of its digits is 9, which divides 144, and the product of its nonzero digits is 16, which also divides 144 so 144 is a term of the sequence.
		

Crossrefs

Intersection of A000290, A005349 and A055471.

Programs

  • Mathematica
    Select[Range[720]^2, And @@ Divisible[#, {Plus @@ (d = IntegerDigits[#]), Times @@ Select[d, #1 > 0 &]}] &] (* Amiram Eldar, Jul 23 2021 *)
  • Python
    from math import prod
    def sumd(n): return sum(map(int, str(n)))
    def nzpd(n): return prod([int(d) for d in str(n) if d != '0'])
    def ok(sqr): return sqr > 0 and sqr%sumd(sqr) == 0 and sqr%nzpd(sqr) == 0
    print(list(filter(ok, (i*i for i in range(1001)))))
    # Michael S. Branicky, Jul 23 2021
Showing 1-3 of 3 results.