%I #17 Mar 05 2024 15:08:16
%S 0,0,0,0,1,1,1,9,3,7,3,7,1,1,3,5,3,5,2,7,3,15,6,4,1,1,3,3,9,3,7,1,5,9,
%T 9,4,1,3,13,8,9,1,4,11,10,9,3,6,7,8,1,1,3,3,5,10,14,1,5,6,10,13,7,1,5,
%U 9,2,12,11,13,1,2,15,9,18,5,9,17,1,6,13,1,7,3,7,3,7,9,10,8,8,19,12,1,15,7,5
%N a(n) = n-th prime reduced modulo the sum of its digits.
%C First occurrence of k: A138792. - _Robert G. Wilson v_, Mar 27 2008
%H Robert Israel, <a href="/A136251/b136251.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = A070635(A000040(n)). - _Michel Marcus_, Mar 07 2023
%e 2 = 2*1 + 0
%e 3 = 3*1 + 0
%e 5 = 5*1 + 0
%e 7 = 7*1 + 0
%e 11 = 2*5 + 1 (the sum of the digits of 11 is equal to 2)
%e 13 = 4*3 + 1
%e 17 = 8*2 + 1
%e 19 = 10*1 + 9
%p P := select(isprime, [2,seq(i,i=3..10^3,2)]):
%p map(p -> p mod convert(convert(p,base,10),`+`), P); # _Robert Israel_, Mar 05 2024
%t f[n_] := Block[{p = Prime@n}, Mod[p, Plus @@ IntegerDigits@p]]; Array[f, 97] (* _Robert G. Wilson v_, Mar 27 2008 *)
%o (PARI) a(n) = my(p=prime(n)); p % sumdigits(p); \\ _Michel Marcus_, Mar 07 2023
%Y Cf. A000040, A070635, A138791, A138792, A347702.
%K easy,nonn,base
%O 1,8
%A _Odimar Fabeny_, Mar 17 2008
%E More terms from _Robert G. Wilson v_, Mar 27 2008