A175435 (Digit sum of 3^n) mod n.
0, 1, 0, 1, 4, 0, 4, 2, 0, 7, 5, 6, 1, 3, 6, 11, 10, 9, 17, 5, 6, 1, 8, 6, 13, 11, 0, 16, 14, 3, 19, 31, 6, 31, 11, 9, 16, 14, 3, 10, 17, 6, 22, 2, 9, 16, 32, 21, 10, 44, 15, 13, 29, 0, 35, 34, 51, 10, 58, 39, 13, 29, 27, 16, 5, 51, 28, 17, 15, 4, 38, 18, 7
Offset: 1
Examples
a(5) = 4 because digsum(3^5) mod 5 = digsum(243) mod 5 = 9 mod 5 = 4.
Links
- Nathaniel Johnston, Table of n, a(n) for n = 1..5000
Programs
-
Maple
read(transforms): A175435 := proc(n) return digsum(3^n) mod n: end proc: seq(A175435(n), n=1..50); # Nathaniel Johnston, Oct 09 2013
-
PARI
a(n) = sumdigits(3^n) % n; \\ Michel Marcus, Oct 09 2013