A small VBA code to get these numbers:
- SubMain()
- Dimi&,j&,k&,n&,num&,a(100000000)AsByte,p(1To10000000)AsLong
- num=1
- p(num)=2'The1stprime
- n=100000000'10^8
- k=Int(Sqr(n))'sqrarerootofn
- Fori=3TokStep2
- Ifa(i)=0Then
- num=num+1
- p(num)=i
- IfInStr(i,num)ThenDebug.Print"P("&num&")="&i
- Forj=i*iTonStep2*i'Eractosthenes
- a(j)=100'Notprimenumber
- Next
- EndIf
- Next
- Fori=k+1TonStep2'Listallprimenumberstoarrayp()
- Ifa(i)=0Then
- num=num+1
- 'p(num)=i
- IfInStr(i,num)ThenDebug.Print"P("&num&")="&i
- EndIf
- Next
- EndSub
It returns:
P(7)=17
P(6455)=64553
P(6456)=64567
P(6457)=64577
P(6459)=64591
P(6460)=64601
P(6466)=64661
P(9551)=99551
P(303027)=4303027
P(440999)=6440999
P(968819)=14968819
P(5517973)=95517973