OFFSET
1,1
COMMENTS
Below is a general algorithm that can be used as a starting point for finding similar ones and three examples.
Not every possibility will work (additional conditions may apply) but it is easy to see that there are an infinite number of algorithms much like Rowland's that will have hundreds or thousands of primes between the 1's before a composite is encountered.
1) Initialize the integers x, k, a and b and choose f(x), g(k).
2) Repeat indefinitely:
2a) x = x + 1;
2b) set c = GCD( f(x), f(x - 1) - a*g(k) );
2c) if c > 1, then c is a term of the sequence and k = k + b.
The present sequence is generated by using f(x) = x^2 - x + 41, g(k) = k, x = 1, k = 2, a = 3 and b = 1.
Examples:
A) f(x) = 5*x^2 + 5*x + 1, g(k) = k, x = 1, k = 2, a = 10, b = 1. These values generate the sequence: 11, 31, 61, 101, 151, 211, 281, 19, 41, 29, 661, 11, 911, 1051, 1201, 1361, 1531, 59, 1901, ...
B) f(x) = x^2 - x + 41, g(k) = k, x = 1, k = 2, a = 3, b = 1. These values generate the sequence: 47, 227, 71, 359, 113, 563, 173, 839, 251,1187,347, 1607, 461,2099,593, 2663, 743,3299, 911, 4007, ...
C) f(x) = 5*x^2 + 5*x + 1, g(k) = k^2 - k + 41, x = 1, k = 2, a = 2, b = 1. These values generate the sequence: 11, 1979, 2549, 11,4691, 11, 8929, 29, 11, 22051, 41, 19, 48619, 61751, 11, 229, 11, 144779, 175141, 11, ...
REFERENCES
Eric S. Rowland, A simple prime-generating recurrence, Abstracts Amer. Math. Soc., 29 (No. 1, 2008), p. 50 (Abstract 1035-11-986).
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..10000
MATHEMATICA
Module[{k = 2, c, f}, f[x_] := x^2 - x + 41; Table[If[(c = GCD[f[x], f[x - 1] - 3*k]) > 1, k++; c, Nothing], {x, 12000}]] (* Paolo Xausa, Jan 31 2025 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Aldrich Stevens (aldrichstevens(AT)msn.com), Aug 15 2008
EXTENSIONS
Edited by Paolo Xausa, Jan 31 2025
STATUS
approved