OFFSET
1,1
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
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
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