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.

A284327 a(n) is the least positive integer such that n^2 + a(n)^2 and n^2 + (a(n) - 2)^2 are primes.

This page as a plain text file.
%I A284327 #44 Feb 16 2025 08:33:43
%S A284327 1,1,10,1,4,1,10,5,16,1,6,25,10,1,4,1,10,7,16,1,46,15,20,1,6,1,22,15,
%T A284327 6,13,6,5,190,11,18,1,30,15,46,1,46,25,10,21,16,21,10,37,6,19,16,5,12,
%U A284327 1,6,1,52,5,26,31,26,45,40,11,4,1,20,7,196,19,16
%N A284327 a(n) is the least positive integer such that n^2 + a(n)^2 and n^2 + (a(n) - 2)^2 are primes.
%C A284327 n + i*a(n) and n + i*(a(n) - 2) are Gaussian twin primes.
%C A284327 If n^2 + 1 is a prime then a(n) = 1 else a(n) = A284211(n) + 2.
%H A284327 Lars-Erik Svahn, <a href="/A284327/b284327.txt">Table of n, a(n) for n = 1..99</a>
%H A284327 Lars-Erik Svahn, <a href="https://github.com/Lehs/ANS-Forth-libraries">numbertheory.4th</a>
%H A284327 Akshaa Vatwani, <a href="http://dx.doi.org/10.1016/j.jnt.2016.07.008">Bounded gaps between Gaussian primes</a>, Journal of Number Theory, Volume 171, February 2017, Pages 449-473.
%H A284327 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/GaussianPrime.html">Gaussian prime</a>
%H A284327 <a href="/index/Ga#gaussians">Index entries for Gaussian integers and primes</a>
%F A284327 a(n) = 1 for n in A005574. - _Michel Marcus_, Mar 31 2017
%e A284327 a(1) = 1 since 1^2 + 1^2 = 2 and 1^2 + (1 - 2)^2 = 2 are primes.
%t A284327 Rest@ FoldList[Module[{k = 1}, While[Times @@ Boole@ Map[PrimeQ, {#2^2 + k^2, #2^2 + (k - 2)^2}] < 1, k++]; k] &, 1, Range@ 71] (* _Michael De Vlieger_, Mar 25 2017 *)
%o A284327 (ANS-Forth)
%o A284327 s" numbertheory.4th" included
%o A284327 : Gauss_twins \ n -- a(n)
%o A284327   dup * locals| square | 0
%o A284327   begin 1+ dup dup * square + isprime
%o A284327      over 2 - dup * square + isprime and
%o A284327   until ;
%o A284327 (PARI) a(n) = k=0; while (! (isprime(n^2+k^2) && isprime(n^2+(k-2)^2)), k++); k; \\ _Michel Marcus_, Mar 25 2017
%o A284327 (Python)
%o A284327 from sympy import isprime
%o A284327 def a(n):
%o A284327     k=0
%o A284327     while True:
%o A284327         if isprime(n**2 + k**2) and isprime(n**2 + (k - 2)**2): return k
%o A284327         else: k+=1
%o A284327 print([a(n) for n in range(1, 101)]) # _Indranil Ghosh_, Mar 31 2017
%Y A284327 Cf. A005574, A069003, A284211, A284346.
%K A284327 nonn
%O A284327 1,3
%A A284327 _Lars-Erik Svahn_, Mar 25 2017