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!)
A156607 a(n) = number of odd decimal digits of n-th prime + number of prime decimal digits of n-th prime. 1

%I #14 Feb 14 2019 05:58:13

%S 1,2,2,2,2,3,3,2,3,2,3,4,1,2,2,4,3,1,2,3,4,3,2,1,3,2,3,3,2,4,4,4,5,4,

%T 2,4,5,3,3,5,4,2,3,4,4,3,3,4,4,3,5,4,2,4,5,3,2,4,5,2,3,4,4,4,5,5,5,6,

%U 4,3,6,5,4,6,5,4,3,5,1,1,2,2,3,4,3,2,1,4,1,2,2,3,2,2,2,4,3,4,5,3,4,6,4,3,5

%N a(n) = number of odd decimal digits of n-th prime + number of prime decimal digits of n-th prime.

%C Odd digits are 1, 3, 5, 7 and 9. Prime digits are 2, 3, 5 and 7.

%e prime(1)= 2 (0 odd digits, 1 prime), so a(1) = 0 + 1 = 1;

%e prime(2)= 3 (1 odd digit, 1 prime), so a(2) = 1 + 1 = 2;

%e prime(3)= 5 (1 odd digit, 1 prime), so a(3) = 1 + 1 = 2;

%e prime(4)= 7 (1 odd digit, 1 prime), so a(4) = 1 + 1 = 2;

%e prime(5)=11 (2 odd digits, 0 prime), so a(5) = 2 + 0 = 2;

%e prime(6)=13 (2 odd digits, 1 prime), so a(6) = 2 + 1 = 3.

%p numPdgs := proc(n) local f,d ; f := 0 ; for d in convert(n,base,10) do if d in {2,3,5,7} then f :=f+1; end if; end do; f ; end proc:

%p numOdddgs := proc(n) local f,d ; f := 0 ; for d in convert(n,base,10) do if type(d,'odd') then f :=f+1; end if; end do; f ; end proc:

%p A156607 := proc(n) p := ithprime(n) ; numPdgs(p) + numOdddgs(p) ; end proc:

%p seq(A156607(n),n=1..120) ; # _R. J. Mathar_, May 15 2010

%t d[n_]:=Module[{idn=IntegerDigits[n]},Count[idn,_?OddQ]+Count[ idn, _?PrimeQ]]; d/@Prime[Range[150]] (* _Harvey P. Dale_, May 16 2014 *)

%Y Cf. A000040, A104638.

%K nonn,base

%O 1,2

%A _Juri-Stepan Gerasimov_, Feb 11 2009

%E a(54) corrected by _R. J. Mathar_, May 15 2010

%E Example section edited by _Jon E. Schoenfield_, Feb 14 2019

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 April 25 05:56 EDT 2024. Contains 371964 sequences. (Running on oeis4.)