A211017
T(n,k) = total area of all squares and rectangles of area 2^(k-1) after 2^n stages in the toothpick structure of A139250, n>=1, k>=1, assuming the toothpicks have length 2. Triangle read by rows.
Original entry on oeis.org
0, 0, 8, 8, 24, 16, 40, 104, 48, 32, 168, 424, 208, 96, 64, 680, 1704, 848, 416, 192, 128, 2728, 6824, 3408, 1696, 832, 384, 256, 10920, 27304, 13648, 6816, 3392, 1664, 768, 512, 43688, 109924, 54608, 27296, 13632, 6784, 3328, 1536, 1024
Offset: 1
For n = 5 in the toothpick structure after 2^5 stages we have that:
T(5,1) = 168 is the total area of all squares of size 1 X 1.
T(5,2) = 424 is the total area of all rectangles of size 1 X 2.
T(5,3) = 208 is the total area of all squares of size 2 X 2 and of all rectangles of size 1 X 4.
T(5,4) = 96 is the total area of all rectangles of size 2 X 4.
T(5,5) = 64 is the total area of all rectangles of size 2 X 8.
Triangle begins:
0;
0, 8;
8, 24, 16;
40, 104, 48, 32;
168, 424, 208, 96, 64;
680, 1704, 848, 416, 192, 128;
2728, 6824, 3408, 1696, 832, 384, 256;
10920, 27304, 13648, 6816, 3392, 1664, 768, 512;
A211019
Triangle read by rows: T(n,k) = number of squares and rectangles of area 2^(k-1) after 2^n stages in the toothpick structure of A139250, divided by 4, n>=1, k>=1, assuming the toothpicks have length 2.
Original entry on oeis.org
0, 0, 1, 2, 3, 1, 10, 13, 3, 1, 42, 53, 13, 3, 1, 170, 213, 53, 13, 3, 1, 682, 853, 213, 53, 13, 3, 1, 2730, 3413, 853, 213, 53, 13, 3, 1, 10922, 13653, 3413, 853, 213, 53, 13, 3, 1, 43690, 54613, 13653, 3413, 853, 213, 53, 13, 3, 1, 174762, 218453
Offset: 1
Triangle begins:
0;
0, 1;
2, 3, 1;
10, 13, 3, 1;
42, 53, 13, 3, 1;
170, 213, 53, 13, 3, 1;
682, 853, 213, 53, 13, 3, 1;
2730, 3413, 853, 213, 53, 13, 3, 1;
10922, 13653, 3413, 853, 213, 53, 13, 3, 1;
43690, 54613, 13653, 3413, 853, 213, 53, 13, 3, 1;
Row sums give 0 together with
A014825.
A060590
Numerator of the expected time to finish a random Tower of Hanoi problem with n disks using optimal moves.
Original entry on oeis.org
0, 2, 2, 14, 10, 62, 42, 254, 170, 1022, 682, 4094, 2730, 16382, 10922, 65534, 43690, 262142, 174762, 1048574, 699050, 4194302, 2796202, 16777214, 11184810, 67108862, 44739242, 268435454, 178956970, 1073741822, 715827882, 4294967294
Offset: 0
a(2)=2 since there are nine equally likely possibilities, with times required of 0,1,1,2,2,3,3,3,3 giving an average of 18/9 = 2/1.
A108019
a(n) = (8^n - 1)*4/7.
Original entry on oeis.org
0, 4, 36, 292, 2340, 18724, 149796, 1198372, 9586980, 76695844, 613566756, 4908534052, 39268272420, 314146179364, 2513169434916, 20105355479332, 160842843834660, 1286742750677284, 10293942005418276, 82351536043346212
Offset: 0
a(3)=292 because 292 translated in base 2 is three times 100: 100100100.
From _Zerinvary Lajos_, Jan 14 2007: (Start)
Octal............Decimal
0......................0
4......................4
44....................36
444..................292
4444................2340
44444..............18724
444444............149796
4444444..........1198372
44444444.........9586980
444444444.......76695844
4444444444.....613566756,
etc. (End)
-
Table[ FromDigits[ Flatten[ Table[{1, 0, 0}, {i, n}]], 2], {n, 0, 19}] (* Robert G. Wilson v, Jun 01 2005 *)
s=0;lst={s};Do[s+=2^n;AppendTo[lst, s], {n, 2, 5!, 3}];lst (* Vladimir Joseph Stephan Orlovsky, Nov 07 2008 *)
NestList[8#+4&,0,20] (* Harvey P. Dale, Aug 08 2013 *)
-
a(n)=if(n<0, 0,(8^n-1)*4/7) /* Michael Somos */
A152571
Triangle T(n,k) read by rows: T(n,n) = -1, T(n,0) = 4^(n - 1), T(n,k) = -4^(n - k - 1), 1 <= k <= n - 1.
Original entry on oeis.org
-1, 1, -1, 4, -1, -1, 16, -4, -1, -1, 64, -16, -4, -1, -1, 256, -64, -16, -4, -1, -1, 1024, -256, -64, -16, -4, -1, -1, 4096, -1024, -256, -64, -16, -4, -1, -1, 16384, -4096, -1024, -256, -64, -16, -4, -1, -1, 65536, -16384, -4096, -1024, -256, -64, -16, -4, -1, -1
Offset: 0
Triangle begins:
-1;
1, -1;
4, -1, -1;
16, -4, -1, -1;
64, -16, -4, -1, -1;
256, -64, -16, -4, -1, -1;
1024, -256, -64, -16, -4, -1, -1;
4096, -1024, -256, -64, -16, -4, -1, -1;
16384, -4096, -1024, -256, -64, -16, -4, -1, -1;
65536, -16384, -4096, -1024, -256, -64, -16, -4, -1, -1;
262144, -65536, -16384, -4096, -1024, -256, -64, -16, -4, -1, -1;
...
-
b[0] = {-1}; b[1] = {1, -1};
b[n_] := b[n] = Join[{4^(n - 1)}, {-b[n - 1][[1]]}, Table[b[n - 1][[i]], {i, 2, Length[b[n - 1]]}]];
Flatten[Table[b[n], {n, 0, 10}]]
-
T(n, k) := if k = n then -1 else if k = 0 then 4^(n - 1) else -4^(n - k - 1)$
create_list(T(n, k), n, 0, 20, k, 0, n); /* Franck Maminirina Ramaharo, Jan 08 2019 */
A154570
The main diagonal of the successive differences of A154127.
Original entry on oeis.org
1, 3, -4, 2, -6, -2, -14, -18, -46, -82, -174, -338, -686, -1362, -2734, -5458, -10926, -21842, -43694, -87378, -174766, -349522, -699054, -1398098, -2796206, -5592402, -11184814, -22369618, -44739246, -89478482, -178956974, -357913938, -715827886
Offset: 0
A176965
a(n) = 2^(n-1) - (2^n*(-1)^n + 2)/3.
Original entry on oeis.org
1, 0, 6, 2, 26, 10, 106, 42, 426, 170, 1706, 682, 6826, 2730, 27306, 10922, 109226, 43690, 436906, 174762, 1747626, 699050, 6990506, 2796202, 27962026, 11184810, 111848106, 44739242, 447392426, 178956970, 1789569706, 715827882, 7158278826
Offset: 1
-
List([1..30], n-> (3*2^(n-1) -(-2)^n -2)/3); # G. C. Greubel, Dec 28 2019
-
[(3*2^(n-1) -(-2)^n -2)/3: n in [1..30]]; // G. C. Greubel, Dec 28 2019
-
seq( (3*2^(n-1) -(-2)^n -2)/3, n=1..30); # G. C. Greubel, Dec 28 2019
-
a[n_]:= a[n]= 2^(n-1)*If[n==1, 1, a[n-1]/2 +(-1)^(n-1)*Sqrt[(5 +4*(-1)^(n-1) )]/2]; Table[a[n], {n,30}]
LinearRecurrence[{1,4,-4}, {1,0,6}, 30] (* G. C. Greubel, Dec 28 2019 *)
-
vector(30, n, (3*2^(n-1) -(-2)^n -2)/3 ) \\ G. C. Greubel, Dec 28 2019
-
[(3*2^(n-1) -(-2)^n -2)/3 for n in (1..30)] # G. C. Greubel, Dec 28 2019
A213704
Catalan Unranking function U(size,rank) for totally balanced binary strings (converted to decimal). Each row 'size' of an array lists all A000108(size) such items in standard lexicographic order, followed by an infinite number of zeros.
Original entry on oeis.org
0, 0, 2, 0, 0, 10, 0, 0, 12, 42, 0, 0, 0, 44, 170, 0, 0, 0, 50, 172, 682, 0, 0, 0, 52, 178, 684, 2730, 0, 0, 0, 56, 180, 690, 2732, 10922, 0, 0, 0, 0, 184, 692, 2738, 10924, 43690, 0, 0, 0, 0, 202, 696, 2740, 10930, 43692, 174762, 0, 0, 0, 0, 204, 714, 2744, 10932, 43698, 174764, 699050, 0
Offset: 0
A345253
Maximal Fibonacci tree: Arrangement of the positive integers as labels of a complete binary tree.
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 8, 7, 9, 10, 13, 11, 14, 16, 21, 12, 15, 17, 22, 18, 23, 26, 34, 19, 24, 27, 35, 29, 37, 42, 55, 20, 25, 28, 36, 30, 38, 43, 56, 31, 39, 44, 57, 47, 60, 68, 89, 32, 40, 45, 58, 48, 61, 69, 90, 50, 63, 71, 92, 76, 97, 110, 144, 33, 41, 46, 59, 49
Offset: 1
As a complete binary tree:
1
/ \
2 3
/ \ / \
4 5 6 8
/ \ / \ / \ / \
7 9 10 13 11 14 16 21
/ \ / \ / \ / \ / \ / \ / \ / \
...
By maximal Fibonacci expansion:
F(1)
/ \
F(1) + F(2) F(1) + F(3)
/ \ / \
F(1) + F(2) + F(3) F(1) + F(2) + F(4) F(1) + F(3) + F(4) F(1) + F(3) + F(5)
...
"Fibonacci gaps," or differences between successive indices in maximal Fibonacci expansion above, are A007931(n-1) for n > 1 (see link):
*
/ \
1 2
/ \ / \
11 12 21 22
/ \ / \ / \ / \
111 112 121 122 211 212 221 222
/ \ / \ / \ / \ / \ / \ / \ / \
...
In examples of the three methods below:
Branch left-right-right down the tree to arrive at nodal position n = 2*(2*(2*1) + 1) + 1 = 11;
Branch right-left-left down the tree to arrive at nodal position n = 2*(2*(2*1 + 1)) = 12.
Tree by inner composition of (one plus) the lower and upper Wythoff sequences, A000201 and A001950 (Method 1):
a(11) = A000201(A001950(A001950(1) + 1) + 1) + 1 = 13.
a(12) = A001950(A000201(A000201(1) + 1) + 1) + 1 = 11.
Tree by (outer) composition of branching functions L(n) = n + F(Finv(n)) and R(n) = n + F(Finv(n) + 1), where F(n) = A000045(n) and Finv(n) = A130233(n) (Method 2):
a(11) = R(R(L(1))) = 13.
a(12) = L(R(R(1))) = 11.
Tree by outer composition of A060143 and A060144 (Wythoff inverse sequences) (Method 3):
a(11) = 13, position of first nonzero in A060144(A060144(A060143(m))) = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ..., for m = 1, 2, 3, ....
a(12) = 11, position of first nonzero in A060143(A060143(A060144(m))) = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ..., for m = 1, 2, 3, ....
Cf.
A000045,
A000201,
A001950,
A007931,
A020988,
A020989,
A026351,
A026352,
A029837,
A048680,
A049651,
A059893,
A061547,
A070939,
A081242,
A083047,
A095903,
A099919,
A112310,
A113473,
A130233,
A200648,
A232560,
A243571,
A255773,
A255774,
A329395,
A343152,
A345252,
A345254.
-
(* For binary tree implementations, see supporting file under LINKS *)
a[n_] := (x = 0; y = 0; BDn = Reverse[IntegerDigits[n, 2]]; imax = Length[BDn] - 1; For[i = 0, i <= imax, i++, {x, y} = {y + 1, x + y}; If[BDn[[i + 1]] == 1, {x, y} = {y, x + y}]]; y);
(* Adapted from PARI code of Kevin Ryde *)
-
a(n) = my(x=0,y=0); for(i=0,logint(n,2), [x,y]=[y+1,x+y]; if(bittest(n,i), [x,y]=[y,x+y])); y; \\ Kevin Ryde, Jun 19 2021
A065085
Smallest prime having alternating bit sum (A065359) equal to -n, or 0 if no such prime exists.
Original entry on oeis.org
3, 2, 43, 0, 683, 2731, 0, 43691, 174763, 0, 2796203, 44608171, 0, 715827881, 715827883, 0, 114532461227, 183251938027, 0, 2931494136491, 2932031007403, 0, 187647836990123, 748400914639531, 0, 11446649052900011, 45786596211600043, 0
Offset: 0
The smallest number having alternating bit sum -n is (2/3)(4^n-1), which for n=4 is 170 = (10101010)2. The least odd number with alternating bit sum -4 is (10)2 || ( (10101010)2 + (1)2 ) = 683, which is prime, so a(4) = 683. - _Washington Bomfim_, Jan 27 2011
-
f[n_] := Plus @@ (-(-1)^Range[Floor[Log2@n + 1]] Reverse@ IntegerDigits[n, 2]); a = Table[ f[ Prime[n]], {n, 1, 10^6} ]; b = Table[0, {12} ]; Do[ If[ a[[n]] < 1 && b[[ -a[[n]] + 1]] == 0, b[[ -a[[n]] + 1]] = Prime[n]], {n, 1, 10^6} ]; b
-
II()={i = (2/3)*(4^n-1) + 1 + 2^(2*n+1); if(isprime(i),return(1)); return(0)};
III()={w = 2^(2*n+3); for(j=1, n+1, i += w; w /= 4; i -= w; if(isprime(i),return(1))); return(0)};
IV()={i+=6; if(isprime(i), return(1)); w=4; for(j=1, n, i -= w; w*=4; i+=w; if(isprime(i), return(1)));return(0)};
V()={i += 2^(2*n+4) - 2^(2*n+2); if(isprime(i),return(1));w = i + 2^(2*n+5) - 2^(2*n+4); i = w - 2^(2*n+3) - 2^(2*n+1); if(isprime(i),return(1));w = 2^(2*n+1);for(j=1, n,i += w; w /= 4; i -= w;if(isprime(i),return(1) ));return(0)};
print("0 3");print("1 2");for(n=2,117, if(II(),print(n," ",i), if(III(),print(n," ",i), if(IV(),print(n," ",i), if(V(),print(n," ",i),if(n%3==0,print(n," 0"),print(n," not found."))))))) \\ Washington Bomfim, Feb 06 2011
Comments