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 A104257 #21 Oct 23 2023 02:11:47 %S A104257 2,3,3,4,4,4,5,5,9,5,6,6,16,10,6,7,7,25,17,12,7,8,8,36,26,20,13,8,9,9, %T A104257 49,37,30,21,27,9,10,10,64,50,42,31,64,28,10,11,11,81,65,56,43,125,65, %U A104257 30,11,12,12,100,82,72,57,216,126,68,31,12,13,13,121,101,90,73,343 %N A104257 Square array T(a,n) read by antidiagonals: replace 2^i with a^i in binary representation of n, where a,n >= 2. %C A104257 Sums of distinct powers of a. Numbers having only {0,1} in a-ary representation. %H A104257 John Tyler Rascoe, <a href="/A104257/b104257.txt">Antidiagonals n = 2..140, flattened</a> %F A104257 T(a, n) = (1/(a-1))*Sum_{j>=1} floor((n+2^(j-1))/2^j) * ((a-2)*a^(j-1) + 1). %F A104257 T(a, n) = (1/(a-1))*Sum_{j=1..n} ((a-2)*a^A007814(j) + 1). %F A104257 G.f. of a-th row: (1/(1-x)) * Sum_{k>=0} a^k*x^2^k/(1+x^2^k). %F A104257 Recurrence: T(a, 2n) = a*T(a, n), T(a, 2n+1) = a*T(a, n) + 1, T(a, 0) = 0. %e A104257 Array begins: %e A104257 2, 3, 4, 5, 6, 7, 8, 9, ... %e A104257 3, 4, 9, 10, 12, 13, 27, 28, ... %e A104257 4, 5, 16, 17, 20, 21, 64, 65, ... %e A104257 5, 6, 25, 26, 30, 31, 125, 126, ... %e A104257 6, 7, 36, 37, 42, 43, 216, 217, ... %e A104257 7, 8, 49, 50, 56, 57, 343, 344, ... %e A104257 8, 9, 64, 65, 72, 73, 512, 513, ... %e A104257 9, 10, 81, 82, 90, 91, 729, 730, ... %e A104257 ... %t A104257 T[_, 0] = 0; T[2, n_] := n; T[a_, 2] := a; %t A104257 T[a_, n_] := T[a, n] = If[EvenQ[n], a T[a, n/2], a T[a, (n-1)/2]+1]; %t A104257 Table[T[a-n+2, n], {a, 2, 13}, {n, 2, a}] // Flatten (* _Jean-François Alcover_, Feb 09 2021 *) %o A104257 (Python) %o A104257 def T(a, n): return n if n < 2 else (max(a, n) if min(a, n) == 2 else a*T(a, n//2) + n%2) %o A104257 print([T(a-n+2, n) for a in range(2, 14) for n in range(2, a+1)]) # _Michael S. Branicky_, Aug 02 2022 %o A104257 (PARI) T(a, n) = fromdigits(binary(n), a); \\ _Michel Marcus_, Aug 19 2022 %Y A104257 Rows include (essentially) A005836, A000695, A033042, A033043, A033044, A033045, A033046, A033047, A033048, A033049, A033050, A033051, A033052. %Y A104257 Columns include A000290, A002522, A002378, A000578, A001093, A034262, A071568, A011379, A098547, A027444. %Y A104257 Main diagonal is A104258. %K A104257 nonn,tabl %O A104257 2,1 %A A104257 _Ralf Stephan_, Mar 05 2005