%I #34 Jan 18 2018 19:13:09
%S 1,4,9,16,25,36,49,64,81,225,625,1225,2025,2601,2704,2809,2916,3025,
%T 3136,3249,3364,3481,4225,5625,7225,9025,22801,23104,23409,50625,
%U 63001,63504,75625,123201,180625,203401,225625,390625,432964,455625,573049,680625,732736,765625,2175625,6260004,6270016
%N Squares k (not ending in 0) such that the integer that is built up by concatenating the floors of the square roots of the two-digit numbers into which the original number is separated (from right to left) is the square root of the original number.
%C If k has an odd number of digits, all digits after the first digit are paired; see first example below.
%H David A. Corneth, <a href="/A294497/b294497.txt">Table of n, a(n) for n = 1..114</a>
%e 75625 is a term because partitioning its digits as (7)(56)(25), taking the square root of each part and truncating, and then concatenating the results, gives floor(sqrt(7))|floor(sqrt(56))|floor(sqrt(25)) = 275 = sqrt(75625);
%e 180625 is a term because floor(sqrt(18))|floor(sqrt(06))|floor(sqrt(25)) = 425 = sqrt(180625).
%t #^2 & /@ Select[Range[10^4], And[Mod[#, 10] != 0, FromDigits@ Map[Floor@ Sqrt@ FromDigits@ # &, Partition[PadLeft[#, 2 Ceiling[Length@ #/2]], 2, 2]] &@ IntegerDigits[#^2] == #] &] (* _Michael De Vlieger_, Nov 23 2017 *)
%o (PARI) is(n) = if(issquare(n) == 0||n % 10 == 0, return(0)); my(sq = i = 0, cn = n); while(cn > 0, sq += 10^i * sqrtint(cn % 100); cn \= 100; i++); sq ^ 2 == n \\ _David A. Corneth_, Jan 18 2018
%o (Python)
%o import math
%o for k in range(1,1000000000):
%o p = 0
%o z = 0
%o n = k*k
%o while n >= 100:
%o z = z + int(math.floor(math.sqrt(n % 100)) * math.pow(10, p))
%o n = int((n - (n % 100)) / 100)
%o p = p + 1
%o z = z + int(math.floor(math.sqrt(n)) * math.pow(10, p))
%o if z == k and k % 10 > 0:
%o print(k * k, k)
%K nonn,base
%O 1,2
%A _Reiner Moewald_, Nov 01 2017
|