c Look for 3 consecutive primes with record setting c asymmetric location of the middle prime. c Author: Hugo Pfoertner, http://www.pfoertner.org/ c c Version history: c 29.05.2003 Initial version c implicit integer (a-z) parameter (msp=100007) c list of small primes integer sp(0:msp) doubleprecision q, qm c list taken from c http://www.utm.edu/research/primes/lists/small/100000.txt c (header lines removed) open ( unit=10, file='100000.txt', form='formatted' ) c read primes from list read (10,*) (sp(k),k=0,msp) close (unit=10) c search for decreasing quotient shorter/longer distance c to neighbor primes qm = 1.0 do 100 i = 1, msp-1 dl = sp(i)-sp(i-1) dr = sp(i+1)-sp(i) q = dble(min(dl,dr))/dble(max(dl,dr)) if ( q .lt. qm ) then qm = q write (*,1000) dl, dr, max(dl,dr), q, sp(i), i 1000 format ( 3i8, f8.5, i8, i6 ) endif 100 continue end C--------------------------------------------------------- C Results: 1 2 2 0.50000 3 1 6 2 6 0.33333 29 9 4 14 14 0.28571 113 29 2 10 10 0.20000 139 33 2 12 12 0.16667 199 45 2 18 18 0.11111 523 98 22 2 22 0.09091 1151 189 2 24 24 0.08333 1669 262 2 28 28 0.07143 2971 428 30 2 30 0.06667 6947 890 34 2 34 0.05882 10007 1229 2 42 42 0.04762 16141 1878 2 52 52 0.03846 25471 2809 2 54 54 0.03704 40639 4259 2 58 58 0.03448 79699 7809 60 2 60 0.03333 102761 9834 2 70 70 0.02857 173359 15782 2 82 82 0.02439 265621 23282 2 90 90 0.02222 404851 34214 2 100 100 0.02000 838249 66761