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.

A020481 Least p with p, q both prime, p+q = 2n.

This page as a plain text file.
%I A020481 #41 Nov 19 2024 15:58:35
%S A020481 2,3,3,3,5,3,3,5,3,3,5,3,5,7,3,3,5,7,3,5,3,3,5,3,5,7,3,5,7,3,3,5,7,3,
%T A020481 5,3,3,5,7,3,5,3,5,7,3,5,7,19,3,5,3,3,5,3,3,5,3,5,7,13,11,13,19,3,5,3,
%U A020481 5,7,3,3,5,7,11,11,3,3,5,7,3,5,7,3,5,3,5,7,3,5,7,3,3,5,7,11,11,3,3,5,3,3,5,7
%N A020481 Least p with p, q both prime, p+q = 2n.
%C A020481 Essentially the same as A002373, which does not have the a(2) term. - _T. D. Noe_, Sep 24 2007
%C A020481 a(n) = A171637(n,1). - _Reinhard Zumkeller_, Mar 03 2014
%C A020481 Conjecture: a(n) ~ O(n^1/2). - _Jon Perry_, Apr 29 2014
%H A020481 Harry J. Smith, <a href="/A020481/b020481.txt">Table of n, a(n) for n = 2..20000</a>
%H A020481 <a href="/index/Go#Goldbach">Index entries for sequences related to Goldbach conjecture</a>
%F A020481 a(n) = n - A047949(n). - _Jason Kimberley_, Oct 09 2012
%t A020481 a[n_] := For[p = 2, True, p = NextPrime[p], If[PrimeQ[2n-p], Return[p]]];
%t A020481 Table[a[n], {n, 2, 103}] (* _Jean-François Alcover_, Jul 31 2018  *)
%o A020481 (PARI) A020481(n) = {local(np);np=1;while(!isprime(2*n-prime(np)),np++);prime(np)} \\ _Michael B. Porter_, Dec 11 2009
%o A020481 (PARI) A020481(n)=forprime(p=1,n,isprime(2*n-p)&return(p)) \\ _M. F. Hasler_, Sep 18 2012
%o A020481 (Haskell)
%o A020481 a020481 n = head [p | p <- a000040_list, a010051' (2 * n - p) == 1]
%o A020481 -- _Reinhard Zumkeller_, Jul 07 2014, Mar 03 2014
%o A020481 (Python)
%o A020481 from sympy import isprime, primerange
%o A020481 def A020481(n): return next(filter(lambda p:isprime((n<<1)-p),primerange(2*n))) # _Chai Wah Wu_, Nov 19 2024
%Y A020481 Cf. A020482.
%K A020481 nonn
%O A020481 2,1
%A A020481 _David W. Wilson_