close
login
A372473
Least k such that the k-th squarefree number has exactly n zeros in its binary expansion.
16
1, 2, 7, 12, 21, 40, 79, 158, 315, 1247, 1246, 2492, 4983, 9963, 19921, 39845, 79689, 159361, 318726, 637462, 1274919, 2549835, 5099651, 10199302, 20398665, 40797328, 81594627, 163189198, 326378285, 652756723, 1305513584, 2611027095, 5222054082, 10444108052
OFFSET
0,2
COMMENTS
Note that the data is not strictly increasing.
LINKS
EXAMPLE
The squarefree numbers A005117(a(n)) together with their binary expansions and binary indices begin:
1: 1 ~ {1}
2: 10 ~ {2}
10: 1010 ~ {2,4}
17: 10001 ~ {1,5}
33: 100001 ~ {1,6}
65: 1000001 ~ {1,7}
129: 10000001 ~ {1,8}
257: 100000001 ~ {1,9}
514: 1000000010 ~ {2,10}
2051: 100000000011 ~ {1,2,12}
2049: 100000000001 ~ {1,12}
4097: 1000000000001 ~ {1,13}
8193: 10000000000001 ~ {1,14}
MATHEMATICA
nn=10000;
spnm[y_]:=Max@@NestWhile[Most, y, Union[#]!=Range[0, Max@@#]&];
dcs=DigitCount[Select[Range[nn], SquareFreeQ], 2, 0];
Table[Position[dcs, i][[1, 1]], {i, 0, spnm[dcs]}]
PROG
(Python)
from math import isqrt
from itertools import count
from sympy import factorint, mobius
from sympy.utilities.iterables import multiset_permutations
def A372473(n):
if n==0: return 1
for l in count(n):
m = 1<<l
for d in multiset_permutations('0'*n+'1'*(l-n)):
k = m+int('0'+''.join(d), 2)
if max(factorint(k).values(), default=0)==1:
return sum(mobius(a)*(k//a**2) for a in range(1, isqrt(k)+1)) # Chai Wah Wu, May 10 2024
CROSSREFS
Positions of first appearances in A372472.
For prime instead of squarefree we have A372474, A035103, A372517, A014499.
Counting bits (length) gives A372540, firsts of A372475, runs A077643.
Counting 1's (weight) instead of 0's gives A372541, firsts of A372433.
A000120 counts ones in binary expansion (binary weight), zeros A080791.
A005117 lists squarefree numbers.
A030190 gives binary expansion, reversed A030308.
A048793 lists positions of ones in reversed binary expansion, sum A029931.
A070939 gives length of binary expansion (number of bits).
A371571 lists positions of zeros in binary expansion, sum A359359.
A371572 lists positions of ones in binary expansion, sum A230877.
A372515 lists positions of zeros in reversed binary expansion, sum A359400.
Sequence in context: A119713 A213041 A293330 * A135541 A288656 A180804
KEYWORD
nonn,base
AUTHOR
Gus Wiseman, May 09 2024
EXTENSIONS
a(23)-a(33) from Chai Wah Wu, May 10 2024
STATUS
approved