The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A213886 Number of prime numbers of the form (10^k-j)*10^n-1 with 0<k<=2*n and 0<j<9. 2
7, 7, 11, 10, 15, 7, 10, 13, 19, 13, 10, 11, 9, 16, 10, 7, 10, 9, 15, 13, 17, 17, 18, 4, 10, 14, 7, 11, 8, 12, 16, 15, 18, 10, 17, 8, 12, 8, 6, 13, 7, 9, 15, 8, 12, 10, 18, 5, 3, 11, 18, 9, 18, 14, 10, 13, 15, 13, 12, 8, 11, 8, 10, 8 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
The condition k<=2*n means we are setting an upper limit to the set of numbers to be checked given some n.
The condition 0<j<9 says we are only interested in near repdigit 9 primes, in practice only j = 1, 2, 4, 5, 7 or 8 seem to occur.
Statistics of entries over the range n=1 to 1000: all a(n) are > 0, with a minimum of 3 and a maximum of 27. The average of the a(n) is 12.
LINKS
EXAMPLE
a(1)=7 counts 89, 79, 59, 29, 19, 929 and 919.
a(2)=7 counts 599, 499, 199, 9199, 999599, 999499 and 999199.
MAPLE
A213886 := proc(n)
local a, k, j;
a := 0 ;
for k from 1 to 2*n do
for j from 1 to 8 do
if isprime((10^k-j)*10^n-1) then
a := a+1 ;
end if;
end do:
end do:
return a;
end proc: # R. J. Mathar, Jul 19 2012
PROG
(PFGW64 and SCRIPTIFY)
SCRIPT
DIM nn, 0
DIM kk
DIM jj
DIM cc, 0
DIMS tt
OPENFILEOUT myfile, a(n).txt
LABEL loopn
SET nn, nn+1
IF nn>1000 THEN END
SET cc, 0
SET kk, 0
LABEL loopk
SET kk, kk+1
IF kk>2*nn THEN GOTO a
SET jj, 9
LABEL loopj
SET jj, jj-1
IF jj%3==0 THEN SET jj, jj-1
IF jj<0 THEN GOTO loopk
SETS tt, %d, %d\,; nn; cc
PRP (10^kk-jj)*10^nn-1, tt
IF ISPRP THEN SET cc, cc+1
IF ISPRIME THEN SET cc, cc+1
GOTO loopj
LABEL a
WRITE myfile, tt
GOTO loopn
CROSSREFS
Sequence in context: A084513 A084523 A336019 * A053673 A204910 A152672
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jul 10 2012
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 4 19:35 EDT 2024. Contains 373102 sequences. (Running on oeis4.)