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.

A244508 Number of odd prime powers (A246655) between 2^n and 2^(n+1).

Original entry on oeis.org

0, 1, 2, 3, 7, 8, 16, 25, 46, 80, 141, 263, 473, 882, 1628, 3044, 5734, 10779, 20428, 38687, 73653, 140425, 268340, 513866, 986033, 1894409, 3646134, 7027825, 13562625, 26208248, 50698865, 98184467, 190338061, 369326690, 717271793, 1394198586, 2712112561
Offset: 0

Views

Author

Michel Marcus, Nov 17 2014

Keywords

Examples

			Between 2 and 4, there is just 1 prime power: 3, so a(1) = 1.
Between 4 and 8, there are 2 prime powers: 5 and 7, so a(2) = 2.
		

Crossrefs

Cf. A246655 (prime powers), A182908 (positions of 2^n among prime powers).

Programs

  • Mathematica
    Table[Count[Range[2^n + 1, 2^(n + 1) - 1], ?PrimePowerQ], {n, 0, 27}] (* _Ivan N. Ianakiev, Nov 18 2014 *)
  • PARI
    a(n) = sum(i=2^n+1, 2^(n+1)-1, isprimepower(i)>0);
    
  • Python
    from sympy import primepi, integer_nthroot
    def A244508(n):
        def f(x): return int(1+sum(primepi(integer_nthroot(x, k)[0]) for k in range(1, x.bit_length())))
        return f((1<Chai Wah Wu, Nov 05 2024

Formula

a(n) = A182908(n+1) - A182908(n). - Ray Chandler, Aug 20 2021

Extensions

a(28)-a(36) from Hiroaki Yamanouchi, Nov 20 2014
Minor edits by Ray Chandler, Aug 20 2021