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!)
A104638 Number of odd digits in n-th prime. 4

%I #23 Jan 14 2016 22:57:11

%S 0,1,1,1,2,2,2,2,1,1,2,2,1,1,1,2,2,1,1,2,2,2,1,1,2,2,2,2,2,3,2,3,3,3,

%T 2,3,3,2,2,3,3,2,3,3,3,3,2,1,1,1,2,2,1,2,2,1,1,2,2,1,1,2,2,3,3,3,3,3,

%U 2,2,3,3,2,3,3,2,2,3,1,1,2,1,2,2,2,1,1,2,1,1,1,2,1,2,2,2,2,2,2,2

%N Number of odd digits in n-th prime.

%C The only zero is the first term. Sequence is unbounded. - _Zak Seidov_, Jan 12 2016

%C From _Robert Israel_, Jan 12 2016: (Start)

%C For any N, the asymptotic density of terms >= N is 1.

%C On the other hand, a(n) = 2 if prime(n) is in A159352, which is conjectured to be infinite.

%C Record values: a(2) = 1, a(5) = 2, a(30) = 3, a(187) = 4, a(1346) = 5, a(10545) = 6, a(86538) = 7, a(733410) = 8.

%C (End)

%H Robert Israel, <a href="/A104638/b104638.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A196564(A000040(n)). - _Michel Marcus_, Oct 05 2013

%p seq(nops(select(type, convert(ithprime(i),base,10),odd)),i=1..100); # _Robert Israel_, Jan 12 2016

%t Table[Count[IntegerDigits[Prime[n]],_?OddQ],{n,100}] (* _Harvey P. Dale_, Jan 22 2012 *)

%t Table[Total[Mod[IntegerDigits[Prime[n]], 2]], {n, 100}] (* _Vincenzo Librandi_, Jan 13 2016 *)

%o (PARI) a(n)=vecsum(digits(prime(n)%2)) \\ _Zak Seidov_, Jan 12 2016

%Y Cf. A104637, A159352.

%K easy,nonn,base

%O 1,5

%A _Zak Seidov_, Mar 18 2005

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 06:14 EDT 2024. Contains 371964 sequences. (Running on oeis4.)