login
A191872
a(n) is the smallest multiple of n such that the sum of the square of the decimal digits of a(n) is divisible by n.
0
1, 2, 3, 4, 5, 6, 7, 8, 9, 130, 1265, 60, 143, 154, 360, 48, 1071, 396, 133, 240, 693, 1386, 1817, 888, 50, 286, 999, 2408, 2552, 390, 372, 448, 1419, 2992, 315, 2268, 1295, 266, 3666, 480, 1148, 1344, 129, 11176, 360, 3818, 329, 8880, 2254, 550, 1071, 2444, 2597, 2268, 12485, 2688, 399, 2552, 12449, 111960, 549, 372, 693, 8000
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
Sequence in context: A173689 A004871 A059405 * A280355 A001104 A151544
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, Jun 18 2011
STATUS
approved