%I #33 Oct 02 2021 13:13:34
%S 235700,258200,333400,471400,577400,666700,816500,881900,942800,
%T 1054200,1054300,1054400,1054500,1490700,1490800,1490900,1825700,
%U 1825800,1825900,2108100,2108200,2108300,2357100,2581900,2788800,2788900,2981300,2981400,3162200,3333200,3333300
%N Numbers whose square starts and ends with exactly 4 identical digits.
%C Terms are equal to 100 times the primitive terms of A346940, those that have no trailing zero in decimal representation, hence all terms end with exactly 00.
%H Chai Wah Wu, <a href="/A346942/b346942.txt">Table of n, a(n) for n = 1..10000</a>
%e 258200 is a term because 258200^2 = 66667240000 starts with four 6's and ends with four 0's.
%e 3334700 is not a term because 3334700^2 = 1111155560000 starts with five 1's (and ends with four 0's).
%t q[n_] := SameQ @@ (d = IntegerDigits[n^2])[[1 ;; 4]] && d[[5]] != d[[1]] && SameQ @@ d[[-4 ;; -1]] && d[[-5]] != d[[-1]]; Select[Range[10000, 3333300], q] (* _Amiram Eldar_, Aug 08 2021 *)
%o (Python)
%o def ok(n):
%o s = str(n*n)
%o return len(s) > 4 and s[0] == s[1] == s[2] == s[3] != s[4] and s[-1] == s[-2] == s[-3] == s[-4] != s[-5]
%o print(list(filter(ok, range(3333333)))) # _Michael S. Branicky_, Aug 08 2021
%o (Python)
%o A346942_list = [100*n for n in range(99,10**6) if n % 10 and (lambda x:x[0]==x[1]==x[2]==x[3]!=x[4])(str(n**2))] # _Chai Wah Wu_, Oct 02 2021
%Y Numbers whose square '....' with exactly k identical digits:
%Y ---------------------------------------------------------------------------
%Y | k \'....'| starts | ends | starts and ends |
%Y ---------------------------------------------------------------------------
%Y | k = 2 | A346812 | A346678 | A346774 |
%Y | k = 3 | A346891 | A039685 | A346892 |
%Y | k = 4 | A346940 | 100*A067251 | this sequence |
%Y ---------------------------------------------------------------------------
%Y Cf. A346926.
%K nonn,base
%O 1,1
%A _Bernard Schott_, Aug 08 2021
|