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!)
A074924 Numbers whose square is the sum of two successive primes. 22

%I #46 May 25 2022 01:59:16

%S 6,10,12,24,42,48,62,72,84,90,110,120,122,174,204,208,220,232,240,264,

%T 306,326,336,372,386,408,410,444,454,456,468,470,474,522,546,550,594,

%U 600,630,640,642,686,740,750,762,766,788,802,852,876,882,920,936,970

%N Numbers whose square is the sum of two successive primes.

%H Zak Seidov, <a href="/A074924/b074924.txt">Table of n, a(n) for n = 1..22054</a> (all terms up to 10^6).

%F a(n) = sqrt(A062703(n)). - _Zak Seidov_, May 26 2013

%F a(n) = A000040(i) + A000040(i+1) with i = A064397(n) = A000720(A061275(n)). - _M. F. Hasler_, Jan 03 2020

%e 6^2 = 17 + 19, 1610^2 = 1296041 + 1296059.

%t Select[Sqrt[#]&/@(Total/@Partition[Prime[Range[50000]],2,1]),IntegerQ] (* _Harvey P. Dale_, Oct 04 2014 *)

%o (PARI) is(n)=if(n%2, return(0)); nextprime(n^2/2+1)+precprime(n^2/2)==n^2 \\ _Charles R Greathouse IV_, Apr 29 2015

%o (PARI) select( {is_A074924(n)=!bittest(n=n^2,0) && precprime(n\2)+nextprime(n\/2)==n}, [1..999]) \\ _M. F. Hasler_, Jan 03 2020

%o (PARI) A74924=[6]; apply( A074924(n)={while(n>#A74924, my(N=A74924[#A74924]); until( is_A074924(N+=2),);A74924=concat(A74924,N));A74924[n]}, [1..99]) \\ _M. F. Hasler_, Jan 03 2020

%o (Python)

%o from itertools import count, islice

%o from sympy import nextprime, prevprime

%o def agen(): # generator of terms

%o for k in count(4, step=2):

%o kk = k*k

%o if prevprime(kk//2+1) + nextprime(kk//2-1) == kk:

%o yield k

%o print(list(islice(agen(), 54))) # _Michael S. Branicky_, May 24 2022

%Y Square roots of squares in A001043.

%Y Cf. A062703 (the squares), A061275 (lesser of the primes), A064397 (index of that prime).

%Y Cf. A064397 (numbers n such that prime(n) + prime(n+1) is a square), A071220 (prime(n) + prime(n+1) is a cube), A074925 (n^3 is sum of 2 consecutive primes).

%K nonn

%O 1,1

%A _Zak Seidov_, Oct 02 2002

%E Crossrefs section corrected and extended by _M. F. Hasler_, Jan 03 2020

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 July 12 04:44 EDT 2024. Contains 374237 sequences. (Running on oeis4.)