OFFSET
1,2
EXAMPLE
a(11) =1265 because 11*115 = 1265 and 1^2+2^2+6^2+5^2 = 66 = 11*6.
MAPLE
with(numtheory):for n from 1 to 80 do:id:=0:for k from 1 to 1000000 while(id=0)
do :l:=length(k):n0:=k:s1:=0:for m from 1 to l do:q:=n0:u:=irem(q, 10):v:=iquo(q,
10):n0:=v :s1:=s1+u^2 :od: :if irem(k, n) =0 and irem(s1, n)=0 then id:=1:printf(`%d,
`, k):else fi:od: od:
MATHEMATICA
smn[n_]:=Module[{k=1}, While[Mod[Total[IntegerDigits[k n]^2], n]!=0, k++]; n k]; Array[smn, 70] (* Harvey P. Dale, Feb 13 2023 *)
PROG
(PARI) a(n)=my(s); forstep(k=n, 9e9, n, s=eval(Vec(Str(k))); if(sum(i=1, #s, s[i]^2)%n==0, return(k))) \\ Charles R Greathouse IV, Jun 20 2011
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, Jun 18 2011
STATUS
approved