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.

A270343 Numbers k that end with ( sum of digits of k )^2.

This page as a plain text file.
%I A270343 #73 Mar 03 2024 10:14:29
%S A270343 0,1,81,3144,3256,6225,6484,6576,7121,7529,7676,9100,9324,9361,9729,
%T A270343 9784,12144,12256,15225,15484,15576,16121,16529,16676,18100,18324,
%U A270343 18361,18729,18784,21144,21256,24225,24484,24576,25121
%N A270343 Numbers k that end with ( sum of digits of k )^2.
%C A270343 All terms end with a digit from the set S = {0,1,4,5,6,9}.
%C A270343 The sum of the digits of the numbers repeat and also change with regular intervals. For example, the sum of the digits S1 = {12,16,15,22,24,11,23,26,10,18,19,27,28} which is followed by 3144 to 8784, 12144 to 18784, 21144 to 27784, 30144 to 36784. Again S2 = {21,25,15,22,24,11,23,26,10,18,19,27,28} is followed by 39441 to 45784, 48441 to 54784, 57441 to 67784, 66441 to 72784. It can be seen that a set containing 13 elements repeats itself for 4 consecutive ranges.
%H A270343 Paolo P. Lava, <a href="/A270343/b270343.txt">Table of n, a(n) for n = 1..10000</a>
%H A270343 Soumil Mandal, <a href="https://github.com/soumilmandal/DOCUMENTS/blob/master/TRENCHIC/trenchic.png">Graph Of Sum Of Digits</a>
%H A270343 Soumil Mandal, <a href="https://github.com/soumilmandal/DOCUMENTS/blob/master/TRENCHIC/CumulativeSums.png">Graph Of Cumulative Sums</a>
%e A270343 For k=3256, sum of digits is 16 and 16^2 is 256.
%e A270343 For k=7121, sum of digits is 11 and 11^2 is 121.
%e A270343 For k=18784, sum of digits is 22 and 22^2 is 484.
%t A270343 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 *)
%t A270343 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 *)
%o A270343 (PARI) isok(n) = {sds = sumdigits(n)^2; nbs = #Str(sds); ((n - sds) % 10^nbs) == 0;} \\ _Michel Marcus_, Mar 16 2016
%o A270343 (Python)
%o A270343 for i in range(0,200000):
%o A270343     res = pow((sum(map(int,str(i)))),2)
%o A270343     if(i%pow(10,len(str(res)))==res):print(i)
%o A270343 # _Soumil Mandal_, Mar 17 2016
%Y A270343 Cf. A003226, A008851, A018247, A118881.
%K A270343 base,nonn,easy
%O A270343 1,3
%A A270343 _Soumil Mandal_, Mar 15 2016