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).

This page as a plain text file.
%I A244508 #60 Nov 05 2024 19:16:05
%S A244508 0,1,2,3,7,8,16,25,46,80,141,263,473,882,1628,3044,5734,10779,20428,
%T A244508 38687,73653,140425,268340,513866,986033,1894409,3646134,7027825,
%U A244508 13562625,26208248,50698865,98184467,190338061,369326690,717271793,1394198586,2712112561
%N A244508 Number of odd prime powers (A246655) between 2^n and 2^(n+1).
%H A244508 Ray Chandler, <a href="/A244508/b244508.txt">Table of n, a(n) for n = 0..91</a> (using b-file from A007053, corrected n = 45..52, n = 0..52 from Hiroaki Yamanouchi)
%F A244508 a(n) = A182908(n+1) - A182908(n). - _Ray Chandler_, Aug 20 2021
%e A244508 Between 2 and 4, there is just 1 prime power: 3, so a(1) = 1.
%e A244508 Between 4 and 8, there are 2 prime powers: 5 and 7, so a(2) = 2.
%t A244508 Table[Count[Range[2^n + 1, 2^(n + 1) - 1], _?PrimePowerQ], {n, 0, 27}] (* _Ivan N. Ianakiev_, Nov 18 2014 *)
%o A244508 (PARI) a(n) = sum(i=2^n+1, 2^(n+1)-1, isprimepower(i)>0);
%o A244508 (Python)
%o A244508 from sympy import primepi, integer_nthroot
%o A244508 def A244508(n):
%o A244508     def f(x): return int(1+sum(primepi(integer_nthroot(x, k)[0]) for k in range(1, x.bit_length())))
%o A244508     return f((1<<n+1)-1)-f((1<<n)) # _Chai Wah Wu_, Nov 05 2024
%Y A244508 Cf. A246655 (prime powers), A182908 (positions of 2^n among prime powers).
%K A244508 nonn
%O A244508 0,3
%A A244508 _Michel Marcus_, Nov 17 2014
%E A244508 a(28)-a(36) from _Hiroaki Yamanouchi_, Nov 20 2014
%E A244508 Minor edits by _Ray Chandler_, Aug 20 2021