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.
%I A348832 #34 Sep 08 2022 08:46:26 %S A348832 666462,666538,666962,667038,2107462,2107538,2107962,2108038,2108462, %T A348832 2108538,2108962,2109038,2109462,6663462,6663538,6663962,6664038, %U A348832 6664462,6664538,6664962,6665038,6665462,6665538,6665962,6666038,6667462,6667538,6667962,6668038,6668462,6668538,6668962 %N A348832 Positive numbers whose square starts and ends with exactly 444. %C A348832 The 1st problem of British Mathematical Olympiad (BMO) in 1995 (see link) asked to find all positive integers whose squares end in three 4’s (A039685); this sequence is the subsequence of these integers whose squares also start in precisely three 4's (no four or more 4's). Two such infinite subsequences are proposed below. %C A348832 When a square starts and ends with digits ddd, then ddd is necessarily 444. %C A348832 The first 3 digits of terms are either 210, 666 or 667, while the last 3 digits are either 038, 462, 538 or 962 (see examples). %C A348832 From _Marius A. Burtea_, Nov 09 2021 : (Start) %C A348832 The sequence is infinite because the numbers 667038, 6670038, 66700038, 667000038, ..., 667*10^k + 38, k >= 3, are terms because are square 444939693444, 44489406921444, 4448895069201444, 444889050692001444, 44488900506920001444, ... %C A348832 Also, 6663462, 66633462, 666333462, 6663333462, ..., (1999*10^k + 386) / 3, k >= 4, are terms and have no digits 0, because their squares are 44401725825444, 4440018258105444, 444000282580905444, 44400012825808905444, %C A348832 4440001128258088905444, ... (End) %D A348832 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) %H A348832 British Mathematical Olympiad 1975, <a href="https://bmos.ukmt.org.uk/home/bmo1-1995.pdf">Problem 1</a>. %e A348832 666462 is a term since 666462^2 = 444171597444. %e A348832 21038 is not a term since 21038^2 = 442597444. %t A348832 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 *) %o A348832 (Python) %o A348832 from itertools import count, takewhile %o A348832 def ok(n): %o A348832 s = str(n*n); return len(s.rstrip("4")) == len(s.lstrip("4")) == len(s)-3 %o A348832 def aupto(N): %o A348832 ends = [38, 462, 538, 962] %o A348832 r = takewhile(lambda x: x<=N, (1000*i+d for i in count(0) for d in ends)) %o A348832 return [k for k in r if ok(k)] %o A348832 print(aupto(6668962)) # _Michael S. Branicky_, Nov 09 2021 %o A348832 (Magma) fd:=func<n|Seqint(Intseq(n*n)) mod 1000 eq 444 and Seqint(Intseq(n*n)) mod 10000 ne 4444>; fs:=func<n|Seqint(Reverse(Intseq(n*n))) mod 1000 eq 444 and Seqint(Reverse(Intseq(n*n))) mod 10000 ne 4444>; [n:n in [1..6700000]|fd(n) and fs(n)]; // _Marius A. Burtea_, Nov 09 2021 %Y A348832 Cf. A017317, A328886. %Y A348832 Subsequence of A039685, A045858, A273375, A305719, A346892. %Y A348832 Similar to: A348488 (d=4), A348831 (dd=44), this sequence (ddd=444). %K A348832 nonn,base %O A348832 1,1 %A A348832 _Bernard Schott_, Nov 09 2021