A066591 Primes which can be expressed as a concatenation of nonnegative squares.
11, 19, 41, 101, 109, 149, 181, 191, 199, 251, 401, 409, 419, 449, 491, 499, 641, 811, 911, 919, 941, 991, 1009, 1019, 1049, 1091, 1109, 1181, 1259, 1289, 1361, 1409, 1481, 1499, 1601, 1609, 1619, 1699, 1811, 1901, 1949, 1999, 2251, 2549, 2591, 3691
Offset: 1
Examples
96181 is a term as it is a concatenation of 961 and 81 both of which are squares. 100169 is a term as it is a concatenation of 100 and 169 in one way and also that of 1, 0, 0, 16 and 9 in another way.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000 (terms 1..2103 from Robert Israel)
- Chris K. Caldwell and G. L. Honaker, Jr., 1625364981, Prime Curios!
Crossrefs
Programs
-
Maple
N:= 10^4: # to get all terms <= N catn:= proc(x,y) if y=0 then 10*x else x*10^(ilog10(y)+1)+y fi end proc: Sq:= {seq(i^2,i=0..floor(sqrt(N)))}: Agenda:= Sq: S:= Sq: while Agenda <> {} do Agenda:= select(`<=`,{seq(seq(catn(f,g),f=Agenda),g=Sq)},N) minus S; S:= S union Agenda; od: sort(convert(select(isprime,S),list)); # Robert Israel, Jul 16 2015
-
Python
from sympy import sieve from itertools import count, islice def iscat(w, A): return False if len(w) < 2 else any(w[:i] in A and (w[i:] in A or iscat(w[i:], A)) for i in range(1, len(w))) def agen(): S = {"0"} for d in count(2): S |= {str(i*i) for i in range(10**(d-2), 10**(d-1))} for p in sieve.primerange(10**(d-1), 10**d): if iscat(str(p), S): yield p print(list(islice(agen(), 50))) # Michael S. Branicky, Feb 20 2024
Extensions
Corrected and extended by Christopher Lund (clund(AT)san.rr.com), Apr 11 2002
Comments