OFFSET
1,2
COMMENTS
Numbers k such that, if the sum of digits of k is s, the quotient and remainder on division of k by s sum to s^2.
EXAMPLE
a(3) = 313 is a term because the sum of digits of 313 is 7, 313 = 44*7+5, and 44+5 = 49 = 7^2.
MAPLE
filter:= proc(n) local s, q, r;
s:= convert(convert(n, base, 10), `+`);
r:= n mod s;
q:= (n-r)/s;
q+r = s^2
end proc:
select(filter, [$1..10^6]);
PROG
(Python)
from itertools import count, islice
def A358034_gen(startvalue=1): # generator of terms >= startvalue
return filter(lambda n:(s:=sum(int(d) for d in str(n)))**2 == sum(divmod(n, s)), count(max(startvalue, 1)))
CROSSREFS
KEYWORD
nonn,base,fini,full
AUTHOR
J. M. Bergot and Robert Israel, Oct 25 2022
STATUS
approved