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.

A068493 Primes which are concatenations of positive squares.

This page as a plain text file.
%I A068493 #21 Feb 20 2024 13:16:37
%S A068493 11,19,41,149,181,191,199,251,419,449,491,499,641,811,911,919,941,991,
%T A068493 1009,1181,1259,1289,1361,1481,1499,1619,1699,1811,1949,1999,2251,
%U A068493 2549,2591,3691,4001,4111,4259,4289,4441,4481,4649,4729,4919,4999,6449,6481,6491
%N A068493 Primes which are concatenations of positive squares.
%H A068493 Michael S. Branicky, <a href="/A068493/b068493.txt">Table of n, a(n) for n = 1..10000</a>
%e A068493 149 is a term of the sequence since it is the concatenation of squares 1, 4, 9.
%e A068493 251 is a term of the sequence since it is the concatenation of squares 25, 1. - _Sean A. Irvine_, Feb 19 2024
%o A068493 (Python)
%o A068493 from sympy import primerange
%o A068493 from itertools import count, islice
%o A068493 def iscat(w, A):
%o A068493     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)))
%o A068493 def agen():
%o A068493     S = set()
%o A068493     for d in count(2):
%o A068493         S |= {str(i*i) for i in range(10**(d-2), 10**(d-1))}
%o A068493         for p in primerange(10**(d-1), 10**d):
%o A068493             if iscat(str(p), S):
%o A068493                 yield p
%o A068493 print(list(islice(agen(), 50))) # _Michael S. Branicky_, Feb 20 2024
%Y A068493 Cf. A000290, subsequence of A066591.
%K A068493 base,nonn
%O A068493 1,1
%A A068493 _Joseph L. Pe_, Mar 11 2002
%E A068493 Corrected and extended by _Sascha Kurz_, Mar 26 2002
%E A068493 Data corrected by _Sean A. Irvine_, Feb 19 2024