login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A238334 Squares that do not contain a shorter substring that is a square. 4

%I #16 Feb 23 2023 11:32:07

%S 0,1,4,9,25,36,576,676,5776,27556,33856,538756,586756,665856,682276,

%T 763876,767376,853776,872356,2637376,2775556,2835856,5635876,6885376,

%U 7376656,22886656,23755876,23775376,26275876,26687556,26873856,32672656,32878756,37527876

%N Squares that do not contain a shorter substring that is a square.

%H Giovanni Resta, <a href="/A238334/b238334.txt">Table of n, a(n) for n = 1..10000</a>

%H Michael S. Branicky, <a href="/A238334/a238334.py.txt">Python program</a>

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Substring">Substring</a>

%t fQ[n_] := Module[{d = IntegerDigits[n], len, ds, sq}, len = Length[d]; ds = FromDigits /@ Flatten[Table[Partition[d, i, 1], {i, len - 1}], 1]; sq = Select[ds, IntegerQ[Sqrt[#]] &]; sq == {}]; Select[Range[0, 10000]^2, fQ]

%o (Python) # see link for faster version for producing b-file

%o from math import isqrt

%o from itertools import count, islice

%o def issquare(n): return isqrt(n)**2 == n

%o def cond(s):

%o if len(s) == 1: return True

%o if any(d in s for d in "0149"): return False

%o ss = (s[i:i+l] for i in range(len(s)) for l in range(2, len(s)))

%o return not any(issquare(int(u)) for u in ss)

%o def agen(): yield from (k**2 for k in count(0) if cond(str(k**2)))

%o print(list(islice(agen(), 34))) # _Michael S. Branicky_, Feb 23 2023

%Y Cf. A130448.

%K nonn,base

%O 1,3

%A _T. D. Noe_, Mar 05 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 05:36 EDT 2024. Contains 371918 sequences. (Running on oeis4.)