[go: up one dir, main page]

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!)
A348175 Irregular table T(n,k) read by rows: T(n,k) = T(n-1,k/2) when k is even and 3*T(n-1,(k-1)/2) + 2^(n-1) when k is odd. T(0,0) = 0 and 0 <= k <= 2^n-1. 0
0, 0, 1, 0, 2, 1, 5, 0, 4, 2, 10, 1, 7, 5, 19, 0, 8, 4, 20, 2, 14, 10, 38, 1, 11, 7, 29, 5, 23, 19, 65, 0, 16, 8, 40, 4, 28, 20, 76, 2, 22, 14, 58, 10, 46, 38, 130, 1, 19, 11, 49, 7, 37, 29, 103, 5, 31, 23, 85, 19, 73, 65, 211 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
LINKS
FORMULA
T(n,k) = T(n-1,k/2) for k being even.
T(n,k) = 3*T(n-1,(k-1)/2) + 2^(n-1) for k being odd.
T(n,k) = 2*T(n-1,k) for 0 <= k <= 2^(n-1) - 1.
T(n,k) = Sum_{i=0..r} 2^(n-1-e[i]) * 3^i where binary expansion k = 2^e[0] + 2^e[1] + ... + 2^e[r] with ascending e[0] < e[1] < ... < e[r] (A133457). - Kevin Ryde, Oct 22 2021
EXAMPLE
n\k 0 1 2 3 4 5 6 7
0 0
1 0 1
2 0 2 1 5
3 0 4 2 10 1 7 5 19
MATHEMATICA
T[0, 0] = 0; T[n_, k_] := T[n, k] = If[EvenQ[k], T[n - 1, k/2], 3*T[n - 1, (k - 1)/2] + 2^(n - 1)]; Table[T[n, k], {n, 0, 5}, {k, 0, 2^n - 1}] // Flatten (* Amiram Eldar, Oct 11 2021 *)
PROG
(PARI) T(n, k) = if ((n==0) && (k==0), 0, if (k%2, 3*T(n-1, (k-1)/2) + 2^(n-1), T(n-1, k/2)));
tabf(nn) = for (n=0, nn, for (k=0, 2^n-1, print1(T(n, k), ", ")); print); \\ Michel Marcus, Oct 18 2021
(PARI) T(n, k) = my(ret=0); for(i=0, n-1, if(bittest(k, n-1-i), ret=3*ret+1<<i)); ret; \\ Kevin Ryde, Oct 22 2021
CROSSREFS
Cf. A001047 (right diagonal), A002697 (row sums), A119733.
Cf. A133457 (binary exponents).
Sequence in context: A104505 A359479 A324185 * A175958 A021469 A090985
KEYWORD
nonn,tabf
AUTHOR
Ryan Brooks, Oct 04 2021
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 August 29 13:35 EDT 2024. Contains 375517 sequences. (Running on oeis4.)