Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #22 Feb 19 2024 12:10:16
%S 0,1,4,9,10,31,40,52,73,81,90,94,100,102,142,144,148,163,211,247,301,
%T 310,345,352,400,421,422,466,520,523,526,562,573,631,643,679,711,712,
%U 730,772,785,801,802,810,813,816,832,834,838,841,865,874,877,900,903,906,937,940,982,983,986,1000,1020,1022,1042,1082,1111,1172,1420
%N Numbers k such that d(1)^1 + d(2)^2 +... + d(p)^p is a square, where d(i), i=1..p, are the decimal digits of k.
%H Robert Israel, <a href="/A178224/b178224.txt">Table of n, a(n) for n = 1..10000</a>
%e 8762 is in the sequence because 8 + 7^2 + 6^3 + 2^4 = 289 = 17^2.
%p with(numtheory):for n from 0 to 1500 do:l:=length(n):n0:=n:s:=0:for m from
%p 1 to l do:q:=n0:u:=irem(q,10):v:=iquo(q,10):n0:=v :s:=s+u^(l-m+1):od:if type(sqrt(s),integer)=true then printf(`%d, `,n):else fi:od:
%t sqQ[n_]:=Module[{idn=IntegerDigits[n]},IntegerQ[Sqrt[Total[idn^Range[ Length[ idn]]]]]]; Select[Range[0,1500],sqQ] (* _Harvey P. Dale_, Jun 22 2011 *)
%o (Sage) is_A178224 = lambda x: is_square(sum(d**i for i, d in enumerate(reversed(x.digits()), 1))) # _D. S. McNeil_, Dec 20 2010
%K nonn,base
%O 1,3
%A _Michel Lagneau_, Dec 20 2010
%E Offset corrected by _Robert Israel_, Feb 19 2024