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.

A333876 a(n) is the largest prime 2^(n-1) <= p < 2^n minimizing the Hamming weight of all primes in this interval.

This page as a plain text file.
%I A333876 #17 Apr 11 2020 15:32:07
%S A333876 2,5,13,17,41,97,193,257,769,1153,2113,4129,12289,18433,40961,65537,
%T A333876 163841,270337,786433,1179649,2101249,4194433,8650753,16777729,
%U A333876 50332673,69206017,167772161,270532609,537133057,1107296257,3221225473,6442713089,8858370049
%N A333876 a(n) is the largest prime 2^(n-1) <= p < 2^n minimizing the Hamming weight of all primes in this interval.
%H A333876 Chai Wah Wu, <a href="/A333876/b333876.txt">Table of n, a(n) for n = 2..1000</a>
%o A333876 (PARI) for(n=2, 10, my(hmin=n+n,pmax); forprime(p=2^(n-1), 2^n, my(h=hammingweight(p)); if(h<=hmin,pmax=p;hmin=h)); print1(pmax,", "))
%o A333876 (Python)
%o A333876 from sympy import isprime
%o A333876 from sympy.utilities.iterables import multiset_permutations
%o A333876 def A333876(n):
%o A333876     for i in range(n):
%o A333876         q = 2**n-1
%o A333876         for d in multiset_permutations('0'*i+'1'*(n-1-i)):
%o A333876             p = q-int(''.join(d),2)
%o A333876             if isprime(p):
%o A333876                 return p # _Chai Wah Wu_, Apr 08 2020
%Y A333876 Cf. A066195, A091936, A333877, A333878.
%K A333876 nonn
%O A333876 2,1
%A A333876 _Hugo Pfoertner_, Apr 08 2020