Problems & Puzzles: Puzzles

Puzzle 1230 Polynomials and the period of the reciprocal of primes

Davide Rotondo
sent the following interesting puzzle:

For n from 0 to 17, 487 - 280*n + 50*n^2 produces 18 consecutive distinct primes p such that the number of digits in the period 1/p is even.

For n from -18 to 18, 10*n^2 + 19 produces 37 consecutive primes with the same property, only 19 of these are distinct.


Example: 487 - 280*n + 50*n^2

n=0, p=487, lenght period 1/p=486
n=1, p=257, L. 1/p=256
n=2, p=127, L. 1/p=42
n=3, p=97, L. 1/p=96
n=4, p=167, L.1/p=166
n=5, p=337, L.1/p=336
n=6, p=607, L.1/p=202
n=7, p=977, L.1/p=976
n=8, p=1447, L.1/p=1446
n=9, p=2017, L.1/p=2016
n=10, p=2687, L.1/p=2686
n=11, p=3457, L.1/p=384
n=12, p=4327, L.1/p=4326
n=13, p=5297, L.1/p=5296
n=14, p=6367, L.1/p=6366
n=15, p=7537, L.1/p=2512
n=16, p=8807, L.1/p=8806
n=17, p=10177, L.1/p=10176

Q. Can you find a polynomial that produces more than 19 consecutive non-repeating primes p such that the number of digits of the period 1/p is of even length?


* Just in case you need some basics concepts of 1/p, here are two interesting (to me, CR) links:

https://en.wikipedia.org/wiki/Reciprocals_of_primes

https://www.youtube.com/watch?v=DmfxIhmGPP4


From 19 to 25 of July, 2025, contributions came from Giorgos Kalogeropoulos, J.M. Rebert

***

Do you want you to check some results in an online calculator? Here is one:

https://mathtools.lagrida.com/arithmetic/multiplicative_order.html

***

Giorgos wrote:

For n from -5 to 22, 708n^2 - 3912n + 6373 produces 28 consecutive distinct primes
n=-5, p=43633, L. 1/p=4848
n=-4, p=33349, L. 1/p=33348
n=-3, p=24481, L. 1/p=6120
n=-2, p=17029, L. 1/p=17028
n=-1, p=10993, L. 1/p=10992
n=0, p=6373, L. 1/p=1062
n=1, p=3169, L. 1/p=72
n=2, p=1381, L. 1/p=1380
n=3, p=1009, L. 1/p=252
n=4, p=2053, L. 1/p=342
n=5, p=4513, L. 1/p=1504
n=6, p=8389, L. 1/p=8388
n=7, p=13681, L. 1/p=3420
n=8, p=20389, L. 1/p=6796
n=9, p=28513, L. 1/p=28512
n=10, p=38053, L. 1/p=2718
n=11, p=49009, L. 1/p=6126
n=12, p=61381, L. 1/p=61380
n=13, p=75169, L. 1/p=37584
n=14, p=90373, L. 1/p=45186
n=15, p=106993, L. 1/p=106992
n=16, p=125029, L. 1/p=125028
n=17, p=144481, L. 1/p=14448
n=18, p=165349, L. 1/p=165348
n=19, p=187633, L. 1/p=62544
n=20, p=211333, L. 1/p=105666
n=21, p=236449, L. 1/p=29556
n=22, p=262981, L. 1/p=262980

***

Rebert wrote:

I found:
For n from 0 to 19, f(n) = 3943 - 100*n + 740*n^2,
produces 20 consecutive prime numbers p such that the number of digits L in the repeating decimal period of 1/p is even,
all 20 primes are distinct.
  n      p      L
  0   3943   3942
  1   4583   4582
  2   6703   6702
  3  10303   3434
  4  15383  15382
  5  21943   7314
  6  29983   9994
  7  39503  39502
  8  50503  50502
  9  62983  62982
 10  76943  76942
 11  92383  92382
 12 109303 109302
 13 127703 127702
 14 147583  49194
 15 168943 168942
 16 191783 191782
 17 216103 216102
 18 241903  80634
 19 269183 269182

For n from 0 to 20, f(n) = 1381 - 1080*n + 708*n^2, 
produces 21 consecutive prime numbers p such that the number of digits L in the repeating decimal period of 1/p is even, 
all 21 primes are distinct.
 n      p      L
 0   1381   1380
 1   1009    252
 2   2053    342
 3   4513   1504
 4   8389   8388
 5  13681   3420
 6  20389   6796
 7  28513  28512
 8  38053   2718
 9  49009   6126
10  61381  61380
11  75169  37584
12  90373  45186
13 106993 106992
14 125029 125028
15 144481  14448
16 165349 165348
17 187633  62544
18 211333 105666
19 236449  29556
20 262981 262980

For n from 0 to 21, f(n) = 3169 - 2496*n + 708*n^2, 
produces 22 consecutive prime nombers p such that the number of digits L in the repeating decimal period of 1/p is even, 
all 22 primes are distinct.
 n      p      L
 0   3169     72
 1   1381   1380
 2   1009    252
 3   2053    342
 4   4513   1504
 5   8389   8388
 6  13681   3420
 7  20389   6796
 8  28513  28512
 9  38053   2718
10  49009   6126
11  61381  61380
12  75169  37584
13  90373  45186
14 106993 106992
15 125029 125028
16 144481  14448
17 165349 165348
18 187633  62544
19 211333 105666
20 236449  29556
21 262981 262980

For n from 0 to 22, f(n) = 6373 - 3912*n + 708*n^2, 
produces 23 consecutive prime numbers p such that the number of digits L in the repeating decimal period of 1/p is even, 
all 23 primes are distinct.
 n      p      L
 0   6373   1062
 1   3169     72
 2   1381   1380
 3   1009    252
 4   2053    342
 5   4513   1504
 6   8389   8388
 7  13681   3420
 8  20389   6796
 9  28513  28512
10  38053   2718
11  49009   6126
12  61381  61380
13  75169  37584
14  90373  45186
15 106993 106992
16 125029 125028
17 144481  14448
18 165349 165348
19 187633  62544
20 211333 105666
21 236449  29556
22 262981 262980

For n from 0 to 23, f(n) = 10993 - 5328*n + 708*n^2, 
produces 24 consecutive primes p such that the number of digits L in the repeating decimal period of 1/p is even, 
all 24 primes are distinct.
 n      p      L
 0  10993  10992
 1   6373   1062
 2   3169     72
 3   1381   1380
 4   1009    252
 5   2053    342
 6   4513   1504
 7   8389   8388
 8  13681   3420
 9  20389   6796
10  28513  28512
11  38053   2718
12  49009   6126
13  61381  61380
14  75169  37584
15  90373  45186
16 106993 106992
17 125029 125028
18 144481  14448
19 165349 165348
20 187633  62544
21 211333 105666
22 236449  29556
23 262981 262980

For n from 0 to 24, f(n) = 17029 - 6744*n + 708*n^2, 
produces 25 consecutive primes p such that the number of digits L in the repeating decimal period of 1/p is even, 
all 25 primes are distinct.
 n      p      L
 0  17029  17028
 1  10993  10992
 2   6373   1062
 3   3169     72
 4   1381   1380
 5   1009    252
 6   2053    342
 7   4513   1504
 8   8389   8388
 9  13681   3420
10  20389   6796
11  28513  28512
12  38053   2718
13  49009   6126
14  61381  61380
15  75169  37584
16  90373  45186
17 106993 106992
18 125029 125028
19 144481  14448
20 165349 165348
21 187633  62544
22 211333 105666
23 236449  29556
24 262981 262980

For n from 0 to 25, f(n) = 24481 - 8160*n + 708*n^2, 
produces 26 consecutive prime numbers p such that the number of digits L in the repeating decimal period of 1/p is even, 
all 26 primes are distinct.
 n      p      L
 0  24481   6120
 1  17029  17028
 2  10993  10992
 3   6373   1062
 4   3169     72
 5   1381   1380
 6   1009    252
 7   2053    342
 8   4513   1504
 9   8389   8388
10  13681   3420
11  20389   6796
12  28513  28512
13  38053   2718
14  49009   6126
15  61381  61380
16  75169  37584
17  90373  45186
18 106993 106992
19 125029 125028
20 144481  14448
21 165349 165348
22 187633  62544
23 211333 105666
24 236449  29556
25 262981 262980

For n from 0 to 26, f(n) = 33349 - 9576*n + 708*n^2, 
produces 27 consecutive primes p such that the umber of digits L in the repeating decimal period of 1/p is even, 
all 27 primes are distinct.
 n      p      L
 0  33349  33348
 1  24481   6120
 2  17029  17028
 3  10993  10992
 4   6373   1062
 5   3169     72
 6   1381   1380
 7   1009    252
 8   2053    342
 9   4513   1504
10   8389   8388
11  13681   3420
12  20389   6796
13  28513  28512
14  38053   2718
15  49009   6126
16  61381  61380
17  75169  37584
18  90373  45186
19 106993 106992
20 125029 125028
21 144481  14448
22 165349 165348
23 187633  62544
24 211333 105666
25 236449  29556
26 262981 262980

***

Later, on July 30, 2025. JM Rebert sent more & larger solutions.

For n from -19 to 8, f(n) = 1009 - 336*n + 708*n^2, 
produces 28 consecutive prime numbers p such that the number of digits L in the repeating decimal period of 1/p is even, all 28 primes are distinct.
 n   p           L
-19 262981 262980
-18 236449 29556
-17 211333 105666
-16 187633 62544
-15 165349 165348
-14 144481 14448
-13 125029 125028
-12 106993 106992
-11 90373 45186
-10 75169 37584
-9 61381 61380
-8 49009  6126
-7 38053  2718
-6 28513 28512
-5 20389  6796
-4 13681  3420
-3  8389  8388
-2  4513  1504
-1  2053   342
 0  1009   252
 1  1381  1380
 2  3169    72
 3  6373  1062
 4 10993 10992
 5 17029 17028
 6 24481  6120
 7 33349 33348
 8 43633  4848
.

For n from -9 to 19, f(n) = 3943 - 100*n + 740*n^2, 
produces 29 consecutive prime numbers p such that the number of digits L in the repeating decimal period of 1/p is even, all 29 primes are distinct.
 n  p        L
-9 64783 64782
-8 52103 52102
-7 40903 40902
-6 31183 10394
-5 22943 22942
-4 16183 16182
-3 10903 10902
-2  7103  7102
-1  4783  4782
 0  3943  3942
 1  4583  4582
 2  6703  6702
 3 10303  3434
 4 15383 15382
 5 21943  7314
 6 29983  9994
 7 39503 39502
 8 50503 50502
 9 62983 62982
10 76943 76942
11 92383 92382
12 109303 109302
13 127703 127702
14 147583 49194
15 168943 168942
16 191783 191782
17 216103 216102
18 241903 80634
19 269183 269182

***

 

Records   |  Conjectures  |  Problems  |  Puzzles