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.

A372474 Least k such that the k-th prime number has exactly n zeros in its binary expansion.

This page as a plain text file.
%I A372474 #20 May 13 2024 13:57:13
%S A372474 2,1,8,7,19,32,99,55,174,310,565,1029,1902,3513,6544,6543,23001,43395,
%T A372474 82029,155612,295957,564164,1077901,3957811,3965052,7605342,14630844,
%U A372474 28194383,54400029,105097568,393615809,393615807,762939128,1480206930,2874398838,5586502349
%N A372474 Least k such that the k-th prime number has exactly n zeros in its binary expansion.
%F A372474 a(n) = A000720(A066195(n)). - _Robert Israel_, May 13 2024
%e A372474 The prime numbers A000040(a(n)) together with their binary expansions and binary indices begin:
%e A372474          3:                          11 ~ {1,2}
%e A372474          2:                          10 ~ {2}
%e A372474         19:                       10011 ~ {1,2,5}
%e A372474         17:                       10001 ~ {1,5}
%e A372474         67:                     1000011 ~ {1,2,7}
%e A372474        131:                    10000011 ~ {1,2,8}
%e A372474        523:                  1000001011 ~ {1,2,4,10}
%e A372474        257:                   100000001 ~ {1,9}
%e A372474       1033:                 10000001001 ~ {1,4,11}
%e A372474       2053:                100000000101 ~ {1,3,12}
%e A372474       4099:               1000000000011 ~ {1,2,13}
%e A372474       8209:              10000000010001 ~ {1,5,14}
%e A372474      16417:             100000000100001 ~ {1,6,15}
%e A372474      32771:            1000000000000011 ~ {1,2,16}
%e A372474      65539:           10000000000000011 ~ {1,2,17}
%e A372474      65537:           10000000000000001 ~ {1,17}
%e A372474     262147:         1000000000000000011 ~ {1,2,19}
%e A372474     524353:        10000000000001000001 ~ {1,7,20}
%e A372474    1048609:       100000000000000100001 ~ {1,6,21}
%e A372474    2097169:      1000000000000000010001 ~ {1,5,22}
%e A372474    4194433:     10000000000000010000001 ~ {1,8,23}
%e A372474    8388617:    100000000000000000001001 ~ {1,4,24}
%e A372474   16777729:   1000000000000001000000001 ~ {1,10,25}
%e A372474   67108913: 100000000000000000000110001 ~ {1,5,6,27}
%e A372474   67239937: 100000000100000000000000001 ~ {1,18,27}
%t A372474 nn=10000;
%t A372474 spnm[y_]:=Max@@NestWhile[Most,y,Union[#]!=Range[0,Max@@#]&];
%t A372474 dcs=DigitCount[Select[Range[nn],PrimeQ],2,0];
%t A372474 Table[Position[dcs,i][[1,1]],{i,0,spnm[dcs]}]
%o A372474 (Python)
%o A372474 from itertools import count
%o A372474 from sympy import isprime, primepi
%o A372474 from sympy.utilities.iterables import multiset_permutations
%o A372474 def A372474(n):
%o A372474     for l in count(n):
%o A372474         m = 1<<l
%o A372474         for d in multiset_permutations('0'*n+'1'*(l-n)):
%o A372474             k = m+int('0'+''.join(d),2)
%o A372474             if isprime(k):
%o A372474                 return primepi(k) # _Chai Wah Wu_, May 13 2024
%Y A372474 Positions of first appearances in A035103.
%Y A372474 For squarefree instead of prime we have A372473, firsts of A372472.
%Y A372474 Counting ones (weight) gives A372517, firsts of A014499.
%Y A372474 Counting squarefree bits gives A372540, firsts of A372475, runs A077643.
%Y A372474 Counting squarefree ones gives A372541, firsts of A372433.
%Y A372474 Counting bits (length) gives A372684, firsts of A035100.
%Y A372474 A000120 counts ones in binary expansion (binary weight), zeros A080791.
%Y A372474 A030190 gives binary expansion, reversed A030308.
%Y A372474 A048793 lists positions of ones in reversed binary expansion, sum A029931.
%Y A372474 A070939 gives length of binary expansion (number of bits).
%Y A372474 Cf. A059015, A066195, A069010, A073642, A145037, A211997, A230877, A359359, A359400, A371571, A372516.
%K A372474 nonn,base
%O A372474 0,1
%A A372474 _Gus Wiseman_, May 11 2024
%E A372474 a(22)-a(35) from and offset corrected by _Chai Wah Wu_, May 13 2024