login

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

Penultimate digits of the primes.
0

%I #8 Sep 08 2022 08:45:13

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

%T 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,

%U 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

%N Penultimate digits of the primes.

%t IntegerDigits[#][[-2]]&/@Prime[Range[5,110]] (* _Harvey P. Dale_, Apr 08 2019 *)

%o (PARI) penult(n) = { forprime(x=11,n, s = Str(x); ln = length(s); pu = mid(s,ln-1,1); print1(pu",") ) } \ 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) }

%o (Magma) [Intseq(p)[2]: p in PrimesInInterval(11,600)]; // _Bruno Berselli_, Feb 14 2013

%Y Cf. A093336, A077648, A007652.

%K nonn,base

%O 11,5

%A _Cino Hilliard_, Apr 25 2004