cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A093339 Middle digits of primes with an odd number of digits.

Original entry on oeis.org

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, 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, 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
Offset: 2

Views

Author

Cino Hilliard, Apr 25 2004

Keywords

Crossrefs

Programs

  • 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 *)
  • 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) }