login
Primes that can be constructed by concatenating two squares >= 4.
2

%I #16 Jun 18 2021 01:14:30

%S 449,499,1009,1699,2549,4289,4441,4729,6449,6481,8419,9619,12149,

%T 14449,16361,16529,16729,16981,19681,21169,22549,24019,25121,25169,

%U 25841,28099,28949,30259,34819,36529,38449,41521,41681,41849,42209,43481,43721,43969,45329,46889

%N Primes that can be constructed by concatenating two squares >= 4.

%C If we allow 1, we get sequence A167535.

%H Robert Israel, <a href="/A345314/b345314.txt">Table of n, a(n) for n = 1..10000</a>

%e 449 is a prime that is a concatenation of two squares: 4 and 49.

%p zcat:= proc(a,b) 10^(1+ilog10(b))*a+b end proc:

%p select(t -> t <= 10^5 and isprime(t), {seq(seq(zcat(a^2,b^2),a=2..100),b=3..1000,2)}); # _Robert Israel_, Jun 17 2021

%t Take[Select[Union[Flatten[Table[FromDigits[Join[IntegerDigits[n^2],IntegerDigits[k^2]]], {n, 2, 300}, {k, 2, 300}]]], PrimeQ[#] &], 60]

%o (Python)

%o from sympy import isprime

%o def aupto(lim):

%o s = list(i**2 for i in range(2, int(lim**(1/2))+2))

%o t = set(int(str(a)+str(b)) for a in s for b in s)

%o return sorted(filter(isprime, filter(lambda x: x<=lim, t)))

%o print(aupto(49000)) # _Michael S. Branicky_, Jun 13 2021

%Y Cf. A167535.

%K nonn,base

%O 1,1

%A _Tanya Khovanova_, Jun 13 2021