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.

A162017 Numbers k such that the sum of the decimal digits of k is a substring of k, of k^2 and of k^3.

This page as a plain text file.
%I A162017 #18 Jun 16 2025 14:51:52
%S A162017 1,5,6,10,50,60,100,500,600,910,1000,1009,1018,1027,1145,1810,2710,
%T A162017 3610,4510,5000,5410,6000,6310,7210,7212,8110,9010,9100,9925,10000,
%U A162017 10009,10018,10027,10036,10045,10054,10063,10072,10081,10090,10108,10117,10126,10135
%N A162017 Numbers k such that the sum of the decimal digits of k is a substring of k, of k^2 and of k^3.
%H A162017 Michael S. Branicky, <a href="/A162017/b162017.txt">Table of n, a(n) for n = 1..10000</a>
%e A162017 1145 is a term because its digital sum is 1+1+4+5 = 11 and "11" is a substring of 1145, of 1145^2 = 1311025 and of 1145^3 = 1501123625.
%t A162017 sddQ[n_]:=With[{d=IntegerDigits[Total[IntegerDigits[n]]]},SequenceCount[IntegerDigits[n],d]>0&&SequenceCount[IntegerDigits[n^2],d]>0&&SequenceCount[IntegerDigits[n^3],d]>0]; Select[Range[11000],sddQ] (* _Harvey P. Dale_, Jun 16 2025 *)
%o A162017 (Python)
%o A162017 def sd(n): return sum(map(int, str(n)))
%o A162017 def ok(n): s = str(sd(n)); return all(s in str(t) for t in [n, n**2, n**3])
%o A162017 print([k for k in range(1, 10140) if ok(k)]) # _Michael S. Branicky_, Jan 31 2022
%Y A162017 Cf. A052018, A162016.
%K A162017 nonn,base
%O A162017 1,2
%A A162017 _Claudio Meller_, Jun 24 2009
%E A162017 a(21) and beyond from _Michael S. Branicky_, Jan 31 2022