A165933 Least integer, k, whose value is n in A165413.
1, 4, 35, 536, 16775, 1060976, 135007759, 34460631520, 17617985239071, 18027600169142208, 36907002795598798911, 151143401509104346210176, 1238053384151947477501575295, 20283338091738780737237428502272, 664629209970464486086782992577855743
Offset: 1
Examples
a(1) in binary is 1, a(2) in binary is 100, a(3) in binary is 100011, a(4) in binary is 1000011000, etc. From _Gus Wiseman_, Feb 21 2022: (Start) The terms and their binary expansions begin: n a(n) 1: 1 = 1 2: 4 = 100 3: 35 = 100011 4: 536 = 1000011000 5: 16775 = 100000110000111 6: 1060976 = 100000011000001110000 7: 135007759 = 1000000011000000111000001111 8: 34460631520 = 100000000110000000111000000111100000 9: 17617985239071 = 100000000011000000001110000000111100000011111 (End)
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..81
Crossrefs
These are the positions of first appearances in A165413.
A000120 counts binary weight.
A005811 counts runs in binary expansion.
A242882 counts compositions with distinct multiplicities.
A318928 gives runs-resistance of binary expansion.
A351014 counts distinct runs in standard compositions.
Counting words with all distinct run-lengths:
Programs
-
Mathematica
g[n_] := Table[ {Table[1, {i}], Table[0, {n - i + 1}]}, {i, Floor[(n + If[ OddQ@n, 1, 0])/2]}]; f[n_] := FromDigits[ If[ OddQ@n, Flatten@ Most@ Flatten[ g@n, 1], Flatten@ g@n], 2]; Array[f, 14] s=Table[Length[Union[Length/@Split[IntegerDigits[n,2]]]],{n,0,1000}]; Table[Position[s,k][[1,1]]-1,{k,Union[s]}] (* Gus Wiseman, Feb 21 2022 *)
-
Python
def a(n): # returns term by construction if n == 1: return 1 q, r = divmod(n+1, 2) s = "".join("1"*i + "0"*(n+1-i) for i in range(1, q+1)) if r == 0: s = s.rstrip("0") return int(s, 2) print([a(n) for n in range(1, 16)]) # Michael S. Branicky, Feb 22 2022
Extensions
a(15) and beyond from Michael S. Branicky, Feb 22 2022
Comments