login
Numbers n such that the closest primes surrounding 10^n have the same last two digits.
1

%I #10 Mar 09 2019 17:28:31

%S 79,178,179,186,210,284,300,349,391,456,594,595,599,624,645,654,659,

%T 704,712,713,860,871,892,904,924,990,1015,1089,1097,1110,1118,1151,

%U 1165,1374,1396,1459,1709,1721,1826,1831,1911,1943,1956,2005,2061,2082,2089

%N Numbers n such that the closest primes surrounding 10^n have the same last two digits.

%C 79 {251, 49}, 178 {239, 261}, 179 {221, 979}, 186 {479, 721}, 210 {171, 1129}, 284 {467, 133}, 300 {69, 331}, 349 {2603, 297}, 391 {123, 477}, 456 {633, 567}, 594 {11, 789}, 595 {503, 297}, 599 {2339, 2161}, 624 {413, 187}, 645 {3291, 109}, 654 {1811, 1089}, 659 {2363, 937}, 704 {3489, 211},

%C 712 {171, 1029}, 713 {801, 2299}, 860 {1193, 2907}, 871 {827, 1473}, 892 {629, 271}, 904 {503, 597}, 924 {303, 4797}, 990 {3, 1197}, 1015 {71, 1029}, 1089 {4403, 5997}, 1097 {2271, 1429}, 1110 {2373, 2527}, 1118 {1767, 2233}, 1151 {2703, 97}, 1165 {33, 3867}, 1374 {689, 1411},

%C 1396 {1023, 3477}, 1459 {10211, 489}, 1709 {2859, 4241}, 1721 {10311, 189}, 1826 {1761, 1539}, 1831 {17751, 1449}, 1911 {4179, 2621}, 1943 {1279, 1721}, 1956 {541, 9459}, 2005 {141, 14259}, 2061 {6607, 3293}, 2082 {9537, 4563}, 2089 {597, 203}, 2091 {2517, 9783}, 2135 {7287, 3513}, ...,.

%H V. Danilov, <a href="http://www.fortunecity.com/skyscraper/epson/276/pr1_10k.htm">Smallest and largest n-digit primes.n</a>

%F A033873 + A033874 == 0 (mod 100). - _Robert G. Wilson v_, May 27 2006

%e 79 is in the sequence since the two primes nearest primes 10^79 are 10^79 - 251 and 10^79 + 49.

%t NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ@k, k++ ]; k]; PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ@k, k-- ]; k]; fQ[n_] := Mod[NextPrim[10^n], 100] == Mod[PrevPrim[10^n], 100]; Do[ If[ fQ@n, Print@n], {n, 2, 1250}] (* _Robert G. Wilson v_, May 27 2006 *)

%t Select[Range[2100],Mod[NextPrime[10^#],100]==Mod[NextPrime[10^#,-1],100]&] (* _Harvey P. Dale_, Mar 09 2019 *)

%o (PARI) g(n) = for(j=1,n,x=precprime(10^j);y=nextprime(10^j);if(x%100==y%100,print1 (j",")))

%Y Cf. A115564.

%K easy,nonn,base,less

%O 1,1

%A _Cino Hilliard_, May 23 2006

%E More terms from _Robert G. Wilson v_, May 27 2006 - Jun 14 2006