login
Primes that become squares when prefixed with a 7.
8

%I #21 Nov 12 2021 17:19:02

%S 29,569,1289,7841,62129,306209,436529,502121,634169,667361,935489,

%T 1723961,1927361,2131049,2437121,2539289,2948681,3153809,3564929,

%U 4080449,5116889,5846681,6160529,6790169,7316849,7845329,8269409,8481881,8694641,8801129,9869969

%N Primes that become squares when prefixed with a 7.

%H Vincenzo Librandi and David A. Corneth, <a href="/A167740/b167740.txt">Table of n, a(n) for n = 1..17124</a> (first 45 terms from Vincenzo Librandi)

%t Select[Prime[Range[10000]], IntegerQ[Sqrt[FromDigits[Join[{7}, IntegerDigits[#]]]]]&] (* _G. C. Greubel_, Jun 23 2016 *)

%o (PARI) isok(n) = isprime(n) && issquare(n + 7*10^(length(Str(n)))) \\ _Michel Marcus_, Aug 05 2013

%o (PARI)

%o \\ terms upto 10^n

%o upto(n) = {my(sqrt71 = sqrt(7.1), sqrt80 = sqrt(8.0),r); for(k=2, n, for(j = ceil((sqrt71 * sqrt(10^k))), floor(sqrt80 * sqrt(10^k)), r = j^2%10^k; if(isprime(r), print1(r", "))))} \\ _David A. Corneth_, Jun 24 2016

%Y Cf. A167734, A167735, A167736, A167737, A167738, A167739, A167741.

%K base,nonn

%O 1,1

%A _Claudio Meller_, Nov 10 2009

%E More terms from _Michel Marcus_, Aug 05 2013

%E Definition modified by _Harvey P. Dale_, Nov 12 2021