# Using a Do-loop to find divisors mod 13 [closed]

I want to check sum of divisors of i mod 13 fori = 1 to i = 20. I tried writing a Do-Print loop so it looks like

Do[Print[DivisorSigma[1, i], {i, 20} mod 13]


Any help will be greatly appreciated,

Table[DivisorSigma[1, i], {i, 20} ] // Mod[#, 13] &
(*{1, 3, 4, 7, 6, 12, 8, 2, 0, 5, 12, 2, 1, 11, 11, 5, 5, 0, 7, 3}*)


or

Do[Print[Mod[DivisorSigma[1, i], 13]], {i, 20}]


which gives a column of the same numbers as before that you can look at, but it is more difficult use in further expressions.

• thank you so much – argamon Feb 19 '19 at 22:28
• You're welcome. – Bill Watts Feb 19 '19 at 22:29

You can do it without iterators because the functions you need (Mod, DivisorSigma) are Listable:

Mod[DivisorSigma[1, Range[20]], 13]


{1, 3, 4, 7, 6, 12, 8, 2, 0, 5, 12, 2, 1, 11, 11, 5, 5, 0, 7, 3}

Note: Listable functions are applied separately to each element in a list.

• that's also very useful and helpful thank you – argamon Feb 19 '19 at 22:56