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!)
A213885 Number of prime numbers of the form (10^k-1)*10^n-1 with 0<k<=2*n 2

%I #10 Jul 20 2012 11:28:51

%S 1,0,3,1,3,2,2,2,5,1,2,2,0,4,1,2,2,2,5,0,7,2,2,3,2,4,0,2,3,2,2,5,2,2,

%T 4,0,2,3,0,2,0,1,4,1,3,1,4,2,1,4,5,1,4,2,0,1,4,3,3,3,5,1,1,3,1,3,1,2,

%U 5,4,2,1,2,3,1,4,2,2,1,1,5,2,2,2,0,2,2,1,3,4,3,5,4,1,1,2,3,2,4,1

%N Number of prime numbers of the form (10^k-1)*10^n-1 with 0<k<=2*n

%C The condition k<=2*n sets a limit of the numbers to be checked for primeness.

%C The sequence counts a subset of the primes considered in A213886.

%C Statistics over n=1 to 1000: 105 values of a(n) are zero, the average value of a(n) is 2.33.

%H Pierre CAMI, <a href="/A213885/b213885.txt">Table of n, a(n) for n = 1..1000</a>

%e (10^1-1)*10-1=89 prime

%e (10^2-1)*10^1-1=989 composite so a(1)=1

%e (10^1-1)*10^2-1=899 composite

%e (10^2-1)*10^2-1=9899 composite

%e (10^3-1)*10^2-1=99899 composite

%e (10^4-1)*10^2-1=999899 composite so a(2)=0

%p A213885 := proc(n)

%p local a,k;

%p a := 0 ;

%p for k from 1 to 2*n do

%p if isprime((10^k-1)*10^n-1) then

%p a := a+1 ;

%p end if;

%p end do:

%p return a;

%p end proc: # _R. J. Mathar_, Jul 19 2012

%o (PFGW64 and SCRIPTIFY)

%o SCRIPT

%o DIM nn,0

%o DIM kk

%o DIMS tt

%o OPENFILEOUT myfile,a(n).txt

%o LABEL loopn

%o SET nn,nn+1

%o IF nn>1000 THEN END

%o SET kk,0

%o LABEL loopk

%o SET kk,kk+1

%o IF kk>2*nn THEN GOTO loopn

%o SETS tt,%d,%d\,;nn;kk

%o PRP (10^kk-1)*10^nn-1,tt

%o IF ISPRP THEN GOTO a

%o IF ISPRIME THEN GOTO a

%o GOTO loopk

%o LABEL a

%o WRITE myfile,tt

%o GOTO loopk

%K nonn

%O 1,3

%A _Pierre CAMI_, Jul 10 2012

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 April 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)