OFFSET
0,2
COMMENTS
If 2n+1 is 1 or a prime, set a(n) = 2n+1. If no prime is ever reached, set a(n) = -1.
EXAMPLE
n = 7: 2n+1 = 15 = 3*5 -> 35 = 5*7 -> 57 = 3*19 -> 391 = 17*23 -> 7132.
Then 7132 has nontrivial divisors 2, 4, 1783, 3566, so we get 2438716653.
Then 2438716653 has nontrivial divisors 3, 9, 27, 81, 243, 1453, 4359, 6907, 13077, 20721, 39231, 62163, 117693, 186489, 353079, 559467, 1678401, 10035871, 30107613, 90322839, 270968517, 812905551, so we get
397218342354195347096770311270213293361263967119846819703537649551048761178530013167010393822309715869072155509218 = 2*3^4*1217*317539*1211548321*33378971294653*8960783431807*17509226460292689821646170308388500174366980857582533580184934929433.
CROSSREFS
KEYWORD
base,more,nonn
AUTHOR
David Applegate, Jul 30 2007
EXTENSIONS
Edited by Michel Marcus, Mar 09 2023
STATUS
approved