Fortunate Prime

Author

Eric W. Weisstein
November 17, 2003

This notebook downloaded from http://mathworld.wolfram.com/notebooks/PrimeNumbers/FortunatePrime.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/FortunatePrime.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Initialization

<<NumberTheory`NumberTheoryFunctions`

Enumeration

Primorial[1]:=2
Primorial[k_]:=Primorial[k]=Prime[k]Primorial[k-1]
x[k_]:=1+Primorial[k]
q[k_]:=q[k]=NextPrime[x[k]]
f[k_]:=f[k]=q[k]-x[k]+1

FortunatePrimeIndex[k_]:=PrimePi[FortunatePrime[k]]

x/@Range[20]

Timing[q/@Range[15]]

Up to 750

Timing[fortunate=f/@Range[750]]

{Max[fortunate],PrimeQ/@And@@fortunate}

Union[fortunate]

Up to 1000

fortunate={3,5,7,13,23,17,19,23,37,61,67,61,71,47,107,59,61,109,89,103,79,151,197,101,103,233,223,127,223,191,163,229,643,239,157,167,439,239,199,191,199,383,233,751,313,773,607,313,383,293,443,331,283,277,271,401,307,331,379,491,331,311,397,331,353,419,421,883,547,1381,457,457,373,421,409,1061,523,499,619,727,457,509,439,911,461,823,613,617,1021,523,941,653,601,877,607,631,733,757,877,641,877,1423,929,839,641,839,971,859,1019,643,733,743,653,1031,1069,983,653,769,691,1213,991,1091,2087,733,1307,1481,883,1123,1523,1109,1171,769,1801,1031,1597,829,1201,1453,937,1091,1031,857,1187,863,937,1163,919,911,1187,1153,1069,947,1439,1753,1231,1223,1013,1237,1153,1489,1321,1181,1987,1697,2243,1867,1193,1097,1289,1999,1103,1601,1453,2131,1231,1163,1063,1163,1453,2357,3559,1429,2689,1597,1381,3089,1669,2099,1831,1327,1867,1759,2351,2287,1607,1429,2239,2381,2011,1619,1663,2731,2213,1627,2269,1429,3739,1493,2647,1747,1409,1321,1319,3499,2311,3041,1993,1721,3023,2239,1483,1439,2087,1669,1613,1483,1759,1913,2381,1877,1657,2251,1619,1669,5323,1511,1709,1523,2273,2347,2083,2339,1637,1709,1787,1787,1999,2017,5689,1913,1999,2087,1973,4421,1741,1723,3299,1693,1997,1931,1933,3253,3449,1721,2267,3359,2699,3413,3067,2503,1759,1871,2707,3079,3547,1879,2309,3637,4799,2087,1889,2671,2309,2393,2297,2143,3187,6271,2411,2089,2441,2099,2473,4649,2239,2557,1987,5231,2971,5641,2251,2389,2017,2081,3803,3019,2411,3319,2243,7187,2621,2683,4831,2861,2837,2243,3373,3167,4201,5021,3391,3343,3347,3037,3373,2239,6301,4457,3061,2969,2861,2677,5023,3461,3767,2381,3559,2549,2837,5647,4597,3779,2671,3067,2689,3049,3833,2833,4729,3313,2837,2837,4363,4493,2851,2609,2543,3469,3803,5009,3931,3331,2861,3931,2609,2719,2677,4933,2633,3947,3467,2909,2731,2939,2677,3163,7309,5087,3793,2657,4153,3767,2789,2837,3919,4903,3853,4993,4217,6197,2843,5227,2729,2953,3547,8713,3119,3067,4019,5051,3089,3347,3659,5693,3089,3343,6029,2909,3889,3433,4547,3467,11069,5003,3343,4339,9241,6007,3083,4957,3041,9643,4127,10009,3209,9067,3257,6337,3271,4231,4691,3331,5413,3121,3089,3727,5443,3967,4441,9601,5839,8627,5417,8089,3359,5557,3643,5557,7229,3929,3643,5639,3793,3271,4783,3529,4463,6547,3371,3931,5077,3557,4621,3631,4663,6917,5981,3803,3499,9743,5333,6761,11411,4547,6329,6121,4201,3719,10039,3719,4673,3607,4649,4463,6701,4721,5669,9137,4937,6361,3631,6277,3727,7151,6247,5987,3769,3911,5839,5167,4423,5081,5101,5657,4231,4583,5897,3919,3673,4937,6053,4463,9221,3853,5521,3967,4019,4877,5711,5869,4549,10193,4909,9239,4691,5237,4643,10903,10853,3923,19699,3853,4201,5867,5869,4493,6529,16183,6257,4591,8641,4447,5693,5443,5303,4001,4603,7717,4339,4463,8467,4297,4951,9743,4597,5273,6793,4793,5393,5471,4951,4219,4517,5351,9041,12239,5309,4273,7673,4481,7349,6779,4919,5009,4289,6197,5557,5693,4973,5827,4643,20249,5023,4801,8689,4597,9257,5881,4547,9239,5479,8527,7759,7187,5233,5113,6113,4801,8297,16187,5101,7523,6949,6217,11117,5519,4519,5101,4621,4793,7349,8707,5881,8689,5581,7433,5897,5683,4787,6359,7211,9323,6163,15973,14011,6217,13417,4721,5051,8933,4951,8747,7883,8297,12539,7723,8369,9817,12713,4999,6907,5779,7177,5813,6863,6427,6007,7883,7589,5227,5923,9929,11059,4969,6581,6101,7873,5297,9323,6277,4973,10093,8389,5051,6829,5573,7817,5441,7103,5237,5477,6011,6271,12197,9967,5693,6947,6869,5099,6053,5237,11399,7757,7841,8287,10391,6091,6709,7517,6793,6131,7537,10891,15391,7949,6113,6427,9649,7723,12853,9739,7649,5939,11939,8369,10271,8837,13159,6047,8111,7817,9769,14251,12653,9239,6917,8269,8191,7639,10391,6791,6599,5557,8969,5693,8237,6211,9209,6761,10567,11839,17419,11173,8447,9007,10139,18169,7759,6173,9521,11443,13711,7069,6089,7489,8867,5987,7193,16069,7079,9151,10007,13921,11213,6311,6389,9203,7993,6679,6781,10007,7321,13099,9829,8443,6067,6151,8293,11887,7159,6007,8447,10181,9857,11443,10733,6389,7129,6029,15073,6389,6569,6427,6827,25621,13679,9283,6791,7129,11447,11383,8273,11279,6211,6793,7789,18379,7369,7127,6323,6151,21661,17837,6551,7879,6547,14533,7753,21613,8387,25183,11617,18229,11677,6871,11551,6451,8243,20441,11633,14951,11953,7681,6689,9049,8969,9601,14057,15923,7727,9029,9661,20663,12373,10837,7753,20123,13099,14543,7043,7573,13093,8689,6871,12953,6871,7547,18637,7433,7919,7867,6737,11197,8117,12539,6781,8719,8609,7309,6841,20161,6833,9497,17077,8933,10391,16573,16981,15749,8761,7057,7213,12473,7517,23509,9791,15451,11093,11833,7333,7481,13877,15031,7433,11299,12347,12959,16481,9929,8527,11059,17911,12671,15149,7027,10499,16273,13309,7723,7547,11447,7457,8663,12413,10663,15739,10831,7121,7411,14327,9127,19249,9883,14173,12821,7207,21587,10597,8647,14827,9839,11783,8329,12889,8807,7993,17467,10289,8521,9227,11953,13537,9319,20389,7573,10459,15661,15641,28351,28817,8009,8837,21803,10429,32443,8089,9403,14323,9161,16567,10313,17333,9437,12889,9511,18329,13633,8839,7823,10601,8951,17987,7727,7759,11317,15121,8447,9781,10133,8863,7759,11047,9461,14621,14519,13217,13183,23741,13291,8537,9551,21341,9721,8111,12437,10973,8783,8501,9421,8867,10607,10091,8287,10009,9871,12763,11383,8831,8377,8719};

{Max[fortunate],PrimeQ/@And@@fortunate}

Plot

<<Plot`

IntegerListPlot[fortunate,AxesLabel->TraditionalForm/@{k,(Subscript[F, k])}]