OFFSET
1,3
LINKS
Vincenzo Librandi and Joerg Arndt, Table of n, a(n) for n = 1..1000
Eric L. F. Roettger, A cubic extension of the Lucas functions, Thesis, Dept. of Mathematics and Statistics, Univ. of Calgary, 2009. See page 195.
MATHEMATICA
k = 1; (* adjust for related sequences *) fL[n_] := (n^2 + n + 1)*2^(2*k) + (2*n + 1)*2^k + 1; fN[n_] := (n^2 + n + 1)*2^k + n; nn = 1000; A = {}; For[n = -nn, n <= nn, n++, If[PrimeQ[fL[n]] && PrimeQ[fN[n]], AppendTo[A, n]]]; cmpfunc[x_, y_] := If[x == y, Return[True], ax = Abs[x]; ay = Abs[y]; If[ax == ay, Return[x < y], Return[ ax < ay]]]; Sort[A, cmpfunc] (* Jean-François Alcover, Jul 17 2013, translated and adapted from Joerg Arndt's Pari program *)
PROG
(PARI)
k=1; /* adjust for related sequences */
fL(n) = (n^2+n+1)*2^(2*k) + (2*n+1)*2^k + 1;
fN(n) = (n^2+n+1)*2^k + n;
N=1000; A=[];
for(n=-N, +N, if (isprime(fL(n)) & isprime(fN(n)), A=concat(A, n) ) );
cmpfunc(x, y)= {
if(x==y, return(0) );
my( ax=abs(x), ay=abs(y) );
if ( ax==ay, return( sign(x-y) ) );
return( sign(ax-ay) );
}
A=vecsort(A, cmpfunc)
\\ Joerg Arndt, Jul 15 2013
CROSSREFS
KEYWORD
sign
AUTHOR
N. J. A. Sloane, Jul 12 2013
EXTENSIONS
More terms from Vincenzo Librandi, Jul 15 2013
STATUS
approved