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.

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

This page as a plain text file.
%I A385656 #25 Jul 09 2025 16:50:05
%S A385656 1,2,3,6,9,10,12,15,18,20,21,24,30,36,39,42,45,48,49,51,52,54,60,63,
%T A385656 65,66,68,72,78,80,84,88,90,96,100,102,104,105,108,110,111,112,117,
%U A385656 120,126,132,138,140,144,148,150,156,162,168,174,180,182,190,198,200,201,204,207
%N A385656 Numbers k such that the sum of the decimal digits of k^2 divides k^2.
%H A385656 Vighnesh Patil, <a href="/A385656/b385656.txt">Table of n, a(n) for n = 1..1000</a>
%F A385656 a(n) = sqrt(A118547(n)). - _Michel Marcus_, Jul 07 2025
%e A385656 15 is a term 15^2 = 225; digit sum of 225 = 2 + 2 + 5 = 9; 225 mod 9 = 0, so 15 is included.
%e A385656 18 is a term 18^2 = 324; digit sum of 324 = 3 + 2 + 4 = 9; 324 mod 9 = 0, so 16 is included.
%p A385656 digitSum := n -> add(i,i=convert(n, base, 10)):
%p A385656 isok := n -> modp(n^2, digitSum(n^2)) = 0:
%p A385656 select(isok, [$1..400])[];
%t A385656 DigitSum[n_] := Total[IntegerDigits[n]];
%t A385656 Select[Range[400], Mod[#^2, DigitSum[#^2]] == 0 &]
%o A385656 (Python)
%o A385656 def digit_sum(n): return sum(int(d) for d in str(n))
%o A385656 def ok(n): return (n**2) % digit_sum(n**2) == 0
%o A385656 print([n for n in range(1, 1000) if ok(n)])
%o A385656 (PARI) isok(k) = (k^2 % sumdigits(k^2)) == 0; \\ _Michel Marcus_, Jul 06 2025
%Y A385656 Cf. A005349, A007953, A034706, A118547, A385640.
%K A385656 nonn,base,easy
%O A385656 1,2
%A A385656 _Vighnesh Patil_, Jul 06 2025