login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A104257 Square array T(a,n) read by antidiagonals: replace 2^i with a^i in binary representation of n, where a,n >= 2. 19
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, 49, 37, 30, 21, 27, 9, 10, 10, 64, 50, 42, 31, 64, 28, 10, 11, 11, 81, 65, 56, 43, 125, 65, 30, 11, 12, 12, 100, 82, 72, 57, 216, 126, 68, 31, 12, 13, 13, 121, 101, 90, 73, 343 (list; table; graph; refs; listen; history; text; internal format)
OFFSET
2,1
COMMENTS
Sums of distinct powers of a. Numbers having only {0,1} in a-ary representation.
LINKS
FORMULA
T(a, n) = (1/(a-1))*Sum_{j>=1} floor((n+2^(j-1))/2^j) * ((a-2)*a^(j-1) + 1).
T(a, n) = (1/(a-1))*Sum_{j=1..n} ((a-2)*a^A007814(j) + 1).
G.f. of a-th row: (1/(1-x)) * Sum_{k>=0} a^k*x^2^k/(1+x^2^k).
Recurrence: T(a, 2n) = a*T(a, n), T(a, 2n+1) = a*T(a, n) + 1, T(a, 0) = 0.
EXAMPLE
Array begins:
2, 3, 4, 5, 6, 7, 8, 9, ...
3, 4, 9, 10, 12, 13, 27, 28, ...
4, 5, 16, 17, 20, 21, 64, 65, ...
5, 6, 25, 26, 30, 31, 125, 126, ...
6, 7, 36, 37, 42, 43, 216, 217, ...
7, 8, 49, 50, 56, 57, 343, 344, ...
8, 9, 64, 65, 72, 73, 512, 513, ...
9, 10, 81, 82, 90, 91, 729, 730, ...
...
MATHEMATICA
T[_, 0] = 0; T[2, n_] := n; T[a_, 2] := a;
T[a_, n_] := T[a, n] = If[EvenQ[n], a T[a, n/2], a T[a, (n-1)/2]+1];
Table[T[a-n+2, n], {a, 2, 13}, {n, 2, a}] // Flatten (* Jean-François Alcover, Feb 09 2021 *)
PROG
(Python)
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)
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
(PARI) T(a, n) = fromdigits(binary(n), a); \\ Michel Marcus, Aug 19 2022
CROSSREFS
Main diagonal is A104258.
Sequence in context: A226143 A166724 A110862 * A048182 A300293 A316388
KEYWORD
nonn,tabl
AUTHOR
Ralf Stephan, Mar 05 2005
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 15:11 EDT 2024. Contains 371794 sequences. (Running on oeis4.)