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 A213884 #25 Jan 16 2025 11:52:56 %S A213884 1,4,1,2,2,5,1,2,1,2,1,4,4,5,5,1,4,7,1,4,2,4,4,1,2,8,7,4,1,1,2,1,1,4, %T A213884 7,4,1,1,7,4,8,2,7,4,8,8,7,2,2,1,8,2,8,5,7,1,8,4,8,1,4,1,4,7,1,2,8,2, %U A213884 4,1,4,8,4,5,8,2,1,2,7,7,5,1,4,8,7,4,1,4,2,2,4,5 %N A213884 For the smallest k >= 1, the smallest single-digit j such that (10^k-j)*10^n-1 is prime. %C A213884 These j are the associated shifts to be paired with the k-values of A213883. There are no multiples of 3 here, as explained in A213883. %C A213884 For the first 2200 values of n, there is always at least one pair (k,j) that delivers a prime with the conditions. %H A213884 Pierre CAMI, <a href="/A213884/b213884.txt">Table of n, a(n) for n = 1..2200</a> %e A213884 j=1 associated with the prime 89, j=4 associated with 599, j=1 associated with 8999, j=2 with 79999 are the first 4 entries. %p A213884 A213884 := proc(n) %p A213884 for k from 1 do %p A213884 for j from 0 to 9 do %p A213884 if isprime( (10^k-j)*10^n-1) then %p A213884 return j; %p A213884 end if; %p A213884 end do: %p A213884 end do: %p A213884 return 0 ; %p A213884 end proc: # _R. J. Mathar_, Jul 20 2012 %o A213884 (PFGW & SCRIPT) %o A213884 SCRIPT %o A213884 DIM nn, 0 %o A213884 DIM jj %o A213884 DIM kk %o A213884 DIMS tt %o A213884 OPENFILEOUT myfile, a(n).txt %o A213884 LABEL loopn %o A213884 SET nn, nn+1 %o A213884 IF nn>2200 THEN END %o A213884 SET kk, 0 %o A213884 LABEL loopk %o A213884 SET kk, kk+1 %o A213884 IF kk>2*nn THEN GOTO loopn %o A213884 SET jj, 0 %o A213884 LABEL loopj %o A213884 SET jj, jj+1 %o A213884 IF jj%3==0 THEN SET jj, jj+1 %o A213884 IF jj>9 THEN GOTO loopk %o A213884 SETS tt, %d, %d, %d\,; nn; kk; jj %o A213884 PRP (10^kk-jj)*10^nn-1, tt %o A213884 IF ISPRP THEN GOTO a %o A213884 IF ISPRIME THEN GOTO a %o A213884 GOTO loopj %o A213884 LABEL a %o A213884 WRITE myfile, tt %o A213884 GOTO loopn %Y A213884 Cf. A213883. %K A213884 nonn %O A213884 1,2 %A A213884 _Pierre CAMI_, Jun 29 2012