|
|
A372475
|
|
Length of binary expansion (or number of bits) of the n-th squarefree number.
|
|
17
|
|
|
1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
The 10th squarefree number is 14, with binary expansion (1,1,1,0), so a(10) = 4.
|
|
MATHEMATICA
|
IntegerLength[Select[Range[1000], SquareFreeQ], 2]
|
|
PROG
|
(Python)
from math import isqrt
from sympy import mobius
def f(x): return n+x-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
m, k = n, f(n)
while m != k:
m, k = k, f(k)
|
|
CROSSREFS
|
Positions of first appearances are A372540.
A048793 lists positions of ones in reversed binary expansion, sum A029931.
A372515 lists positions of zeros in reversed binary expansion, sum A359400.
Cf. A003714, A023416, A049093, A049094, A059015, A069010, A073642, A145037, A211997, A368494, A372474, A372516.
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|