login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A093339 Middle digits of primes with an odd number of digits. 3

%I #6 Nov 21 2013 12:48:18

%S 2,3,5,7,0,0,0,0,1,2,3,3,3,4,5,5,6,6,7,7,8,9,9,9,9,1,2,2,2,3,3,4,5,5,

%T 6,6,7,7,8,8,9,0,1,1,1,3,3,4,4,5,5,6,7,7,8,8,9,0,0,1,2,3,3,3,4,4,5,6,

%U 6,6,7,8,9,9,0,0,2,2,4,4,5,6,6,7,7,8,9,9,0,0,1,1,1,3,4,4,4,5,5,6,7,7,8,9,0

%N Middle digits of primes with an odd number of digits.

%H Harvey P. Dale, <a href="/A093339/b093339.txt">Table of n, a(n) for n = 2..1000</a>

%t 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 *)

%o (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) }

%Y Cf. A077648, A007652.

%K base,nonn

%O 2,1

%A _Cino Hilliard_, Apr 25 2004

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 18:04 EDT 2024. Contains 371254 sequences. (Running on oeis4.)