A348831 Positive numbers whose square starts and ends with exactly 44, and no 444.
212, 2112, 6638, 6662, 6688, 20988, 21012, 21062, 21112, 21138, 21162, 21188, 21212, 66338, 66362, 66388, 66412, 66438, 66488, 66512, 66562, 66588, 66612, 66712, 66738, 66762, 66788, 66812, 66838, 66862, 66888, 66912, 66938, 66988, 67012, 67062, 209762, 209788
Offset: 1
Examples
212 is a term since 212^2 = 44944. 662 is not a term since 662^2 = 438244. 668 is not a term since 668^2 = 446224. 2108 is not a term since 2108^2 = 4443664. 21038 is not a term since 21038^2 = 442597444. 21088 is not a term since 21088^2 = 444703744.
Crossrefs
Programs
-
Magma
fd:=func
; fs:=func ; [n:n in [1..210000]|fd(n) and fs(n)]; // Marius A. Burtea, Nov 08 2021 -
Mathematica
Select[Range[10, 300000], (d = IntegerDigits[#^2])[[1 ;; 2]] == d[[-2 ;; -1]] == {4, 4} && d[[-3]] != 4 && d[[3]] != 4 &] (* Amiram Eldar, Nov 08 2021 *)
-
Python
from itertools import count, takewhile def ok(n): s = str(n*n); return len(s.rstrip("4")) == len(s.lstrip("4")) == len(s)-2 def aupto(N): ends = [12, 38, 62, 88] r = takewhile(lambda x: x<=N, (100*i+d for i in count(0) for d in ends)) return [k for k in r if ok(k)] print(aupto(209788)) # Michael S. Branicky, Nov 08 2021
Comments