Problems & Puzzles: Puzzles

 

 

Problems & Puzzles: Puzzles

Puzzle 1251 GPD(P+Nextprime(P)+1)

A. On Dec.15, 2025 Alain Rochelli sent the following curio, similar to the posted in the Puzzles 1249 & 1250:

While searching the internet for Puzzle 1249 and 1250 I had the following idea :

Now, the P+Nextprime(P)+1 problem is as follows: start with any prime P (>=5) and consider the greatest prime divisor of P+Nextprime(P)+1, denoted A(P) = GPD(P+Nextprime(P)+1).
Then, repeat the operation: A(A(P)), A(A(A(P))) … enough to fall into a cycle.

After computations carried out with the first primes up to 10^7, it is conjectured that all primes (>= 5) fall into a cycle included 13 as smallest term or a cycle included 17 as smallest term *:

a) Cycle “13”: 31, 23, 53, 113, 241, 29, 61, 43, 13 (9 terms)
b) Cycle “17”: 37, 79, 163, 331, 223, 41, 17 (7 terms)

Q1. Are there more cycles other than the two mentioned above (13 & 17)?

* This conjecture is false, as Oscar Volpatti demonstrated in his contributions. See below.

Q2. Do you devise a way to produce a formal proof that there are only these two cycles, or this purpose is imposible to get?

** Maybe it’s interesting to see Back and Caragiu’s paper)? See https://www.fq.math.ca/Papers1/48-4/Back_Caragiu.pdf

B. On Dec. 19, 2025, Emmanuel Vantieghem wrote:

Maybe we should search for iterations of  GPD(a*p + b)  that have at least three cycles (in a "reasonable" range, say below 10^9).

Q3. What  a, b  can give 4 cycles, 5, 6 ... ?

 



From 19-26 Dec., 2025, contributions came from Gennady Gusev, Emmanuel Vantieghem, Simon Cavegn, Oscar Volpatti

***

Gennady wrote:

The answer is only to question Q3.
 
2 cycles = [5, 43], (a,b)=(2,3)
Cycle "5", [13, 29, 61, 5, 13], 4, terms
Cycle "43", [89, 181, 73, 149, 43, 89], 5, terms
 
3 cycles = [7, 3, 181], (a,b)= (2, 5)
Cycle  “7”,  [19, 43, 13, 31, 67, 139, 283, 571, 37, 79, 163, 331, 29, 7], 14 terms
Cycle  “3”,  [3, 11], 2 terms
Cycle  “181”, [367, 739, 1483, 2971, 313, 631, 181], 7 terms
 
4 cycles = [7, 13, 31, 37], (a,b)= (5, 8)
Cycle " 7", [7, 43, 223, 1123, 5623, 28123, 20089, 311, 521, 67], 10 terms
Cycle "13", [73, 373, 1873, 103, 523, 61, 313, 13], 8 terms
Cycle "31", [31, 163, 823], 3 terms
Cycle "37", [193, 139, 37], 3 terms
 
5 cycles = [191, 11, 13, 73, 163], (a,b)=(16, 9)
Cycle "191", [191, 613, 9817, 157081, 1229], 5 terms
Cycle " 11", [11, 37, 601], 3 terms
Cycle " 13", [13, 31, 101], 3 terms
Cycle " 73", [73, 107, 1721, 787, 12601, 1613, 2347, 37561, 223], 9 terms
Cycle "163", [163, 2617, 193], 3 terms
 
6 cycles = [17, 13, 19, 727, 977, 1439], (a,b)=(25, 6)
Cycle " 17", [17, 431, 10781, 659, 16481, 412031, 153743, 32299, 42499, 151783, 542083, 103451, 4889,
             122231, 4723, 118081, 7789, 277, 239, 5981, 149531, 3738281, 1050079, 101359, 3457, 4549,
             113731, 406183, 743, 1093, 181, 197, 4931, 61, 1531, 38281, 957031, 24439, 337, 8431, 97], 41 terms
Cycle " 13", [13, 331], 2 terms
Cycle " 19", [19, 37], 2 terms
Cycle "727", [727, 18181, 5903], 3 terms
Cycle "977", [977, 2221, 7933], 3 terms
Cycle "1439", [1439, 3271, 1669], 3 terms
 
7 cycles = [5, 139, 23, 43, 97, 47, 331], (a,b)=(14, 51)
Cycle "  5", [11, 41, 5], 3 terms
Cycle "139", [139, 1997, 757, 463], 4 terms
Cycle " 23", [373, 5273, 2383, 33413, 467833, 7127, 99829, 1397657, 1505173, 6791, 761, 2141, 1201, 
              3373, 1153, 16193, 226753, 3174593, 87317, 1259, 1607, 22549, 4447, 4793, 67153, 15413, 
              215833, 3593, 1171, 23], 30 terms
Cycle " 43", [43, 653, 317, 67], 4 terms
Cycle " 97", [97, 1409, 19777, 276929, 3877057, 54278849, 4496473, 62950673, 3329], 9 terms
Cycle " 47", [709, 907, 61, 181, 47], 5 terms
Cycle "331", [331, 937, 1013], 3 terms
 
8 cycles = [5, 43, 79, 37, 73, 59, 283, 691], (a,b)=(32, 21)
Cycle " 5", [181, 5813, 186037, 51767, 19489, 623669, 1050391, 33612533, 151771, 50069, 8951, 286453, 9166517, 
             961733, 389563, 12466037, 1697503, 28277, 1321, 42293, 1353397, 3167, 97, 5], 24 terms
Cycle " 43", [43, 127], 2 terms
Cycle " 79", [2549, 983, 31477, 461, 79], 5 terms
Cycle " 37", [37, 241], 2 terms
Cycle " 73", [73, 2357, 191, 6133, 196277, 7433, 237877, 117109, 5939, 467], 10 terms
Cycle " 59", [83, 2677, 17137, 59], 4 terms
Cycle "283", [313, 10037, 283], 3 terms
Cycle "691", [691, 22133, 2633, 1187], 4 terms
 
9 cycles = [17, 13, 11, 97, 233, 1427, 1543, 2381, 2659], (a,b)=(37, 62)
Cycle " 17", [17, 691, 8543, 316153, 433249, 213737, 29399, 821, 499, 19], 10 terms
Cycle " 13", [13, 181, 751, 9283, 373, 4621, 73, 307, 47, 1801, 7411, 91423, 375857, 2957, 
            109471, 1171, 1607, 773, 28663, 353531, 239, 137, 733, 41, 1579, 557, 2953, 4049, 109], 29 terms
Cycle " 11", [11, 67], 2 terms
Cycle " 97", [1217, 673, 157, 103, 1291, 149, 223, 163, 677, 25111, 6073, 139, 347, 97], 14 terms
Cycle "233", [457, 5657, 209371, 1889, 823, 1453, 2337], 7 terms
Cycle "1427", [52861, 93139, 1427], 3 terms
Cycle "1543, ", [19051, 33569, 1543], 3 terms
Cycle "2381", [3833, 20269, 2381], 3 terms
Cycle "2659", [6563, 4957, 2659], 3 terms
 
10 cycles = [47, 23, 17, 19, 31, 71, 1259, 1213, 1327, 1973], (a,b)=(33, 8)
Cycle " 47", [47, 1559, 251, 8291, 1619, 10687, 2777, 2477, 81749, 61], 10 terms
Cycle " 23", [23, 59], 2 terms
Cycle " 17", [17, 569], 2 terms
Cycle " 19", [19, 127], 2 terms
Cycle " 31", [1031, 34031, 43, 1427, 3623, 31], 6 terms
Cycle " 71", [2351, 77591, 69203, 2283707, 445931, 16369, 108037, 9931, 367, 12119, 79987, 19267, 6173, 2017, 66569, 
              439357, 353629, 2333953, 81331, 62417, 2059769, 1045729, 405989, 11701, 55163, 1820387, 47639, 44917,
              3911, 383, 12647, 857, 28289, 186709, 313, 10337, 4673, 22031, 3767, 131, 71], 41 terms
Cycle "1259", [1259, 8311, 274271], 3 terms
Cycle "1213", [40037, 14519, 1213], 3 terms
Cycle "1327", [6257, 206489, 1327], 3, terms
Cycle "1973", [5009, 4723, 1973], 3 terms
 
11 cycles= [7, 173, 23, 31, 19, 101, 37, 199, 47, 337, 5179], (a,b)=(16, 689)
Cycle "  7", [7, 89, 2113, 3833, 62017, 3559, 19211, 61613, 986497, 1753849, 5059, 27211, 4153, 139, 971, 59, 71, 73, 619, 107], 20 terms
Cycle " 173",  [173, 3457, 1697, 2531, 8237, 7793, 17911, 1741], 8 terms
Cycle "  23", [23, 151], 2 terms
Cycle "  31", [31, 79], 2 terms
Cycle "  19", [331, 19], 2 terms
Cycle " 101", [101, 461, 1613, 26497, 277, 569, 1399, 7691, 24749, 4457, 809, 13633, 593, 10177, 18169, 32377, 1453], 17 terms
Cycle "  37", [61, 37], 2 terms
Cycle " 199", [199, 1291, 1423, 1117, 269, 4993, 1279, 641], 8 terms
Cycle "  47", [131, 557, 9601, 127, 907, 563, 9697, 181, 239, 4513, 47], 11 terms
Cycle " 337", [2027, 3011, 337], 3 terms
Cycle "5179", [5179, 27851, 89261, 285773], 4 terms
 
12 cycles = [37, 181, 967, 83, 821, 383, 877, 1487, 947, 1033, 1307, 1879], (a,b)=(28, 323)
13 cycles = [701, 29, 577, 97, 293, 607, 563, 571, 659, 709, 827, 853, 967], (a,b)=(22, 125)
14 cycles = [113, 13, 11, 19, 23, 101, 31, 41, 79, 167, 127, 137, 419, 479], (a,b)=(1, 7679)
15 cycles = [37, 53, 157, 19, 109, 31, 41, 43, 71, 73, 79, 131, 139, 269, 521], (a,b)=(1, 7370)
16 cycles = [109, 7, 13, 17, 19, 29, 37, 97, 101, 149, 157, 457, 197, 199, 239, 691], (a,b)=(1, 12095)
17 cycles = [101, 29, 13, 89, 19, 233, 31, 199, 41, 71, 107, 163, 173, 179, 197, 227, 941], (a,b)=(1, 24639)
18 cycles = [41, 197, 227, 103, 353, 373, 233, 89, 107, 521, 277, 199, 211, 313, 421, 461, 571, 1009], (a,b)=(9, 24871)
19 cycles = [89, 131, 13, 23, 29, 37, 59, 61, 113, 97, 103, 251, 157, 163, 191, 331, 373, 379, 569], (a,b)=(1, 14399)
20 cycles = [173, 191, 53, 13, 41, 59, 107, 61, 67, 83, 101, 103, 139, 193, 229, 433, 757, 491, 571, 967], (a,b)=(1, 23295)
21 cycles = [97, 7, 11, 31, 47, 61, 113, 73, 89, 107, 149, 151, 167, 227, 233, 263, 269, 283, 347, 503, 743], (a,b)=(1, 20159)
22 cycles = [7, 163, 97, 53, 19, 23, 29, 41, 43, 71, 83, 89, 103, 107, 109, 179, 239, 379, 383, 1213, 809, 811], (a,b)=(1, 17919)
23 cycles = [443, 43, 199, 397, 17, 367, 23, 29, 173, 41, 53, 89, 167, 181, 131, 157, 433, 163, 317, 439, 599, 1123, 2447], (a,b)=(1, 45759)
24 cycles = [5, 71, 11, 17, 797, 61, 31, 83, 131, 521, 149, 181, 269, 293, 313, 337, 1033, 367, 449, 809, 587, 613, 859, 1031], (a,b)=(1, 34559)
25 cycles = [41, 59, 463, 113, 29, 31, 97, 271, 71, 157, 151, 163, 191, 353, 1151, 383, 419, 457, 613, 839, 911, 1103, 1249, 1571, 2351], (a,b)=(1, 85119)
26 cycles = [59, 7, 211, 13, 113, 71, 1567, 37, 41, 43, 349, 157, 241, 271, 439, 487, 569, 761, 727, 751, 907, 991, 1033, 1117, 1877, 2389], (a,b)=(1, 90719)
27 cycles = [523, 619, 13, 17, 61, 151, 457, 43, 367, 2267, 383, 419, 751, 503, 647, 659, 673, 701, 757, 1031, 1187, 1223, 1277, 1301, 1439, 2083, 3631], (a,b)=(1, 124245)
28 cycles = [103, 463, 433, 73, 61, 23, 109, 41, 4007, 83, 397, 137, 139, 157, 1019, 211, 317, 439, 601, 619, 859, 1031, 1427, 1531, 2287, 2113, 3539, 5297], (a,b)=(1, 155924)
29 cycles = [31, 7, 79, 109, 73, 29, 37, 313, 71, 97, 127, 149, 163, 1399, 307, 193, 881, 479, 541, 607, 877, 919, 937, 1033, 2371, 1879, 2087, 2707, 2749], (a,b)=(1, 72575)
30 cycles = [5, 7, 269, 241, 17, 23, 199, 61, 67, 71, 73, 79, 101, 109, 313, 337, 367, 431, 491, 733, 521, 631, 701, 809, 907, 1117, 1487, 1579, 2131, 2383], (a,b)=(1, 129599)
31 cycles = [5, 13, 97, 593, 19, 109, 89, 37, 43, 83, 103, 337, 151, 163, 263, 271, 401, 449, 1171, 607, 733, 797, 977, 1223, 1327, 1489, 1721, 1747, 2087, 2273, 3539], (a,b)=(1,172799)
32 cycles = [103, 17, 313, 19, 193, 563, 227, 43, 61, 89, 97, 131, 137, 149, 449, 239, 433, 409, 701, 757, 929, 3541, 1259, 1297, 1583, 2287, 2473, 2789, 3733, 3929, 4271, 4397], (a,b)=(1, 274175)
33 cycles = [7, 11, 59, 17, 521, 1483, 37, 53, 61, 281, 103, 853, 181, 193, 211, 233, 271, 397, 601, 457, 509, 587, 661, 1399, 743, 751, 977, 1231, 1609, 1721, 1783, 2683, 3547], (a,b)=(1, 120959)
34 cycles = [41, 7, 17, 103, 101, 1217, 37, 59, 73, 193, 251, 431, 541, 577, 1933, 853, 907, 937, 977, 1249, 1361, 1453, 3433, 1871, 3067, 3331, 3371, 3559, 3691, 4111, 4211, 6521, 4931, 6133], (a,b)=(1, 345599)
35 cycles = [7, 11, 251, 71, 19, 241, 29, 31, 41, 103, 977, 127, 197, 439, 181, 193, 313, 331, 1303, 353, 419, 617, 569, 593, 743, 821, 853, 881, 929, 997, 1129, 1481, 1493, 2671, 3877], (a,b)=(1, 80639)
36 cycles = [137, 7, 53, 19, 17, 109, 197, 31, 37, 59, 67, 79, 271, 113, 131, 229, 157, 313, 173, 211, 1499, 619, 331, 337, 463, 401, 457, 467, 607, 733, 739, 907, 1237, 1277, 2069, 3], (a,b)=(1, 20735)
37 cycles = [631, 19, 313, 853, 17, 43, 31, 37, 311, 61, 67, 149, 317, 179, 347, 199, 233, 269, 337, 353, 859, 509, 547, 557, 829, 877, 937, 947, 1039, 1319, 1327, 1549, 1607, 1657, 1663, 2131, 2531], (a,b)=(1, 133055)
38 cycles = [131, 4549, 97, 13, 83, 41, 37, 151, 61, 353, 101, 113, 1877, 229, 1433, 2713, 379, 389, 463, 499, 557, 577, 701, 1583, 773, 953, 1187, 1217, 1289, 1429, 1481, 2663, 2129, 2273, 2551, 2963, 3739, 7151], (a,b)=(1, 354815)
39 cycles = [191, 1381, 647, 17, 19, 61, 367, 3319, 433, 73, 97, 101, 271, 163, 181, 197, 331, 1483, 443, 1367, 577, 617, 751, 971, 1109, 1753, 2011, 2029, 2129, 2417, 2663, 2707, 6637, 3613, 2963, 4289, 5059, 6079, 6257], (a,b)=(1, 380159)
40 cycles = [197, 1721, 11, 13, 29, 67, 73, 1667, 61, 79, 89, 367, 2551, 127, 139, 173, 2557, 211, 269, 293, 373, 421, 509, 631, 1493, 739, 1033, 1181, 1303, 5119, 1453, 1597, 1657, 2029, 2251, 2347, 3413, 5519, 5573, 7703], (a,b)=(1, 423359)
41 cycles = [101, 241, 307, 13, 151, 19, 61, 31, 751, 293, 131, 83, 541, 109, 157, 1231, 601, 251, 1321, 397, 811, 433, 443, 547, 1213, 1117, 1291, 1327, 2731, 1861, 1901, 2371, 2521, 2719, 3259, 3907, 4159, 4231, 6101, 5443, 7027], (a,b)=(1, 971999)
42 cycles = [13, 97, 907, 311, 23, 443, 181, 41, 307, 67, 263, 461, 151, 2953, 193, 199, 521, 401, 457, 487, 2957, 613, 3373, 1051, 911, 2311, 1103, 1109, 1117, 4703, 1619, 1831, 1987, 2551, 2671, 2719, 17021, 3257, 9173, 3637, 6547, 7331], (a,b)=(1, 950399)
43 cycles = [41, 101, 193, 13, 17, 53, 23, 197, 37, 89, 61, 97, 131, 1889, 229, 317, 1447, 503, 521, 577, 607, 809, 769, 1283, 1289, 1871, 1931, 2003, 2383, 2417, 2767, 2593, 2749, 2897, 3041, 3089, 3137, 3329, 3631, 4637, 4831, 5839, 6563], (a,b)=(1, 921599)
44 cycles = [37, 1873, 1567, 547, 19, 23, 71, 139, 443, 53, 313, 73, 1429, 1913, 2333, 397, 421, 2857, 739, 757, 911, 1259, 1361, 1453, 1697, 1709, 2383, 2029, 2083, 2099, 2141, 2243, 2311, 2473, 3607, 2719, 3163, 3673, 19577, 4621, 4787, 6053, 6917, 14713], (a,b)=(1, 622335)
45 cycles = [353, 293, 79, 13, 577, 19, 181, 31, 593, 43, 251, 101, 109, 167, 281, 227, 229, 541, 787, 449, 457, 487, 2251, 647, 727, 883, 977, 1051, 1117, 1481, 2351, 1811, 1831, 2129, 2143, 2273, 2287, 2357, 2437, 2543, 2953, 3319, 3547, 3823, 6229], (a,b)=(1, 362879)
46 cycles = [109, 79, 613, 13, 61, 29, 67, 43, 353, 97, 127, 617, 113, 397, 157, 727, 523, 191, 193, 367, 337, 379, 449, 601, 1069, 683, 859, 1381, 1609, 1733, 1747, 1999, 2089, 2221, 2557, 3067, 3221, 3331, 3719, 4177, 4397, 5171, 5233, 6229, 7481, 12451], (a,b)=(1, 798335)
47 cycles = [577, 7, 229, 113, 1373, 271, 37, 379, 43, 53, 197, 61, 397, 137, 3793, 661, 1217, 127, 163, 193, 337, 421, 433, 439, 593, 811, 907, 991, 1093, 1753, 1801, 1873, 2713, 2617, 2731, 2767, 2969, 3253, 3853, 3433, 3541, 3637, 3769, 3967, 5653, 5483, 6703], (a,b)=(1, 435455)
48 cycles = [3001, 71, 47, 31, 37, 2357, 3359, 61, 6673, 73, 277, 2887, 127, 139, 193, 281, 257, 733, 1741, 577, 773, 823, 829, 2609, 1093, 1129, 2341, 1249, 1303, 2161, 1321, 1381, 1669, 1933, 2767, 3529, 3547, 3769, 9391, 4337, 4339, 4451, 5641, 6719, 6977, 6997, 7211, 7309], (a,b)=(1, 953855)
49 cycles = [2333, 373, 13, 17, 541, 683, 197, 37, 41, 83, 53, 71, 89, 661, 241, 257, 269, 353, 379, 3547, 1951, 577, 677, 733, 769, 811, 829, 971, 1021, 1229, 1367, 1447, 1669, 1861, 1987, 2129, 2137, 2861, 2953, 6361, 3307, 4093, 4129, 4363, 4649, 6779, 5813, 5923, 7307], (a,b)=(1, 760319)
50 cycles = [7, 307, 41, 19, 241, 29, 31, 317, 43, 59, 163, 71, 89, 97, 557, 227, 491, 127, 131, 149, 181, 281, 293, 337, 347, 379, 577, 601, 709, 977, 1093, 1303, 1471, 1811, 1901, 1949, 2131, 2551, 2591, 3181, 3253, 3637, 3691, 4129, 4177, 4373, 5531, 6199, 6829, 9283], (a,b)=(1, 604799)
51 cycles = [641, 31, 673, 19, 101, 1187, 7331, 449, 853, 613, 73, 353, 113, 137, 157, 293, 1231, 347, 311, 313, 1601, 401, 409, 1361, 733, 1171, 883, 1021, 1279, 1091, 1097, 1193, 1201, 2381, 1429, 1483, 1543, 1877, 1913, 2341, 2417, 2473, 3529, 3631, 4057, 4231, 4951, 4957, 6359, 7229, 7541], (a,b)=(1, 470015)
52 cycles = [601, 61, 11, 97, 17, 71, 271, 37, 113, 89, 157, 163, 211, 983, 281, 293, 337, 349, 353, 727, 929, 449, 1753, 563, 631, 797, 829, 971, 2753, 2203, 1373, 1453, 1787, 2081, 2557, 2251, 2383, 2503, 2857, 3001, 3037, 3061, 3181, 4523, 5113, 5167, 5557, 5573, 5813, 5839, 6131, 6199], (a,b)=(1, 725759)
53 cycles = [421, 73, 379, 17, 23, 1697, 547, 41, 61, 877, 601, 197, 587, 137, 103, 139, 149, 157, 353, 193, 307, 1741, 389, 349, 439, 457, 653, 1171, 3137, 919, 929, 937, 1009, 2887, 9157, 2161, 1423, 2089, 2753, 2287, 2713, 2861, 2939, 3769, 16741, 5009, 5347, 6121, 6197, 6637, 24943, 7529, 7549], (a,b)=(1, 1886975)
54 cycles = [4861, 2957, 389, 17, 19, 23, 727, 373, 41, 83, 461, 401, 131, 107, 809, 193, 421, 241, 2633, 269, 337, 353, 491, 3631, 601, 641, 709, 823, 1297, 1033, 907, 5323, 1093, 1151, 1153, 1283, 1607, 1619, 1777, 2131, 2609, 2657, 2711, 3391, 3701, 3881, 3929, 4451, 5573, 5693, 6481, 7283, 7829, 7873], (a,b)=(1, 563199)
55 cycles = [29, 101, 13, 67, 47, 761, 37, 41, 199, 601, 61, 223, 97, 307, 487, 127, 751, 193, 1087, 271, 277, 1009, 4931, 433, 1051, 503, 2251, 617, 673, 757, 911, 1231, 1531, 1621, 1777, 1783, 2089, 2111, 2113, 2549, 2713, 3391, 3491, 4049, 4261, 4373, 4561, 5003, 5843, 5861, 6113, 6361, 6763, 6791, 6833], (a,b)=(1, 1209599)
56 cycles = [47, 197, 191, 1129, 113, 199, 41, 449, 4127, 241, 71, 73, 311, 101, 1171, 137, 929, 809, 227, 233, 1721, 283, 331, 337, 353, 409, 463, 491, 5743, 659, 4657, 967, 997, 1597, 1613, 1667, 1811, 2273, 2311, 2383, 2473, 3251, 3257, 3271, 3319, 3389, 3581, 4051, 4327, 4547, 4549, 4729, 5167, 5717, 5821, 5851], (a,b)=(1, 313599)
57 cycles = [73, 7, 71, 17, 1303, 2927, 37, 109, 59, 97, 137, 193, 239, 251, 313, 421, 433, 467, 523, 541, 1447, 577, 1217, 641, 673, 733, 751, 761, 4057, 3109, 1039, 1093, 1201, 1459, 1489, 1511, 3229, 1733, 2221, 2591, 2789, 2953, 3301, 3313, 3911, 3673, 3677, 3709, 4523, 6229, 4987, 5801, 5861, 5869, 6007, 21397, 6397], (a,b)=(1, 1451519)
 
65 cycles = [5, 181, 11, 7759, 373, 19, 23, 281, 31, 71, 41, 461, 59, 73, 163, 1933, 109, 337, 829, 173, 193, 1231, 229, 263, 307, 367, 389, 1171, 421, 433, 4817, 503, 577, 593, 1249, 769, 821, 991, 2887, 1283, 1301, 1321, 1471, 1481, 1747, 1931, 2003, 2017, 2423, 2473, 2531, 3209, 2671, 2689, 8741, 3877, 3701, 3917, 4019, 4111, 4561, 5471, 5857, 6091, 7057], (a,b)=(1, 1727999)
66 cycles = [79, 131, 113, 13, 17, 19, 211, 307, 31, 419, 41, 859, 353, 53, 193, 67, 3671, 73, 97, 103, 173, 139, 677, 151, 691, 283, 577, 1879, 509, 521, 541, 593, 601, 661, 1531, 937, 967, 3181, 1579, 1093, 1471, 1733, 1787, 2887, 1987, 2029, 2221, 2963, 2909, 3041, 3371, 3613, 11677, 3797, 3931, 4211, 4231, 4349, 4373, 4391, 8293, 4723, 5581, 7351, 7451, 7549], (a,b)=(1, 1123199)
 
72 cycles = [13, 41, 313, 19, 79, 37, 113, 53, 563, 61, 2203, 1087, 1013, 97, 107, 109, 157, 1951, 149, 163, 3371, 241, 223, 229, 233, 271, 2939, 419, 457, 463, 571, 2213, 673, 757, 24077, 907, 911, 937, 1009, 1061, 1093, 1117, 1171, 1279, 1447, 1471, 1483, 1489, 5059, 1669, 1861, 2089, 2237, 2617, 3049, 9491, 3613, 3797, 4211, 4261, 4507, 4663, 15973, 6257, 5101, 5653, 5659, 5689, 21277, 7151, 7703, 7741], (a,b)=(1, 2358719)

***

Emanuel wrote:

A.
Q1.
If one extends the definition of  the function  A  to all the primes (and/or to the whole of the natural numbers), you can join the cycle "3" to the allready found cycles
{13,31,23,53,113,241,29,61,43,13}  and  {17,37,79,163,331,223,41,17}.
There's no othere cycle for  p < 10^9.

B.
For every choice of  a  and  b  I defind the function  A by
A(n) = GPD(a n + b)
Under that condition we find :

Three cycles :
(a,b) = (2,3)
C1 = {5,13,29,61,5}
C2 = {3,3}
C3 = {43,89,181,73,149,43}

Four cycles :
(a,b) = (2,5)
C1 ={3,11,3}
C2 = {5,5}
C3 = {7,19,43,13,31,67,139,283,571,37,79,163,331,29,7}
C4 = 181,367,739,1483,2971,313,631,181}

Five cycles :
(a,b) = (4,11)
C1 = {7,13,7}
C2 = {23,103,47,199,269,1087,1453,647,113,463,23}
C3 = {5,31,5}
C4 = {11,11}
C5 = {443,1783,2381,1907,7639,443}

Six cycles :
(a,b) = (6,29)
C1 = {13,107,61,79,503,277,89,563,3407,1861,2239,13463,4253,433,71,13}
C2 = {47,311,379,47}
C3 = {113,101,127,113}
C4 = {29,29}
C5 = {307,1871,2251,2707,307}
C6 = {431,523,3167,19031,431}

Seven cycles :
(a,b)=(24,19) C1=1085389,306463,1050733,98123,11161,71,1723,3761,659,3167,10861,3571,7793,11003,264091,6338203,291971,1523,36571,11399,7817,461,11083,8581,205963,105173,194167,3533,84811,
3299,337,67}

C2 = {37,907,21787,6791,163003,230123,104207,80677,2693,3803,91291,95261,55763,1338331,32119963,2833,2957,10141,243403,33767,810427,
19450267,
466806427,228639883,8807957,863,20731,45233,1085611,26054683,10429,3851,547,13147,315547,2311,491,37}
C3 ={19,19}
C4 = {31,109,31}
C5 = {41,59,41}
C6 = {53,1291,103,53}
C7 = {727,17467,3301,727}

Eight cycles :
(a,b) = (28,41)
C1 = {97,919,71,2029,6317,439,4111,293,97}
C2 = {5,181,131,3709,34631,769,47,59,1693,3163,179,163,307,2879,1367,38317,1229,263,1481,103,13,5}
C3 = {233,101,151,1423,2659,89,149,383,2153,127,109,1031,28909,1129,3517,32839,306511,4463,1087,10159,233}
C4 = {29,853,29}
C5 = {41,41}
C6 = {43,83,43}
C7 = {43,83,43}
C8 = {2011,2087,58477,4231,39503,8849,247813,27211,2731,8501,18313,2011}

Nine cycles :
(a,b) = (32,21)
C1 = 73,2357,191,6133,196277,7433,237877,117109,5939,467,73}
C2 = {43,127,43}
C3 =  {5,181,5813,186037,51767,19489,623669,1050391,33612533,151771,50069,8951,286453,9166517,961733,389563,12466037,1697503,28277,1321,42293,1353397,3167,97,5}
C4 = {7,7}
C5 = 37,241,37}
C6 = {461,79,2549,983,31477,461}
C7 = {59,83,2677,17137,59}
C8 = {283,313,10037,283}
C9 = {2633,1187,691,22133,2633}

Ten cycles :
(a,b) ={33,8}
C1 = {61,47,1559,251,8291,1619,10687,2777,2477,81749,61}
C2 = {71,2351,77591,69203,2283707,445931,16369,108037,9931,367,12119,79987,19267,6173,2017,66569,439357,353629,2333953,81331,62417,2059769,
1045729,
405989,11701,55163,1820387,47639,44917,3911,383,12647,857,28289,186709,313,10337,4673,22031,3767,131,71}
C3 = {23,59,23}
C4 = {17,569,17}
C5 = {19,127,19}
C6 ={31,1031,34031,43,1427,3623,31}
C7 ={1327,6257,206489,1327}
C8 ={1259,8311,274271,1259}
C9 ={1213,40037,14519,1213}
C10 ={1973,5009,4723,1973}

I think the number of cycles can be arbitrary big for suitable choices of  a  an  b

***

Simon wrote:

B.
Note: I started with the prime 2, and included all cycles I could find when starting with primes.
Example Cycle: (L..H)[C]
L: Lowest number in cycle
H: Highest number in cycle
C: Amount of numbers in cycle

p * 1 + 15:  4 Cycles: (2..17)[2], (3..3)[1], (5..5)[1], (7..13)[3]
p * 3 + 28:  5 Cycles: (17..79)[3], (37..151)[6], (23..97)[3], (7..7)[1], (13..229)[3]
p * 6 + 29:  6 Cycles: (13..13463)[15], (47..379)[3], (101..127)[3], (29..29)[1], (307..2707)[4], (431..19031)[4]
p * 13 + 15: 7 Cycles: (19..5591)[13], (3..3)[1], (5..5)[1], (7..5519)[9], (17..839)[7], (67..18773)[11], (2963..125243)[4]
p * 19 + 26: 8 Cycles: (2..2)[1], (3..58603)[13], (389..15661)[3], (13..13)[1], (613..2741)[3], (691..5563)[3], (143873..65788991)[5], (167317..20134003)[5]
p * 32 + 21: 9 Cycles: (73..237877)[10], (43..127)[2], (5..33612533)[24], (7..7)[1], (37..241)[2], (79..31477)[5], (59..17137)[4], (283..10037)[3], (691..22133)[4]
p * 33 + 8: 10 Cycles: (47..81749)[10], (71..2333953)[41], (23..59)[2], (17..569)[2], (19..127)[2], (31..34031)[6], (1327..206489)[3], (1259..274271)[3], (1213..40037)[3], (1973..5009)[3]

Other findings:
Large L in a cycle: p * 59 + 4: 4 Cycles: (13..4988513)[50], (193..1784527)[5], (937..231461)[10], (461515261..843273121005617)[8]
Large C (Cycle length): p * 46 + 21: 5 Cycles: (43..148018223)[168], (17..2459)[5], (7..7)[1], (229..15809363)[7], (3671..176983)[6]

***

Oscar wrote:

For speed issues, I only searched for cycles whose smallest prime p is below 10^6.
Up to n = 14, I identified the pair (a,b) which gives n such cycles and has the least sum a+b.
n   (a,b)
1   (1,1)
2   (2,3) (3,2)
3   (2,5)
4   (6,5)
5   (16,9) (17,8)
6   (25,6)
7   (14,51)
8   (32,21)
9   (63,40)
10  (33,8)
11  (56,33)
12  (21,79)
13  (23,95)
14  (105,103)

Moreover, pair (89,55) gives at least 17 cycles.
Cycle 53: 53, 1193, 271, 79, 1181, 431, 19207, 31657, 541, 103, 53 (10 terms)
Cycle 443: 443, 1039, 2203, 32687, 1454599, 7192187, 27107, 443 (7 terms)
Cycle 1109: 1109, 3527, 156979, 776177, 5507, 1109 (5 terms)
Cycle 8647: 8647, 128273, 356761, 8647 (3 terms)
Cycle 9067: 9067, 134503, 117361, 9067 (3 terms)
Cycle 9377: 9377, 52163, 2321281, 9377 (3 terms)
Cycle 9631: 9631, 47623, 706417, 9631 (3 terms)
Cycle 9739: 9739, 48157, 357169, 9739 (3 terms)
Cycle 10099: 10099, 49937, 138889, 10099 (3 terms)
Cycle 11251: 11251, 55633, 51577, 11251 (3 terms)
Cycle 12577: 12577, 23321, 259453, 12577 (3 terms)
Cycle 15031: 15031, 74323, 21617, 15031 (3 terms)
Cycle 15161: 15161, 168673, 18397, 15161 (3 terms)
Cycle 15649: 15649, 29017, 35869, 15649 (3 terms)
Cycle 15901: 15901, 117937, 18223, 15901 (3 terms)
Cycle 18869: 18869, 24697, 30529, 18869 (3 terms)
Cycle 21317: 21317, 27901, 22993, 21317 (3 terms)
For pair (89,55), further search was performed.
There are no cycles with smallest prime between 10^6 and 2*10^9.
There is also one "fixed point" p=5, which generates a "cycle with one term":
Cycle 5: 5, 5 (1 term)
But every other starting prime gives an iteration which doesn't fall into such cycle, so p=5 is an "isolated point".
Let's prove that equation  gpd(89*p+55) = 5  has the only solution p = 5.
Prime 5 is (the greatest) prime factor of  89*p+55, then 5 divides 89*p too, therefore 5 divides prime p; in other words, p is 5 itself.

One day ñater, Oscar wrote again:

About part A of puzzle 1251, Alain Rochelli's conjecture is false.
From many starting primes P > 5, the iteration process never reaches cycle "13" nor cycle "17".
One such exception is prime P = 102945566047297.

For compactness, given a prime P, define the following numbers:  
Q = Nextprime(P);
X = P+Q+1;
Y = GPD(X) = A(P).
Let's check the claimed exception:
P = 102945566047297;
Q = 102945566047351;
X = 205891132094649 = 3^30;
Y = 3.
Next step:
P = 3;
Q = 5;
X = 9 = 3^2;
Y = 3.
Hence, from starting prime P = 102945566047297, the cycle "3" mentioned by Emmanuel Vantieghem is reached:
102945566047297, 3, 3, 3...

I found such exception not by exaustive search, but by solving equation A(P) = 3.
Assuming P > 2, then P and Q must be odd and X must be an odd composite whose largest prime factor is 3.
Therefore X = 3^K and P+Q = 3^K-1, for some positive exponent K.
But Q > P, so Q-P = 2*S for some positive integer S.
Solving for P and Q:
P = (3^K-1)/2 - S,
Q = (3^K-1)/2 + S.
Search strategy.
Consider each positive exponent K in ascending order.
For given K, verify that integer M = (3^K-1)/2 is composite.
If so, consider each positive integer S in ascending order and check the pair (M-S,M+S); stop as soon as current pair contains at least one prime; if it actually contains two primes, we have a solution P = M-S, Q = M+S = Nextprime(P).
First few solutions found (D is the number of base-10 digits):
K  S  D
2  1  1
30  27  15
79  30  38
116  33  56
1950  1863  931
2113  60  1008
4046  267  1931
...

Cycle "3" also reached from starting prime P = 2:
P = 2;
Q = 3;
X = 6 = 2*3;
Y = 3.
Cicle "3" also reached in two steps:
4375186557010103, 102945566047297, 3;
6022315613766871, 102945566047297, 3;
7257662406334429, 102945566047297, 3;
...
Cicle "3" also reached in three steps:
3011157806883431, 6022315613766871, 102945566047297, 3;
90051633899873027, 180103267799746099, 102945566047297, 3;
91441399041511249, 16625708916638411, 102945566047297, 3;
...          
To me, it seems likely that cycle "3" can be reached from infinitely many starting primes.
I suggest to update Alain Rochelli's conjecture as follows:
From every starting prime, with no exception, iteration process eventually reaches either cycle "3", or cycle "13", or cycle "17".
I can't devise a formal proof of the updated conjecture.
If there are more cycles other than those mentioned above, then all involved primes must be greater than 4*10^11.

 

***

 

Records   |  Conjectures  |  Problems  |  Puzzles