- Listmillion[k_]:=Select[Range@1000000,Take[IntegerDigits[#^2,k],-Length@IntegerDigits[#,k]]==IntegerDigits[#,k]&];
- For[n = 2, n < 11, n++, Print[{n, Listmillion[n!]}]]
复制代码
{2,{1}}
{3,{1,3,4,9,28,81,136,1216,6561,16768,29889,76545,203392,636417}}
{4,{1,9,16,64,513,13312,151552,180225}}
{5,{1,16,25,40,81,96,105,576,6400,6976,7425,8001,13825,165376,512001,677376}}
{6,{1,81,145,225,496,576,640,6400,180225,186625,331776,338176,512001}}
{7,{1,225,721,945,1296,2016,2080,2241,2800,2961,3025,3745,4096,4320,4816,512001}}
{8,{1,4096,5761,8065,9856,12160,13825,17920,22401,26496,28161,30465,32256,34560,36225}}
{9,{1,58240,72576,76545,130816,134785,149121,155520,207361,213760,228096,232065,286336,290305,304641}}
{10,{1,512001,518400,856576}} |