login
a(n) is the least exponent k such that the decimal representation of n occurs at exactly n positions within the decimal representation of n^k, or -1 if this is not possible.
2

%I #12 Nov 01 2024 16:29:59

%S 1,18,21,32,30,38,33,55,69,-1,484,588,619,402,667,814,785,786,835,

%T 2841,881,960,1167,857,1230,1144,1028,1244,1395,3857,1484,1295,1526,

%U 1546,1524,1633,1377,1739,1645,4410,1837,1677,1719,1811,1782,1954,1971,2179,2392,5054

%N a(n) is the least exponent k such that the decimal representation of n occurs at exactly n positions within the decimal representation of n^k, or -1 if this is not possible.

%H Hugo Pfoertner, <a href="/A377163/b377163.txt">Table of n, a(n) for n = 1..125</a>

%o (PARI) findstr(m,n) = my(dm=digits(m), dn=digits(n)); sum(j=1, #dm-#dn+1, dn==dm[j..j+#dn-1]);

%o a377163(n) = if(n>1 && n==10^valuation(n,10), -1, for(x=1, oo, if(findstr(n^x,n)==n, return(x))))

%Y A244603 are the terms a(1)..a(9).

%Y Cf. A011557, A377164.

%K base,sign

%O 1,2

%A _Hugo Pfoertner_, Nov 01 2024