cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A343564 a(n) is the sum of 2*n mod p for primes p such that 2*n-p is prime.

This page as a plain text file.
%I A343564 #12 Apr 20 2021 22:42:23
%S A343564 0,0,0,5,4,7,5,10,19,18,11,32,17,25,45,24,25,56,10,45,66,32,39,96,68,
%T A343564 55,99,59,46,148,29,104,138,49,103,162,81,112,164,91,109,260,64,105,
%U A343564 316,115,104,235,119,202,294,188,127,319,224,251,409,177,162,500,124,181,504,135,315,437,187,271
%N A343564 a(n) is the sum of 2*n mod p for primes p such that 2*n-p is prime.
%C A343564 Conjecture: the only n for which a(n) <= n are 1, 2, 3, 5, 7, 11, 19, and 31.
%H A343564 Robert Israel, <a href="/A343564/b343564.txt">Table of n, a(n) for n = 1..10000</a>
%e A343564 For n=5, we have 2*n = 3+7 = 5+5, and a(5) = (10 mod 3)+(10 mod 5)+(10 mod 7) = 1+0+3 = 4.
%p A343564 N:= 1000: # for a(1)..a(N)
%p A343564 P:= select(isprime,[seq(i,i=3..2*N)]):
%p A343564 f:= proc(n) local m,Q,q;
%p A343564   m:= ListTools:-BinaryPlace(P,2*n);
%p A343564   Q:= convert(P[1..m],set);
%p A343564   Q:= Q intersect map(t -> 2*n-t, Q);
%p A343564   add(2*n mod q, q = Q);
%p A343564 end proc:
%p A343564 map(f, [$1..N]);
%o A343564 (PARI) a(n) = my(p=2, s=0); forprime(p=2, 2*n, if (isprime(2*n-p), s += (2*n % p))); s; \\ _Michel Marcus_, Apr 20 2021
%Y A343564 Cf. A171637, A343566.
%K A343564 nonn
%O A343564 1,4
%A A343564 _J. M. Bergot_ and _Robert Israel_, Apr 20 2021