login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A178659 Numbers n such that n^2 +- (n-1)^2 are primes. 3

%I #18 Jan 30 2019 00:00:50

%S 2,3,6,10,15,30,31,36,40,51,66,70,91,100,136,175,190,205,225,231,261,

%T 285,286,316,321,331,370,376,411,441,465,496,516,520,526,535,546,565,

%U 576,586,591,681,720,730,745,750,766,855,871,906,916,951,975,1081,1120

%N Numbers n such that n^2 +- (n-1)^2 are primes.

%H G. C. Greubel, <a href="/A178659/b178659.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = 1 + A068501(n). - _Zak Seidov_, Feb 10 2015

%e 2 is in the sequence because 2^2 + 1^2 = 5 and 2^2 - 1^2 = 3 are both prime.

%e 3 is in the sequence because 3^2 + 2^2 = 13 and 3^2 - 2^2 = 5 are both prime.

%t lst={};Do[If[PrimeQ[n^2-(n-1)^2]&&PrimeQ[n^2+(n-1)^2],AppendTo[lst,n]],{n,7!}];lst

%t Select[Range[8!], PrimeQ[#^2 -(#-1)^2] && PrimeQ[#^2 +(#-1)^2] &] (* _G. C. Greubel_, Jan 28 2019 *)

%o (PARI) A178659()={my(maxx=1000);n=2;ptr=0;

%o while(n<=maxx,q1=n^2-(n-1)^2;q2=n^2+(n-1)^2;

%o if(isprime(q1)&&isprime(q2),ptr++;write("b178659.txt",ptr," ",n));n++); } \\ _Bill McEachen_, Jun 13 2014

%Y Cf. A068501.

%K nonn

%O 1,1

%A _Vladimir Joseph Stephan Orlovsky_, Jun 01 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 15:34 EDT 2024. Contains 371794 sequences. (Running on oeis4.)