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.

Showing 1-3 of 3 results.

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

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Joseph L. Pe, Dec 23 2002

Keywords

Examples

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

Crossrefs

Programs

  • Mathematica
    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}]
  • PARI
    A078349(n) = if(1==n,0,isprime(n)+A078349(n\2)); \\ Antti Karttunen, Oct 01 2017

Formula

From Antti Karttunen, Oct 01 2017: (Start)
a(1) = 0; for n > 1, a(n) = A010051(n) + a(floor(n/2)).
a(n) = A000120(A292599(n)).
a(n) = A007814(A292258(n)).
a(n) >= A292598(n).
a(n) >= A292936(n).
(End)

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

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 3, 0, 0, 2, 3, 4, 5, 6, 6, 0, 1, 0, 1, 4, 4, 6, 7, 8, 8, 10, 10, 12, 13, 12, 13, 0, 0, 2, 2, 0, 1, 2, 2, 8, 9, 8, 9, 12, 12, 14, 15, 16, 16, 16, 16, 20, 21, 20, 20, 24, 24, 26, 27, 24, 25, 26, 26, 0, 0, 0, 1, 4, 4, 4, 5, 0, 1, 2, 2, 4, 4, 4, 5, 16, 16, 18, 19, 16, 16, 18, 18, 24, 25, 24, 24, 28, 28, 30, 30, 32, 33, 32, 32, 32, 33
Offset: 1

Views

Author

Antti Karttunen, Sep 27 2017

Keywords

Comments

1-bits in base-2 expansion of a(n) indicate the positions of odd primes in the sequence [n, floor(n/2), floor(n/4), ..., 1].

Crossrefs

Cf. also A292599 (variant for all primes).

Formula

a(1) = a(2) = 0; for n > 2, a(n) = A010051(n) + 2*a(floor(n/2)).
Other identities. For all n >= 1:
a(n) + A292597(n) = n.
A000120(a(n)) = A292598(n).
A007814(1+a(n)) <= A007814(1+n).

A292597 a(1) = 1; for n > 1, a(n) = c(n) + 2*a(floor(n/2)), where c(n) is the characteristic function of odd composites, A071904.

Original entry on oeis.org

1, 2, 2, 4, 4, 4, 4, 8, 9, 8, 8, 8, 8, 8, 9, 16, 16, 18, 18, 16, 17, 16, 16, 16, 17, 16, 17, 16, 16, 18, 18, 32, 33, 32, 33, 36, 36, 36, 37, 32, 32, 34, 34, 32, 33, 32, 32, 32, 33, 34, 35, 32, 32, 34, 35, 32, 33, 32, 32, 36, 36, 36, 37, 64, 65, 66, 66, 64, 65, 66, 66, 72, 72, 72, 73, 72, 73, 74, 74, 64, 65, 64, 64, 68, 69, 68, 69, 64, 64, 66, 67
Offset: 1

Views

Author

Antti Karttunen, Sep 27 2017

Keywords

Comments

1-bits in base-2 expansion of a(n) indicate the positions of odd nonprimes in the sequence [n, floor(n/2), floor(n/4), ..., 1].

Crossrefs

Formula

a(1) = 1; for n > 1, a(n) = (A000035(n)*(1-A010051(n))) + 2*a(floor(n/2)).
For all n >= 1, a(n) + A292596(n) = n.
Showing 1-3 of 3 results.