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.

This page as a plain text file.
%I A180024 #11 Nov 12 2023 05:32:45
%S A180024 5,17,11,13,19,257,37,29,43,47,41,67,53,59,71,61,79,73,83,97,103,89,
%T A180024 101,131,113,107,109,151,139,191,137,193,149,163,157,167,197,173,179,
%U A180024 181,199,223,521,263,211,227,239,229,233,241,251,271,367,65537,269,277,283
%N A180024 Smallest prime greater than n-th prime having as many ones in binary representation.
%C A180024 a(n)>A000040(n) and A010051(a(n))=1 and A000120(a(n))=A000120(A000040(n));
%C A180024 A019434(n+1) = a(A019434(n));
%C A180024 If A000040(6543)=A019434(5)=65537 is the last Fermat prime, the sequence is finite with last term a(6542)=73471.
%H A180024 Reinhard Zumkeller, <a href="/A180024/b180024.txt">Table of n, a(n) for n = 2..6542</a>
%e A180024 n=10: prime(10) = 29->11101 with 4 ones,
%e A180024 a(10) = prime(14) = 43->101011;
%e A180024 n=100: prime(100) = 541->1000011101 with 5 ones,
%e A180024 a(100) = prime(102) = 557->1000101101;
%e A180024 n=1000: prime(1000) = 7919->1111011101111 with 11 ones,
%e A180024 a(1000) = prime(1001) = 7927->1111011110111;
%e A180024 n=6542: prime(6542) = 65521->1111111111110001 with 13 ones,
%e A180024 a(6542) = prime(7255) = 73471->10001111011111111;
%e A180024 n=6543: prime(6543) = 65537->10000000000000001 with 2 ones,
%e A180024 a(6543) = unknown.
%t A180024 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 *)
%o A180024 (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
%Y A180024 Cf. A014499, A004676.
%K A180024 nonn
%O A180024 2,1
%A A180024 _Reinhard Zumkeller_, Aug 07 2010