[Seqfan] A061712 extension requested

Thomas Baruchel thomas.baruchel at laposte.net
Wed Aug 3 11:13:11 CEST 2005


On Wed, Aug 03, 2005 at 04:45:49AM -0400, David Wilson wrote:
> Could some kind soul please compute A061712 for me out to a(60)?

OK, I do it. I post the result in a couple of hours.
Here is my C code:

#include <stdio.h>
#include <gmp.h>

int main(int argc, char **argv) {
  mpz_t nbr;
  unsigned int ham = 1;

  mpz_init(nbr);
  while(ham) {
    mpz_set_ui(nbr,2);
    while(mpz_popcount(nbr)!=ham) { mpz_nextprime(nbr,nbr); }
    mpz_out_str(stdout,10,nbr); fprintf(stdout," "); fflush(stdout);
    ham++;
  }
}


Regards,

-- 
Thomas Baruchel





More information about the SeqFan mailing list