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!)
A340465 Primes of the form prime(i)*prime(i+1)+prime(i+2)*prime(i+3)+...+prime(k-1)*prime(k). 2

%I #15 Jan 10 2021 22:11:04

%S 41,313,2137,6569,7853,10133,10847,12401,13757,14747,17569,17911,

%T 24001,24049,27901,31307,38729,43177,43961,44819,51607,69191,81517,

%U 88379,104683,107099,130631,137177,138239,145967,154487,154723,158777,162947,175463,184409,192853,196169,232499,243137,261983

%N Primes of the form prime(i)*prime(i+1)+prime(i+2)*prime(i+3)+...+prime(k-1)*prime(k).

%C A prime that has more than one expression of the given form is included only once. The first such prime is a(14353) = 6858604873 = 1979*1987+...+7109*7121 = 19949*19961+...+20231*20233.

%H Robert Israel, <a href="/A340465/b340465.txt">Table of n, a(n) for n = 1..10000</a>

%e a(1) = 2*3+5*7 = 41.

%e a(2) = 3*5+7*11+13*17 = 313.

%e a(3) = 17*19+23*29+31*37 = 2137.

%e a(4) = 5*7+11*13+17*19+23*29+31*37+41*43+47*53 = 6569.

%e a(5) = 41*43+47*53+59*61 = 7853.

%p S1:= [0,seq(ithprime(2*i)*ithprime(2*i+1),i=1..100)]:

%p P1:= ListTools:-PartialSums(S1):

%p S2:= [0,seq(ithprime(2*i-1)*ithprime(2*i),i=1..100)]:

%p P2:= ListTools:-PartialSums(S2):

%p M:= 2*max(S1):

%p S:= select(t -> t < M and isprime(t), {seq(seq(P1[i]-P1[j],j=i mod 2 + 1 .. i-2,2),i=1..101)} union {seq(seq(P2[i]-P2[j],j=i mod 2 + 1..i-2,2),i=1..101)} union {seq(P2[i],i=1..101,2)}):

%p sort(convert(S,list));

%o (Python)

%o from sympy import isprime, nextprime, prime

%o def sp2(lst):

%o ans = 0

%o for i in range(0, len(lst), 2): ans += lst[i]*lst[i+1]

%o return ans

%o def aupto(nn):

%o alst, i = [], 1

%o while True:

%o consec2i = [prime(j+1) for j in range(2*i)]; sp = sp2(consec2i)

%o if sp > nn: break

%o while sp <= nn:

%o if isprime(sp): alst.append(sp)

%o consec2i = consec2i[1:] + [nextprime(consec2i[-1])]; sp = sp2(consec2i)

%o i += 1

%o return sorted(alst)

%o print(aupto(261983)) # _Michael S. Branicky_, Jan 08 2021

%Y Includes A340464.

%K nonn

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, Jan 08 2021

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 18 06:24 EDT 2024. Contains 371769 sequences. (Running on oeis4.)