A348832 Positive numbers whose square starts and ends with exactly 444.
666462, 666538, 666962, 667038, 2107462, 2107538, 2107962, 2108038, 2108462, 2108538, 2108962, 2109038, 2109462, 6663462, 6663538, 6663962, 6664038, 6664462, 6664538, 6664962, 6665038, 6665462, 6665538, 6665962, 6666038, 6667462, 6667538, 6667962, 6668038, 6668462, 6668538, 6668962
Offset: 1
Examples
666462 is a term since 666462^2 = 444171597444. 21038 is not a term since 21038^2 = 442597444.
References
- A. Gardiner, The Mathematical Olympiad Handbook: An Introduction to Problem Solving, Oxford University Press, 1997, reprinted 2011, Pb 1 pp. 55 and 95-96 (1995)
Links
- British Mathematical Olympiad 1975, Problem 1.
Crossrefs
Programs
-
Magma
fd:=func
; fs:=func ; [n:n in [1..6700000]|fd(n) and fs(n)]; // Marius A. Burtea, Nov 09 2021 -
Mathematica
Select[Range[100, 7*10^6], (d = IntegerDigits[#^2])[[1 ;; 3]] == d[[-3 ;; -1]] == {4, 4, 4} && d[[-4]] != 4 && d[[4]] != 4 &] (* Amiram Eldar, Nov 09 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)-3 def aupto(N): ends = [38, 462, 538, 962] r = takewhile(lambda x: x<=N, (1000*i+d for i in count(0) for d in ends)) return [k for k in r if ok(k)] print(aupto(6668962)) # Michael S. Branicky, Nov 09 2021
Comments