login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Absolute difference between the sum of the odd digits and the sum of the even digits of the n-th prime.
3

%I #14 Nov 13 2024 16:59:28

%S 2,3,5,7,2,4,8,10,1,7,4,10,3,1,3,8,14,5,1,8,10,16,5,1,16,2,4,8,10,5,6,

%T 5,11,13,6,7,13,2,2,11,17,6,11,13,17,19,0,1,3,5,4,10,5,4,10,5,1,6,12,

%U 9,7,10,10,5,7,11,7,13,6,8,11,17,4,13,19,2,4,19,3,5,6,5,0,2,8,5,1,8,9,7,3

%N Absolute difference between the sum of the odd digits and the sum of the even digits of the n-th prime.

%H Robert Israel, <a href="/A111309/b111309.txt">Table of n, a(n) for n = 1..10000</a>

%H Ivars Peterson, <a href="http://mathtourist.blogspot.com/2010/06/light-rings.html">Light Rings</a>

%e a(9)=1 because the 9th prime is 23 and the absolute difference between 2 & 3 is 1.

%p f:= proc(n) local Lo,Le;

%p Lo,Le:= selectremove(type,convert(n,base,10),odd);

%p abs(convert(Lo,`+`)-convert(Le,`+`))

%p end proc:

%p map(f, [seq(ithprime(i),i=1..100)]); # _Robert Israel_, Nov 12 2024

%t f[n_] := (id = IntegerDigits[ Prime[n]]; Abs[(Plus @@ id) - 2Plus @@ Select[id, OddQ]]); Table[f[n], {n, 91}]

%Y Cf. A071650, A076167.

%K nonn,base

%O 1,1

%A _Zak Seidov_ and _Robert G. Wilson v_, Mar 02 2005

%E Edited by _Charles R Greathouse IV_, Aug 04 2010