A358466 Number of 1's that appeared by n-th step when constructing A030717.
1, 2, 2, 3, 3, 4, 4, 5, 6, 7, 8, 8, 8, 10, 14, 17, 23, 30, 38, 49, 62, 77, 94, 110, 129, 149, 172, 195, 218, 241, 266, 293, 323, 356, 389, 424, 461, 500, 545, 593, 641, 688, 737, 787, 839, 896, 957, 1021, 1085, 1152, 1219, 1291, 1368, 1447, 1527, 1611, 1697, 1788, 1879, 1974, 2074, 2181, 2290, 2401, 2519
Offset: 1
Keywords
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..1024
Programs
-
Mathematica
nn = 94; c[] = 0; k = a[1] = c[1] = 1; Accumulate@ Prepend[Reap[Do[w = Union@ Array[a, k]; t = 0; Do[Set[a[j + k], c[w[[j]]]]; If[a[j + k] == 1, t++], {j, Length[w]}]; Do[c[a[j + k]]++, {j, Length[w]}]; k += Length[w]; Sow[t], {n, nn}]][[-1, -1]], 1] (* _Michael De Vlieger, Nov 18 2022 *)
-
Ruby
def A(k, n) a = [] ary = [1] n.times{ a << ary.count(k) ary += ary.uniq.sort.map{|i| ary.count(i)} } a end p A(1, 100)