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.

A377972 a(n) is the greatest i such that 2n-prime(i) is also a prime, where prime(i) is the i-th prime.

This page as a plain text file.
%I A377972 #19 Nov 19 2024 02:23:56
%S A377972 1,2,3,4,4,5,6,6,7,8,8,9,9,9,10,11,11,11,12,12,13,14,14,15,15,15,16,
%T A377972 16,16,17,18,18,18,19,19,20,21,21,21,22,22,23,23,23,24,24,24,22,25,25,
%U A377972 26,27,27,28,29,29,30,30,30,29,30,30,29,31,31,32
%N A377972 a(n) is the greatest i such that 2n-prime(i) is also a prime, where prime(i) is the i-th prime.
%F A377972 a(n) = A000720(A020482(n)).
%F A377972 prime(a(n)) + prime(A377758(n)) = 2*n.
%e A377972 For n=2, 2*2 - 2 = 2 and pi(2) = 1.
%e A377972 For n=3, 2*3 - 3 = 3, pi(3)=2.
%t A377972 Table[Max[PrimePi[Flatten[Select[IntegerPartitions[2 n, {2}], AllTrue[#, PrimeQ] &]]]], {n, 2, 101}]
%o A377972 (PARI) a(n) = forprime(q=2, n, if(isprime(2*n-q), return(primepi(2*n-q)))); \\ _Michel Marcus_, Nov 16 2024
%Y A377972 Cf. A000040, A000720, A020482, A377758.
%K A377972 nonn
%O A377972 2,2
%A A377972 _Michel Eduardo Beleza Yamagishi_, Nov 13 2024