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.

A105016 Smallest a(n) such that a(n)^2 - n is a positive prime, or 0 if no such a(n) exists.

This page as a plain text file.
%I A105016 #8 Oct 31 2023 11:05:34
%S A105016 0,2,2,4,3,4,3,3,5,4,9,4,5,4,4,14,0,6,5,6,5,8,5,5,11,6,7,8,9,6,7,6,7,
%T A105016 6,6,8,7,12,7,10,9,8,7,12,7,8,7,7,11,0,9,8,9,8,11,12,13,8,9,8,11,8,8,
%U A105016 10,9,12,13,18,9,10,9,10,13,12,9,16,9,10,9,9,11,10,21,10,11,12,13,10,15,10
%N A105016 Smallest a(n) such that a(n)^2 - n is a positive prime, or 0 if no such a(n) exists.
%C A105016 An old ARML problem asked for the smallest n>0 such that a(n) does not exist.
%H A105016 T. D. Noe, <a href="/A105016/b105016.txt">Table of n, a(n) for n = 0..10000</a>
%e A105016 a(8) = 5 because 5^2 - 8 = 17 is the smallest square that gives a prime difference.
%e A105016 a(16) = 0 because if x^2 - 16 is prime, then a prime equals (x+4)(x-4), which is impossible.
%t A105016 Table[s = Sqrt[n]; If[IntegerQ[s], If[PrimeQ[(s + 1)^2 - n], k = s + 1, k = 0], k = Ceiling[s]; While[! PrimeQ[k^2 - n], k++]]; k, {n, 0, 100}] (* _T. D. Noe_, Apr 17 2011 *)
%Y A105016 Cf. A075555 for the primes = a(n)^2 - n.
%K A105016 nonn
%O A105016 0,2
%A A105016 _Joshua Zucker_, Mar 31 2005