OFFSET
1,1
COMMENTS
The sequence is infinite since it contains several infinite subsequences (see A055617, etc.).
If x = A*10^n+B is an element not beginning with 9, then (10^n-A)*10^n+B is another (e.g. 1233 <-> 8833).
Numbers that can be written as n = A*10^d + B with 10^(d-1) <= A < 10^d, 0 <= B < 10^d, and A^2 + B^2 = n. - Robert Israel, May 10 2015
LINKS
Robert Israel, Table of n, a(n) for n = 1..1000
EXAMPLE
8833 is ok, since 8833 = 88^2 + 33^2.
MAPLE
dmax:= 8: # to get all entries with at most 2*dmax digits
Res:= NULL:
for d from 2 to dmax do
cands:= map(t -> subs(t, [x, y]), [isolve(x^2 + y^2 = 10^(2*d)+1)]);
cands:= select(t -> t[1]::even and t[1]>=0 and t[2]>0, cands);
cands:= map(t -> ([(10^d + t[1])/2, (t[2]+1)/2], [(10^d-t[1])/2, (t[2]+1)/2]), cands);
cands:= select(t -> (t[1]>= 10^(d-1) and t[1] < 10^d and t[2] <= 10^d), cands);
Res:= Res, op(map(t -> 10^d*t[1]+t[2], cands));
od:
sort([Res]); # Robert Israel, May 10 2015
MATHEMATICA
fQ[n_] := Block[{d = IntegerDigits@ n}, If[OddQ[Length@ d], False, Plus[FromDigits[Take[d, Length[d]/2]]^2, FromDigits[Take[d, -Length[d]/2]]^2]] == n]; Select[Range@ 1000000, fQ] (* Michael De Vlieger, May 09 2015 *)
PROG
(Python)
def a():
..n = 1
..while n < 10**6:
....st = str(n)
....if len(st) % 2 == 0:
......s1 = st[:int(len(st)/2)]
......s2 = st[int(len(st)/2):int(len(st))]
......if int(s1)**2+int(s2)**2 == int(st):
........print(n, end=', ')
........n += 1
......else:
........n += 1
....else:
......n = 10*n
a()
# Derek Orr, Jul 08 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ulrich Schimke (ulrschimke(AT)aol.com)
EXTENSIONS
Definition corrected by Derek Orr, Jul 09 2014
STATUS
approved