OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Ivars Peterson, Light Rings
EXAMPLE
a(9)=1 because the 9th prime is 23 and the absolute difference between 2 & 3 is 1.
MAPLE
f:= proc(n) local Lo, Le;
Lo, Le:= selectremove(type, convert(n, base, 10), odd);
abs(convert(Lo, `+`)-convert(Le, `+`))
end proc:
map(f, [seq(ithprime(i), i=1..100)]); # Robert Israel, Nov 12 2024
MATHEMATICA
f[n_] := (id = IntegerDigits[ Prime[n]]; Abs[(Plus @@ id) - 2Plus @@ Select[id, OddQ]]); Table[f[n], {n, 91}]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Zak Seidov and Robert G. Wilson v, Mar 02 2005
EXTENSIONS
Edited by Charles R Greathouse IV, Aug 04 2010
STATUS
approved