OFFSET
1,1
COMMENTS
Note that only primes that end in 9 occur in the sequence of order 4. This is easy to prove by considering the ending digit combinations. actually, order 4 with odd x produces an even number so only even numbers need be considered.
For order 5, x<= 10, y = 3*x^5 + x^4 + 4*x^3 + x^2 + 5*x + 9. Sequence is 23 167 10559 54287 104561 314159 ...
Allowing any integral value for x, the sequence would read: 5, 59, 79, 769, 4259, 113279, 310379, 322079, 694039, 983789, 1391239, 1825129, 9416279,... (M. F. Hasler)
One could also reverse the order of polynomial coefficients, i.e. list primes p = 3 + 1*x + 4*x^2 + 1*x^3 + 5*x^4. For a base independent approach, one could take coefficients from the continued fraction expansion of Pi. - M. F. Hasler, Jun 17 2007
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
FORMULA
Only even x can give a prime.
MATHEMATICA
Select[Table[3*n^4+n^3+4*n^2+n+5, {n, 1, 300}], PrimeQ] (* Vincenzo Librandi, Jul 15 2012 *)
PROG
(PARI) /* This program is hard-wired for order 4. Change the polynomial y for more terms. */ pinomial(n) = { ct=0; sr=0; for(x=1, n, /* odd x => even y */ y = 3*x^4 + x^3 + 4*x^2 + x + 5; /* y = 3*x^5 + x^4 + 4*x^3 + x^2 + 5*x + 9; /* order 5*/ if(isprime(y), ct+=1; print1(y" "); ); ) }
(PARI) polyprimes( N=25 /*# of terms*/, P=[3, 1, 4, 1, 5], X=1/*starting value*/, a=[] )={ local(t); P=Pol(P); while( #a<N, if( isprime( t=subst( P, x, X )) & !setsearch(Set(a), t), /*print([X, t]); */ a=concat(a, t)); X++/*or: X=(X<=0)-X to get all integers*/); vecsort(a) } /* then polyprimes() gives the first 25 terms; polyprimes(50, [null], 0) gives 50 terms including the term 5=P(x=0), etc. */ \\ M. F. Hasler, Jun 17 2007
(Magma) [a: n in [1..300] | IsPrime(a) where a is 3*n^4+n^3+ 4*n^2+ n+5]; // Vincenzo Librandi, Jul 15 2012
CROSSREFS
KEYWORD
easy,nonn,base,less
AUTHOR
Cino Hilliard, Dec 04 2002
EXTENSIONS
Edited by M. F. Hasler, Jun 17 2007
STATUS
approved