A018829 Numbers n such that n is a substring of its square in base 5 (written in base 10).
0, 1, 5, 14, 25, 38, 125, 349, 408, 543, 625, 3125, 4743, 5292, 10888, 12196, 13201, 15625, 25509, 26460, 36536, 43614, 55038, 57837, 78125, 136888, 207889, 219698, 234783, 390625, 445663, 1090347, 1098490, 1336564, 1437874, 1720752, 1915227
Offset: 1
Crossrefs
Programs
-
Mathematica
Select[Range[0,2*10^6],SequenceCount[IntegerDigits[ #^2,5],IntegerDigits[ #,5]]>0&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 04 2019 *)