login
A139414
a(x) = if one of {4x^2 - 146x + 1373, 4x^2 - 144x + 1459, 4x^2 - 142x + 1301, 4x^2 - 140x + 1877} is prime, then pick that prime in sequence.
3
1373, 1319, 1033, 1493, 853, 839, 593, 1093, 461, 487, 281, 821, 197, 263, 97, 677, 61, 167, 41, 661, 53, 199, 113, 773, 173, 359, 313, 1013, 421, 647, 641, 1381, 797, 1063, 1097, 1877, 1301, 1607, 2333, 1847, 1933, 2203, 2393, 3253, 2693, 3079, 3121, 4133
OFFSET
1,1
COMMENTS
The polynomials are tested in a cycle beginning with t[1 + mod [x,4]], i.e. when x==0 mod 4, they are tested in order t1,t2,t3,t4; when x==1 mod 4, they are tested in the order t2,t3,t4,t1, etc. If none of the polynomials are prime, no value is given. [From Harry J. Smith, Jan 28 2009, Jan 31 2009]
Based on correspondence with Aldrich Stevens.
EXAMPLE
The initial terms are {1, 1373}, {2, 1319}, {3, 1033}, {4, 1493}, {5, 853}, {6, 839}, {7, 593}, {8, 1093}, {9, 461}, {10, 487}, ..., {73, 11597}, {74, 12263}, {75, 12697}, {76, 13877}, {77, 13381}, {78, 14087}, {79, 14561}, {80, 15541}, {81, 15791}, {82, 16553}
MATHEMATICA
a = {4x^2 - 146x + 1373, 4x^2 - 144x + 1459, 4x^2 - 142x + 1301, 4x^2 - 140x + 1877}; (* functional "if" ladder to switch polynomials*) g[x_] := If[PrimeQ[a[[1 + Mod[x, 4]]]], a[[1 + Mod[x, 4]]], If[PrimeQ[a[[1 + Mod[x + 1, 4]]]], a[[1 + Mod[x + 1, 4]]], If[PrimeQ[a[[1 + Mod[x + 2, 4]]]], a[[1 + Mod[x + 2, 4]]], If[PrimeQ[a[[1 + Mod[x + 3, 4]]]], a[[1 + Mod[x + 3, 4]]], a[[1 + Mod[x, 4]]]]]]]; Flatten[Table[If[PrimeQ[g[x]], g[x], {}], {x, 0, 500}]] Length[%] Sort[Table[If[PrimeQ[g[x]], {x, g[x]}, {}], {x, 0, 500 }]];
PROG
(PARI) {n=0; for( x=0, 12022, t=[4*x^2-146*x+1373, 4*x^2-144*x+1459, 4*x^2-142*x+1301, 4*x^2-140*x+1877]; for(i=0, 3, if( isprime( p=t[ (x+i)%4+1 ]), print(n++, " "p); write("b139414.txt", n, " "p); break)))}
CROSSREFS
Cf. A155814.
Sequence in context: A135819 A371191 A181969 * A155925 A329917 A060981
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Jun 09 2008
EXTENSIONS
Clarified the definition of the sequence and added a PARI program. Harry J. Smith, with help from M. F. Hasler, Jan 31 2009
STATUS
approved