%I #18 Jan 09 2025 02:13:39
%S 1,2,3,8,12,15,18,21,24,27,30,41,58,59,68,85,95,113,122,145,152,157,
%T 158,166,176,179,184,190,193,194,212,221,238,251,256,257,266,274,275,
%U 283,284,292,311,313,330,339,345,354,360,369,375,381,387,399,402,405,417
%N Positive numbers n with property that average digit of n^2 is an integer.
%C A004159(n)/nod(n^2) = sod(n^2)/nod(n^2) is an integer, where sod(n^2)= sum of digits of n^2, nod(n^2) = number of digits of n^2. Correspondent values of sod(n^2)/nod(n^2) in A164818.
%H Robert Israel, <a href="/A164817/b164817.txt">Table of n, a(n) for n = 1..10000</a>
%p filter:= proc(n) local L;
%p L:= convert(n^2,base,10);
%p type(convert(L,`+`)/nops(L), integer)
%p end proc:
%p select(filter, [$1..1000]); # _Robert Israel_, Feb 24 2016
%t Select[Range[500],IntegerQ[Mean[IntegerDigits[#^2]]]&] (* _Harvey P. Dale_, May 25 2011 *)
%o (PARI) isok(n) = my(d=digits(n^2)); (vecsum(d) % #d) == 0; \\ _Michel Marcus_, Feb 24 2016
%Y Cf. A004159, A164818.
%K base,nonn
%O 1,2
%A _Zak Seidov_, Aug 27 2009