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 A338715 #26 Jul 09 2025 04:54:27 %S A338715 11,3,7,19,11,13,17,19,421,23,127,29,31,233,37,139,41,43,47,149,151, %T A338715 53,157,59,61,163,67,269,71,73,277,79,181,83,487,89,191,193,97,199, %U A338715 101,103,107,109,2111,113,1117,3119,3121,1123,127,1129,131,4133,137,139,2141,2143,5147,149,151,1153,157 %N A338715 Smallest prime ending with decimal expansion of n, for n relatively prime to 10. %C A338715 a(n) exists by Dirichlet's theorem. %H A338715 Robert Israel, <a href="/A338715/b338715.txt">Table of n, a(n) for n = 1..10000</a> %H A338715 <a href="/index/Pri#piden">Index entries for primes involving decimal expansion of n</a> %p A338715 N:= 100: # for a(1) to a(N) %p A338715 V:= Vector(N): %p A338715 count:= 0: %p A338715 for n from 1 while count < N do %p A338715 if igcd(n,10)=1 then %p A338715 count:= count+1; %p A338715 d:= ilog10(n)+1; %p A338715 for x from n by 10^d do %p A338715 if isprime(x) then V[count]:= x; break fi %p A338715 od %p A338715 fi %p A338715 od: %p A338715 convert(V,list); # _Robert Israel_, Nov 11 2020 %o A338715 (Python) %o A338715 from sympy import isprime %o A338715 def a(n): %o A338715 ending = 2*n - 1 + (n+1)//4 * 2 # A045572 %o A338715 i, pow10 = ending, 10**len(str(ending)) %o A338715 while not isprime(i): i += pow10 %o A338715 return i %o A338715 print([a(n) for n in range(1, 64)]) # _Michael S. Branicky_, Nov 03 2021 %Y A338715 Cf. A045572, A105888 (base 2 equivalent), A258190. %Y A338715 See A245193, A337834, A338716 for other versions. %K A338715 nonn,base,look %O A338715 1,1 %A A338715 _N. J. A. Sloane_, Nov 11 2020 %E A338715 More terms from _Robert Israel_, Nov 11 2020