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!)
A106545 a(n) = n^2 if n^2 is the sum of two primes, otherwise a(n) = 0. 3

%I #10 Jul 21 2018 13:04:26

%S 0,4,9,16,25,36,49,64,81,100,0,144,169,196,225,256,0,324,361,400,441,

%T 484,0,576,0,676,729,784,841,900,0,1024,1089,1156,1225,1296,1369,1444,

%U 0,1600,0,1764,1849,1936,0,2116,2209,2304,2401,2500,0,2704,0,2916,3025

%N a(n) = n^2 if n^2 is the sum of two primes, otherwise a(n) = 0.

%C For odd n, n^2 is odd so the two primes must be opposite in parity. Lesser prime must be 2 and greater prime must be n^2-2. Thus for odd n, n^2 is the sum of two primes iff n^2-2 is prime.

%H Harvey P. Dale, <a href="/A106545/b106545.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = n^2 - A106544(n).

%e a(2) = 2^2 = 4 = 2+2, a(5) = 5^2 = 25 = 23+2 (two primes).

%e a(1) = 0 because the sum of two primes is at least 4 and a(11) = 0 because 11^2 - 2 = 119 = 7*17 is composite.

%t stpQ[n_]:=If[OddQ[n],PrimeQ[n^2-2],AnyTrue[n^2-Prime[Range[ PrimePi[ n^2]]], PrimeQ]]; Table[If[stpQ[n],n^2,0],{n,60}] (* The program uses the AnyTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Jul 21 2018 *)

%Y Cf. A106544-A106548, A106562-A106564, A106571, A106573-A106575, A106577.

%K easy,nonn

%O 1,2

%A _Alexandre Wajnberg_, May 08 2005

%E Edited and extended by _Klaus Brockhaus_ and _Ray Chandler_, May 12 2005

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 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)