%I #13 May 31 2017 09:33:20
%S 31,71,311,551,1151,14831,45791,455471,2035271,6345239,7241615,
%T 8290031,8329991,9086231,9324351,10449575,11497199,15454151,16515815,
%U 18337271,20650811,22946591,27609311,33220079,40487471,44106191,45015791,49021199,53315519,54536519
%N Intersection of A034961 and A127345.
%C Surprisingly many terms are prime numbers: 31,71,311,1151,14831,455471.
%C Positions of a(n) in A127345: {1,2,4,5,7,19,30,76,142}.
%C Positions of a(n) in A034961: {4,8,26,41,75,660,1780,14009,54929}.
%C Positions of primes in a(n): {1,2,3,5,6,8,21,22,25,32,37,39,40,45,49,50, 59,62,66,69,...}. - _Michael De Vlieger_, May 28 2017
%H Chai Wah Wu, <a href="/A287609/b287609.txt">Table of n, a(n) for n = 1..10000</a>
%e 31 is in the sequence because it is both the total of three consecutive primes (7 + 11 + 13) and it is (2*3 + 2*5 + 3*5) = (6 + 10 + 15). - _Michael De Vlieger_, May 28 2017
%t Intersection[Map[Total, #], Map[#1 #2 + #1 #3 + #2 #3 & @@ # &, #]] &@ Partition[Prime@ Range[10^6], 3, 1] (* _Michael De Vlieger_, May 28 2017 *)
%o (Python)
%o from __future__ import division
%o from sympy import isprime, prevprime, nextprime
%o A287609_list, p, q, r = [], 2, 3, 5
%o while r < 10**6:
%o n = p*(q+r) + q*r
%o m = n//3
%o pm, nm = prevprime(m), nextprime(m)
%o k = n - pm - nm
%o if isprime(m):
%o if m == k:
%o A287609_list.append(n)
%o else:
%o if nextprime(nm) == k or prevprime(pm) == k:
%o A287609_list.append(n)
%o p, q, r = q, r, nextprime(r) # _Chai Wah Wu_, May 31 2017
%Y Cf. A034961, A127345.
%K nonn
%O 1,1
%A _Zak Seidov_, May 27 2017
%E More terms from _Michael De Vlieger_, May 28 2017
|