# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a048646 Showing 1-1 of 1 %I A048646 #17 Jul 10 2021 10:49:34 %S A048646 7,13,19,37,41,107,191,223,379,487,997,1063,1093,1201,1301,1907,2029, %T A048646 3019,3169,3371,5081,5099,5693,6037,9041,9619,9721,9907,10007,11681, %U A048646 12227,12763,17393,18493,19013,19213,19219,21059,21157,21193,25931 %N A048646 Primes p such that the decimal digits of p^2 can be partitioned into two or more nonzero squares. %H A048646 Reinhard Zumkeller, Table of n, a(n) for n = 1..1000 %e A048646 7 is present because 7^2=49 can be partitioned into two squares 4 and 9; 13^2 = 169 = 16_9; 37^2 = 1369 = 1_36_9. %e A048646 997^2 = 994009 = 9_9_400_9, 1063^2 = 1129969 = 1_12996_9, 997 and 1063 are primes, so 997 and 1063 are in the sequence. %o A048646 (Haskell) %o A048646 a048646 n = a048646_list !! (n-1) %o A048646 a048646_list = filter ((== 1) . a010051') a048653_list %o A048646 -- _Reinhard Zumkeller_, Apr 17 2015 %o A048646 (Python) %o A048646 from math import isqrt %o A048646 from sympy import primerange %o A048646 def issquare(n): return isqrt(n)**2 == n %o A048646 def ok(n, c): %o A048646 if n%10 in {2, 3, 7, 8}: return False %o A048646 if issquare(n) and c > 1: return True %o A048646 d = str(n) %o A048646 for i in range(1, len(d)): %o A048646 if d[i] != '0' and issquare(int(d[:i])) and ok(int(d[i:]), c+1): %o A048646 return True %o A048646 return False %o A048646 def aupto(lim): return [p for p in primerange(1, lim+1) if ok(p*p, 1)] %o A048646 print(aupto(25931)) # _Michael S. Branicky_, Jul 10 2021 %Y A048646 Cf. A048375. %Y A048646 Cf. A010051, intersection of A048653 and A000040. %K A048646 nice,nonn,base %O A048646 1,1 %A A048646 _Felice Russo_ %E A048646 Corrected and extended by _Naohiro Nomoto_, Sep 01 2001 %E A048646 "Nonzero" added to definition by _N. J. A. Sloane_, May 08 2021 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE