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.

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

This page as a plain text file.
%I A156607 #14 Feb 14 2019 05:58:13
%S A156607 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 A156607 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 A156607 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 A156607 a(n) = number of odd decimal digits of n-th prime + number of prime decimal digits of n-th prime.
%C A156607 Odd digits are 1, 3, 5, 7 and 9. Prime digits are 2, 3, 5 and 7.
%e A156607 prime(1)= 2 (0 odd digits, 1 prime), so a(1) = 0 + 1 = 1;
%e A156607 prime(2)= 3 (1 odd digit,  1 prime), so a(2) = 1 + 1 = 2;
%e A156607 prime(3)= 5 (1 odd digit,  1 prime), so a(3) = 1 + 1 = 2;
%e A156607 prime(4)= 7 (1 odd digit,  1 prime), so a(4) = 1 + 1 = 2;
%e A156607 prime(5)=11 (2 odd digits, 0 prime), so a(5) = 2 + 0 = 2;
%e A156607 prime(6)=13 (2 odd digits, 1 prime), so a(6) = 2 + 1 = 3.
%p A156607 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 A156607 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 A156607 := proc(n) p := ithprime(n) ; numPdgs(p) + numOdddgs(p) ; end proc:
%p A156607 seq(A156607(n),n=1..120) ; # _R. J. Mathar_, May 15 2010
%t A156607 d[n_]:=Module[{idn=IntegerDigits[n]},Count[idn,_?OddQ]+Count[ idn, _?PrimeQ]]; d/@Prime[Range[150]] (* _Harvey P. Dale_, May 16 2014 *)
%Y A156607 Cf. A000040, A104638.
%K A156607 nonn,base
%O A156607 1,2
%A A156607 _Juri-Stepan Gerasimov_, Feb 11 2009
%E A156607 a(54) corrected by _R. J. Mathar_, May 15 2010
%E A156607 Example section edited by _Jon E. Schoenfield_, Feb 14 2019