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.

A180024 Smallest prime greater than n-th prime having as many ones in binary representation.

Original entry on oeis.org

5, 17, 11, 13, 19, 257, 37, 29, 43, 47, 41, 67, 53, 59, 71, 61, 79, 73, 83, 97, 103, 89, 101, 131, 113, 107, 109, 151, 139, 191, 137, 193, 149, 163, 157, 167, 197, 173, 179, 181, 199, 223, 521, 263, 211, 227, 239, 229, 233, 241, 251, 271, 367, 65537, 269, 277, 283
Offset: 2

Views

Author

Reinhard Zumkeller, Aug 07 2010

Keywords

Comments

a(n)>A000040(n) and A010051(a(n))=1 and A000120(a(n))=A000120(A000040(n));
A019434(n+1) = a(A019434(n));
If A000040(6543)=A019434(5)=65537 is the last Fermat prime, the sequence is finite with last term a(6542)=73471.

Examples

			n=10: prime(10) = 29->11101 with 4 ones,
a(10) = prime(14) = 43->101011;
n=100: prime(100) = 541->1000011101 with 5 ones,
a(100) = prime(102) = 557->1000101101;
n=1000: prime(1000) = 7919->1111011101111 with 11 ones,
a(1000) = prime(1001) = 7927->1111011110111;
n=6542: prime(6542) = 65521->1111111111110001 with 13 ones,
a(6542) = prime(7255) = 73471->10001111011111111;
n=6543: prime(6543) = 65537->10000000000000001 with 2 ones,
a(6543) = unknown.
		

Crossrefs

Programs

  • Mathematica
    sp1b[n_]:=Module[{o=DigitCount[n,2,1],p=NextPrime[n]},While[ DigitCount[ p,2,1]!=o,p = NextPrime[ p]];p]; sp1b/@Prime[Range[2,60]] (* Harvey P. Dale, May 02 2019 *)
  • PARI
    a(n) = my(p=prime(n), x=hammingweight(p), q=nextprime(p+1)); while (hammingweight(q) != x, q=nextprime(q+1)); q; \\ Michel Marcus, Nov 12 2023