login
Numbers k such that prime(k-1) + 5 is square and equal to prime(k+1) - 1.
4

%I #32 Aug 27 2022 08:12:56

%S 6,44,41202,123125,141582,527569,920270,975866,1034000,1278000,

%T 1504258,1707305,1774017,1863515,2513332,2776350,3315370,5100781,

%U 5152209,5746269,5943102,7380924,7891751,8585974,10100295,11022570,12248841,13213333,13654151,13817964

%N Numbers k such that prime(k-1) + 5 is square and equal to prime(k+1) - 1.

%C Conjecture: If the condition holds, prime(k-1) and prime(k) are twin primes of the form 10m+1 and 10m+3. I.e., the last digits are 1 and 3.

%C This is so because prime(k-1)+5 square => possible ending digits of 0,1,4,5,6,9. To get ending digits for prime(k-1) we subtract 5 to get ending digits 5,6,9,0,1,4. So 1,9 are the only possible endings since 0,4,5,6 => prime(k-1) not prime, impossible. Now by the condition of equality, prime(k-1)+6 = prime(k+1). So if prime(k-1) ends in 9, prime(k-1)+6 ends in 5 => prime(k+1) not prime, impossible. Therefore prime(k-1) ends in 1 and by the condition of prime(k-1) and prime(k) being twin primes, prime(k) ends in 3. This sequence is a variation of the conjecture provided in the link.

%C The PARI script allows for general investigation of numbers of the form prime(k-1)+a and prime(k+1)-b. The values a=5,7; b=1 consistently yield twin primes when the condition holds. Notice we test for square of the first prime(k-1) retrieval before calling the second prime(k+1). This cuts the search time in half. A much faster and more inclusive program is in the Link.

%H Charles R Greathouse IV, <a href="/A158460/b158460.txt">Table of n, a(n) for n = 1..10000</a>

%H Cino Hilliard, <a href="http://cid-49c0c9de717c6213.skydrive.live.com/self.aspx/Public/integerequal/integerequal.c">C Program</a> [broken link]

%H S. M. Ruiz, <a href="http://groups.yahoo.com/group/primenumbers/message/19899">Integer equal</a>

%H Sebastian Martin Ruiz and others, <a href="/A158460/a158460.txt">Integers then Equals</a>, digest of 7 messages in primenumbers Yahoo group, Mar 14 - Mar 20, 2009.

%e For k=6, prime(6-1) = 11, 11+5 = 16 = prime(6+1)-1 = 17-1 so 6 is the first term in the sequence.

%o (PARI) integerequal(m, n, a, b) = {local(x, p1, p2); for(x=m, n, p1=prime(x-1); if(issquare(p1+a), p2=prime(x+1); if((p1+a)==(p2-b), print(x", "p1", "prime(x)))));}

%Y Cf. A158509.

%K nonn

%O 1,1

%A _Cino Hilliard_, Mar 19 2009

%E More terms from _Alois P. Heinz_, Sep 07 2016