cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A066591 Primes which can be expressed as a concatenation of nonnegative squares.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Dec 21 2001

Keywords

Comments

All terms are == {1,9} mod 10. - Zak Seidov, Jul 16 2015
The surprising prime 162536496481 is the concatenation of the 6 double-digit squares in increasing order (see Prime Curios! link). - Bernard Schott, Nov 19 2020

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.
		

Crossrefs

A061246 and A167535 are subsequences. - Zak Seidov, Jul 16 2015

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