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.
%I A336823 #41 Sep 21 2020 19:16:42 %S A336823 1,1,1,2,2,1,2,6,6,3,6,2,1,3,1,4,4,2,1,3,6,2,6,24,12,4,12,3,1,4,1,5,5, %T A336823 10,5,15,30,10,30,120,60,20,60,15,5,20,5,1,2,6,2,8,24,6,24,120,40,10, %U A336823 40,8,2,10,2,12,12,6,3,1,2,6,2,8,4,12,4,1,3,12 %N A336823 a(1)=1; thereafter a(n) = a(n-1) / wt(n-1) if wt(n-1) divides a(n-1), otherwise a(n) = a(n-1) * wt(n-1) where wt(n) is the binary weight of n. %H A336823 Gage Schacher, <a href="/A336823/b336823.txt">Table of n, a(n) for n = 1..10000</a> %F A336823 a(n) = a(n-1)/A000120(n-1) iff A000120(n-1) is a factor of a(n-1), otherwise a(n) = a(n-1)*A000120(n-1). %e A336823 a(1)=1 is given, and has 1, the binary weight of 1, as a factor so a(2) =1/1=1; %e A336823 a(2)=1 which has 1, the binary weight of 2, as a factor so a(3) =1/1=1; %e A336823 a(3)=1 which does not have 2, the binary weight of 3, as a factor so a(4) =1*2=2. %t A336823 a[1] = 1; a[n_] := a[n] = If[Divisible[a[n-1], (w = DigitCount[n-1, 2, 1])], a[n-1] / w, a[n-1] * w]; Array[a, 100] (* _Amiram Eldar_, Aug 05 2020 *) %o A336823 (PARI) a(n) = if (n==1, 1, my(h=hammingweight(n-1), last=a(n-1)); if (last%h, last*h, last/h)); \\ _Michel Marcus_, Aug 05 2020 %Y A336823 Cf. A000120 (binary weight), A326889. %K A336823 base,nonn,look %O A336823 1,4 %A A336823 _Gage Schacher_, Aug 04 2020 %E A336823 a(1)=1 added to definition. - _N. J. A. Sloane_, Sep 21 2020