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.

A372540 Least k such that the k-th squarefree number has binary expansion of length n. Index of the smallest squarefree number >= 2^n.

This page as a plain text file.
%I A372540 #25 Aug 26 2024 20:07:33
%S A372540 1,2,4,7,12,21,40,79,158,315,625,1246,2492,4983,9963,19921,39845,
%T A372540 79689,159361,318726,637462,1274919,2549835,5099651,10199302,20398665,
%U A372540 40797328,81594627,163189198,326378285,652756723,1305513584,2611027095,5222054082,10444108052
%N A372540 Least k such that the k-th squarefree number has binary expansion of length n. Index of the smallest squarefree number >= 2^n.
%H A372540 Chai Wah Wu, <a href="/A372540/b372540.txt">Table of n, a(n) for n = 0..73</a>
%F A372540 A005117(a(n)) = A372683(n).
%F A372540 a(n) = A143658(n)+1 for n > 1. - _Chai Wah Wu_, Aug 26 2024
%e A372540 The squarefree numbers A005117(a(n)) together with their binary expansions and binary indices begin:
%e A372540        1:                  1 ~ {1}
%e A372540        2:                 10 ~ {2}
%e A372540        5:                101 ~ {1,3}
%e A372540       10:               1010 ~ {2,4}
%e A372540       17:              10001 ~ {1,5}
%e A372540       33:             100001 ~ {1,6}
%e A372540       65:            1000001 ~ {1,7}
%e A372540      129:           10000001 ~ {1,8}
%e A372540      257:          100000001 ~ {1,9}
%e A372540      514:         1000000010 ~ {2,10}
%e A372540     1027:        10000000011 ~ {1,2,11}
%e A372540     2049:       100000000001 ~ {1,12}
%e A372540     4097:      1000000000001 ~ {1,13}
%e A372540     8193:     10000000000001 ~ {1,14}
%e A372540    16385:    100000000000001 ~ {1,15}
%e A372540    32770:   1000000000000010 ~ {2,16}
%e A372540    65537:  10000000000000001 ~ {1,17}
%e A372540   131073: 100000000000000001 ~ {1,18}
%t A372540 nn=1000;
%t A372540 ssnm[y_]:=Max@@NestWhile[Most,y,Union[#]!=Range[Max@@#]&];
%t A372540 dcs=IntegerLength[Select[Range[nn],SquareFreeQ],2];
%t A372540 Table[Position[dcs,i][[1,1]],{i,ssnm[dcs]}]
%o A372540 (Python)
%o A372540 from itertools import count
%o A372540 from math import isqrt
%o A372540 from sympy import mobius, factorint
%o A372540 def A372540(n): return next(sum(mobius(a)*(k//a**2) for a in range(1, isqrt(k)+1)) for k in count(1<<n) if max(factorint(k).values(),default=0)==1) if n else 1 # _Chai Wah Wu_, May 12 2024
%Y A372540 Counting zeros instead of length gives A372473, firsts of A372472.
%Y A372540 For prime instead of squarefree we have:
%Y A372540 - zeros A372474, firsts of A035103
%Y A372540 - ones A372517, firsts of A014499
%Y A372540 - bits A372684, firsts of A035100
%Y A372540 Positions of first appearances in A372475, run-lengths A077643.
%Y A372540 For weight instead of length we have A372541, firsts of A372433.
%Y A372540 Indices of the squarefree numbers listed by A372683.
%Y A372540 A000120 counts ones in binary expansion (binary weight), zeros A080791.
%Y A372540 A005117 lists squarefree numbers.
%Y A372540 A030190 gives binary expansion, reversed A030308.
%Y A372540 A070939 counts bits, binary length, or length of binary expansion.
%Y A372540 Cf. A029931, A048793, A049093, A049094, A059015, A069010, A143658, A211997, A230877.
%K A372540 nonn,base
%O A372540 0,2
%A A372540 _Gus Wiseman_, May 10 2024
%E A372540 a(24)-a(34) from _Chai Wah Wu_, May 12 2024