A270343 Numbers k that end with ( sum of digits of k )^2.
0, 1, 81, 3144, 3256, 6225, 6484, 6576, 7121, 7529, 7676, 9100, 9324, 9361, 9729, 9784, 12144, 12256, 15225, 15484, 15576, 16121, 16529, 16676, 18100, 18324, 18361, 18729, 18784, 21144, 21256, 24225, 24484, 24576, 25121
Offset: 1
Examples
For k=3256, sum of digits is 16 and 16^2 is 256. For k=7121, sum of digits is 11 and 11^2 is 121. For k=18784, sum of digits is 22 and 22^2 is 484.
Links
- Paolo P. Lava, Table of n, a(n) for n = 1..10000
- Soumil Mandal, Graph Of Sum Of Digits
- Soumil Mandal, Graph Of Cumulative Sums
Programs
-
Mathematica
Select[Range[0, 20000], Function[n, Function[k, If[n >= k, FromDigits@ Take[#, -IntegerLength@ k] == k, False]][Total[#]^2] &@ IntegerDigits@ n]] (* Michael De Vlieger, Mar 15 2016 *) esdQ[n_]:=Module[{idn=IntegerDigits[n],idn2=IntegerDigits[ Total[ IntegerDigits[ n]]^2]},Take[ idn,-Length[idn2]]==idn2]; Select[ Range[ 0,26000],esdQ]//Quiet (* Harvey P. Dale, Jan 01 2022 *)
-
PARI
isok(n) = {sds = sumdigits(n)^2; nbs = #Str(sds); ((n - sds) % 10^nbs) == 0;} \\ Michel Marcus, Mar 16 2016
-
Python
for i in range(0,200000): res = pow((sum(map(int,str(i)))),2) if(i%pow(10,len(str(res)))==res):print(i) # Soumil Mandal, Mar 17 2016
Comments