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.
%I A320775 #77 Jun 11 2025 14:58:49 %S A320775 21,41,24,33,171,361,461,471,1281,1091,231,221,236,61,861,2761,241, %T A320775 546,3261,1991,6081,421,9541,5731,4461,1621,21501,10381,5051,1301, %U A320775 16301,30051,18601,13601,3171,8991,7561,3201,33501,8701,17351,5601,13551,901,10301,871 %N A320775 a(n) is the least exponent k greater than 1 such that prime(n)^k starts and ends in prime(n). %C A320775 a(n) always exists. Let p be a prime other than 2 or 5, and m its length in base 10. Let r be the multiplicative order of p mod 10^m. Then p^k ends in p if and only if k-1 is a multiple of r. p^(j*r+1) starts with p if and only if for some integer s, s + log_10(p)) <= (j*r+1)*log_10(p) < s + frac(log_10(p+1)). This is true for some j because r*log_10(p) is irrational and the fractional parts of the multiples of an irrational number are dense in [0,1]. - _Robert Israel_, Dec 12 2018 %C A320775 If all integers are considered instead of only primes, not all of them can satisfy the requirement. For instance see A075823 for two digits numbers. %C A320775 Record values beyond 10^5 are: a(51) = 138801, a(74) = 193701, a(88) = 1766101. Also, a(98) = 282076 and a(100) = 438501 would be record values if not preceded by a(88). - _M. F. Hasler_, Dec 14 2018 %H A320775 M. F. Hasler, <a href="/A320775/b320775.txt">Table of n, a(n) for n = 1..100</a> %H A320775 Carlos Rivera, <a href="https://www.primepuzzles.net/puzzles/puzz_934.htm">Puzzle 934. The prime 7499</a>, The Prime Puzzles and Problems Connection. %H A320775 Carlos Rivera, <a href="https://www.primepuzzles.net/conjectures/conj_081.htm">Conjecture 81</a>, The Prime Puzzles and Problems Connection. %e A320775 2^21 = 2097152 and 21 is the least exponent; %e A320775 3^41 = 36472996377170786403 and 41 is the least exponent. %p A320775 f:= proc(n) local p, k,m,q,r; %p A320775 p:= ithprime(n); %p A320775 m:= ilog10(p)+1; %p A320775 q:= numtheory:-order(p,10^m); %p A320775 for k from q+1 by q do %p A320775 r:= p^k; %p A320775 if p = floor(r/10^(ilog10(r)+1-m)) %p A320775 then return k %p A320775 fi; %p A320775 od %p A320775 end proc: %p A320775 f(1):= 21: f(3):= 24: %p A320775 map(f, [$1..50]); # _Robert Israel_, Dec 12 2018 %t A320775 a[p_] := Module[{d=IntegerDigits[p]}, nd=Length[d];k=2; While[IntegerDigits[p^k][[1;;nd]] != d || IntegerDigits[p^k][[-nd;;-1]] != d, k++]; k]; a/@Prime@Range@10 (* _Amiram Eldar_, Dec 10 2018 *) %o A320775 (PARI) isokd(d, dpk) = {for (i=1, #d, if (dpk[i] != d[i], return (0));); return (1);} %o A320775 isok(p, k) = {my(dpk=digits(p^k), d = digits(p)); if (!isokd(d, dpk), return (0)); isokd(Vecrev(d), Vecrev(dpk));} %o A320775 a(n) = {my(k=2, p = prime(n)); while (!isok(p, k), k++); k;} \\ _Michel Marcus_, Dec 10 2018 %o A320775 (PARI) apply( {A320775(n, d=logint(n=prime(n), 10)+1, K=if(n>5||n==3,znorder(Mod(n, 10^d)),n+18), f(x)=x\10^(logint(x, 10)+1-d))=forstep(k=1+K,oo,K, n==f(n^k)&&return(k))}, [1..20]) \\ Define A320775 & test it via apply(). - _M. F. Hasler_, Dec 10 2018 %Y A320775 Cf. A000040, A075823, A182944. %K A320775 nonn,base %O A320775 1,1 %A A320775 _Paolo P. Lava_, Dec 03 2018