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!)
A078349 Number of primes in sequence h(m) defined by h(1) = n, h(m+1) = Floor(h(m)/2). 6

%I #10 Mar 26 2020 11:13:21

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

%T 2,1,2,2,2,2,3,2,3,3,3,4,5,1,1,1,1,2,3,2,2,2,2,3,4,2,3,3,3,1,1,1,2,2,

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

%N Number of primes in sequence h(m) defined by h(1) = n, h(m+1) = Floor(h(m)/2).

%H Antti Karttunen, <a href="/A078349/b078349.txt">Table of n, a(n) for n = 1..16384</a>

%F From _Antti Karttunen_, Oct 01 2017: (Start)

%F a(1) = 0; for n > 1, a(n) = A010051(n) + a(floor(n/2)).

%F a(n) = A000120(A292599(n)).

%F a(n) = A007814(A292258(n)).

%F a(n) >= A292598(n).

%F a(n) >= A292936(n).

%F (End)

%e The sequence h(m) for n = 5 is 5, 2, 1, 0, 0, 0, ...., in which two terms are primes. Therefore a(5) = 2.

%t f[n_] := Module[{i, p}, i = n; p = 0; While[i > 1, If[PrimeQ[i], p = p + 1]; i = Floor[i/2]]; p]; Table[f[i], {i, 1, 100}]

%o (MIT/GNU Scheme, with memoization-macro definec)

%o (definec (A078349 n) (if (<= n 1) 0 (+ (A010051 n) (A078349 (floor->exact (/ n 2)))))) ;; _Antti Karttunen_, Oct 01 2017

%o (PARI) A078349(n) = if(1==n,0,isprime(n)+A078349(n\2)); \\ _Antti Karttunen_, Oct 01 2017

%Y Cf. A010051, A292258, A292259, A292598, A292599, A292936.

%K nonn

%O 1,5

%A _Joseph L. Pe_, Dec 23 2002

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 19 21:09 EDT 2024. Contains 371798 sequences. (Running on oeis4.)