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.

A098388 a(n) = floor(log_2(prime(n))).

This page as a plain text file.
%I A098388 #42 Feb 12 2025 12:47:00
%S A098388 1,1,2,2,3,3,4,4,4,4,4,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,
%T A098388 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
%U A098388 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9
%N A098388 a(n) = floor(log_2(prime(n))).
%C A098388 a(n) is the greatest k such that 2^k does not exceed prime(n). - _David James Sycamore_, Sep 14 2021
%C A098388 a(n) is the number of representations of prime(n) as a sum 2^m+r, where 1 <= r < prime(n): a(5) = 3 because prime(5) = 11 = 2^3 + 3 = 2^2 + 7 = 2^1 + 9. - _Clark Kimberling_, Feb 06 2025
%H A098388 T. D. Noe, <a href="/A098388/b098388.txt">Table of n, a(n) for n = 1..10000</a>
%F A098388 a(n) = A000523(A000040(n)); A098391(n) = A000523(a(n)).
%F A098388 a(n) = A035100(n) - 1. - _Michel Marcus_, Sep 17 2017
%p A098388 map(ilog2, select(isprime,[2,seq(2*i+1,i=1..1000)])); # _Robert Israel_, Jun 08 2015
%t A098388 Floor[Log[2, Prime[Range[105]]]] (* data *) (* parameter changed by _Hartmut F. W. Hoft_, Jun 02 2015 *)
%o A098388 (PARI) a(n) = logint(prime(n), 2); \\ _Michel Marcus_, Sep 17 2017
%o A098388 (Python)
%o A098388 from sympy import prime
%o A098388 def A098388(n): return prime(n).bit_length()-1 # _Chai Wah Wu_, Nov 19 2024
%Y A098388 Cf. A000040, A000523, A023196, A035100, A098391.
%K A098388 nonn,easy
%O A098388 1,3
%A A098388 _Reinhard Zumkeller_, Sep 06 2004