[go: up one dir, main page]

login
A261713
Natural numbers that can be split into two squares, leading zeros allowed.
1
10, 11, 14, 19, 40, 41, 44, 49, 90, 91, 94, 99, 100, 101, 104, 109, 116, 125, 136, 149, 160, 161, 164, 169, 181, 250, 251, 254, 259, 360, 361, 364, 369, 400, 401, 404, 409, 416, 425, 436, 449, 464, 481, 490, 491, 494, 499, 640, 641, 644, 649, 810, 811, 814
OFFSET
1,1
LINKS
MAPLE
a:= proc(n) option remember; local d, i, k;
for k from 1+`if`(n=1, 1, a(n-1))
do for i to length(k)-1 do
if issqr(iquo(k, 10^i, 'd')) and
issqr(d) then return k fi
od
od
end:
seq(a(n), n=1..60); # Alois P. Heinz, Aug 29 2015
MATHEMATICA
qQ[n_] := Floor[ Sqrt@ n]^2 == n; ok[n_] := Catch[ Do[ If[ qQ@ Floor[n / 10^k] && qQ@ Mod[n, 10^k], Throw@ True], {k, IntegerLength[n] -1}]; False]; Select[Range@ 1000, ok] (* Giovanni Resta, Aug 29 2015 *)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Giovanni Teofilatto, Aug 29 2015
EXTENSIONS
Name clarified by Zak Seidov, Aug 29 2015
STATUS
approved