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.
1, 5, 6, 10, 50, 60, 100, 500, 600, 910, 1000, 1009, 1018, 1027, 1145, 1810, 2710, 3610, 4510, 5000, 5410, 6000, 6310, 7210, 7212, 8110, 9010, 9100, 9925, 10000, 10009, 10018, 10027, 10036, 10045, 10054, 10063, 10072, 10081, 10090, 10108, 10117, 10126, 10135
Offset: 1
Examples
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.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
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 *)
-
Python
def sd(n): return sum(map(int, str(n))) def ok(n): s = str(sd(n)); return all(s in str(t) for t in [n, n**2, n**3]) print([k for k in range(1, 10140) if ok(k)]) # Michael S. Branicky, Jan 31 2022
Extensions
a(21) and beyond from Michael S. Branicky, Jan 31 2022