OFFSET
2,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 2..1000
MATHEMATICA
mdp[n_]:=Module[{idn=IntegerDigits[n], len=IntegerLength[n]}, If[EvenQ[len], -1, idn[[(len-1)/2+1]]]]; Select[mdp/@Prime[Range[500]], NonNegative] (* Harvey P. Dale, Feb 26 2012 *)
PROG
(PARI) midd(n) = { forprime(x=2, n, s = Str(x); ln = length(s); if(ln<2, p=1, p = (ln-1)/2+1); if(ln%2, md = eval(mid(s, p, 1)); print1(md", ") ) ) } \ Get a substring of length n from string str starting at position s in str. mid(str, s, n) = { v =""; tmp = Vec(str); ln=length(tmp); for(x=s, s+n-1, v=concat(v, tmp[x]); ); return(v) }
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Cino Hilliard, Apr 25 2004
STATUS
approved