login
A048646
Primes p such that the decimal digits of p^2 can be partitioned into two or more nonzero squares.
5
7, 13, 19, 37, 41, 107, 191, 223, 379, 487, 997, 1063, 1093, 1201, 1301, 1907, 2029, 3019, 3169, 3371, 5081, 5099, 5693, 6037, 9041, 9619, 9721, 9907, 10007, 11681, 12227, 12763, 17393, 18493, 19013, 19213, 19219, 21059, 21157, 21193, 25931
OFFSET
1,1
LINKS
EXAMPLE
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.
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.
PROG
(Haskell)
a048646 n = a048646_list !! (n-1)
a048646_list = filter ((== 1) . a010051') a048653_list
-- Reinhard Zumkeller, Apr 17 2015
(Python)
from math import isqrt
from sympy import primerange
def issquare(n): return isqrt(n)**2 == n
def ok(n, c):
if n%10 in {2, 3, 7, 8}: return False
if issquare(n) and c > 1: return True
d = str(n)
for i in range(1, len(d)):
if d[i] != '0' and issquare(int(d[:i])) and ok(int(d[i:]), c+1):
return True
return False
def aupto(lim): return [p for p in primerange(1, lim+1) if ok(p*p, 1)]
print(aupto(25931)) # Michael S. Branicky, Jul 10 2021
CROSSREFS
Cf. A048375.
Cf. A010051, intersection of A048653 and A000040.
Sequence in context: A108295 A071923 A344045 * A152087 A098059 A078860
KEYWORD
nice,nonn,base
AUTHOR
EXTENSIONS
Corrected and extended by Naohiro Nomoto, Sep 01 2001
"Nonzero" added to definition by N. J. A. Sloane, May 08 2021
STATUS
approved