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.

A278477 Primes that set a new record for the Hamming weight.

Original entry on oeis.org

2, 3, 7, 23, 31, 127, 383, 991, 2039, 3583, 6143, 8191, 63487, 129023, 131071, 522239, 524287, 1966079, 4128767, 14680063, 33546239, 67108351, 201064447, 260046847, 536739839, 1073479679, 2147483647, 8581545983, 16911433727
Offset: 1

Views

Author

Joerg Arndt, Nov 23 2016

Keywords

Comments

The Mersenne primes (A000668) are a subsequence.

Crossrefs

Programs

  • Maple
    M:= 40: # to use A061712(1..M)
    A061712:= proc(n) local d,c,cands;
      for d from 0 do
        cands:= map(t -> 2^(n+d)-1 - add(2^(n-1+d-j), j=t),
            combinat:-choose([$1..n-2+d], d));
        for c in cands do if  isprime(c) then return c fi od
      od
    end proc:
    A061712(1):= 2:
    R:= map(A061712, [$1..M]):
    R[select(t -> R[t] < `if`(isprime(2^(M+1)-1), 2^(M+1)-1, 2^(M+2)+2^M-1) and R[t] = min(R[t..-1]), [$1..nops(R)])]; # Robert Israel, Nov 23 2016
  • PARI
    {my(h=0);forprime(p=2,10^11,my(t=hammingweight(p));if(t>h,print1(p,", ");h=t));}