login
Values of n such that L(1) and N(1) are both prime, where L(k) = (n^2+n+1)*2^(2*k) + (2*n+1)*2^k + 1, N(k) = (n^2+n+1)*2^k + n.
20

%I #25 Mar 20 2019 13:09:16

%S 0,1,-3,3,-5,13,25,31,-33,37,-39,55,-57,-71,79,-87,-159,181,-183,219,

%T -221,-243,-255,255,279,-281,289,-291,307,325,333,-353,-369,375,-395,

%U -423,-435,-495,-501,507,-551,-579,-633,703,-711,-731,739,781,825,-857,891,907,927,955,-957,-963,-981

%N Values of n such that L(1) and N(1) are both prime, where L(k) = (n^2+n+1)*2^(2*k) + (2*n+1)*2^k + 1, N(k) = (n^2+n+1)*2^k + n.

%H Vincenzo Librandi and Joerg Arndt, <a href="/A226921/b226921.txt">Table of n, a(n) for n = 1..1000</a>

%H Eric L. F. Roettger, <a href="http://people.ucalgary.ca/~hwilliam/files/A_Cubic_Extention_of_the_Lucas_Functions.pdf">A cubic extension of the Lucas functions</a>, Thesis, Dept. of Mathematics and Statistics, Univ. of Calgary, 2009. See page 195.

%t 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 *)

%o (PARI)

%o k=1; /* adjust for related sequences */

%o fL(n) = (n^2+n+1)*2^(2*k) + (2*n+1)*2^k + 1;

%o fN(n) = (n^2+n+1)*2^k + n;

%o N=1000; A=[];

%o for(n=-N,+N, if (isprime(fL(n)) & isprime(fN(n)), A=concat(A,n) ) );

%o cmpfunc(x,y)= {

%o if(x==y, return(0) );

%o my( ax=abs(x), ay=abs(y) );

%o if ( ax==ay, return( sign(x-y) ) );

%o return( sign(ax-ay) );

%o }

%o A=vecsort(A,cmpfunc)

%o \\ _Joerg Arndt_, Jul 15 2013

%Y Cf. A226921-A226929, A227448, A227449, A227515-A227523.

%K sign

%O 1,3

%A _N. J. A. Sloane_, Jul 12 2013

%E More terms from _Vincenzo Librandi_, Jul 15 2013