login
A356178
Numbers k such that both Sum_{i=1..k} i*prime(i) and Sum_{i=1..k} (k+1-i)*prime(i) are prime.
1
1, 3, 199, 351, 1583, 1955, 2579, 2627, 3251, 3407, 3503, 5311, 6359, 6819, 7295, 7547, 8791, 9663, 10143, 10591, 11499, 11579, 12199, 12443, 14527, 15563, 15583, 16051, 16543, 16655, 18047, 18319, 20691, 20847, 23979, 24079, 24575, 25667, 26491, 28235, 30395, 30627, 32235, 32259, 33091, 33287, 33527
OFFSET
1,2
COMMENTS
Numbers k such that A014148(k) and A014285(k) are both prime.
a(n) == 3 (mod 4) for n > 1.
LINKS
EXAMPLE
a(2) = 3 is a term because Sum_{i=1..3} i*prime(i) = 1*2 + 2*3 + 3*5 = 23 and Sum_{i=1..3} (4-i)*prime(i) = 3*2 + 2*3 + 1*5 = 17 are prime.
MAPLE
S1:= 2: S2:= 2: S3:= 2*S2-S1: R:= 1: count:= 1: p:= 2:
for n from 2 to 40000 do
p:= nextprime(p);
S1:= S1 + n*p;
S2:= S2 + p;
if n mod 4 = 3 and isprime(S1) then
S3:= (n+1)*S2 - S1;
if isprime(S3) then
count:= count+1; R:= R, n;
fi
fi;
od:
R;
MATHEMATICA
r = Range[35000]; p = Prime[r]; Intersection[Position[Accumulate[r*p], _?PrimeQ], Position[Accumulate[Accumulate[p]], _?PrimeQ]] // Flatten (* Amiram Eldar, Jul 28 2022 *)
PROG
(PARI) isok(k) = my(vp=primes(k)); isprime(sum(i=1, k, i*vp[i])) && isprime(sum(i=1, k, (k+1-i)*vp[i])); \\ Michel Marcus, Jul 29 2022
CROSSREFS
Sequence in context: A157598 A023310 A054701 * A342578 A264674 A306630
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jul 28 2022
STATUS
approved