A023758
Numbers of the form 2^i - 2^j with i >= j.
Original entry on oeis.org
0, 1, 2, 3, 4, 6, 7, 8, 12, 14, 15, 16, 24, 28, 30, 31, 32, 48, 56, 60, 62, 63, 64, 96, 112, 120, 124, 126, 127, 128, 192, 224, 240, 248, 252, 254, 255, 256, 384, 448, 480, 496, 504, 508, 510, 511, 512, 768, 896, 960, 992, 1008, 1016, 1020, 1022, 1023
Offset: 1
a(22) = 64 = 32 + 32 = 2^5 + a(16) = 2^A003056(20) + a(22-5-1).
a(23) = 96 = 64 + 32 = 2^6 + a(16) = 2^A003056(21) + a(23-6-1).
a(24) = 112 = 64 + 48 = 2^6 + a(17) = 2^A003056(22) + a(24-6-1).
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000 (first 5051 terms from T. D. Noe)
- Andreas M. Hinz and Paul K. Stockmeyer, Precious Metal Sequences and Sierpinski-Type Graphs, J. Integer Seq., Vol 25 (2022), Article 22.4.8.
- S. M. Shabab Hossain, Md. Mahmudur Rahman and M. Sohel Rahman, Solving a Generalized Version of the Exact Cover Problem with a Light-Based Device, Optical Supercomputing, Lecture Notes in Computer Science, 2011, Volume 6748/2011, 23-31, DOI: 10.1007/978-3-642-22494-2_4.
- Eric Weisstein's World of Mathematics, Digit.
- Wikipedia, Ring counter.
- Index entries for 2-automatic sequences.
- Index entries for sequences related to binary expansion of n.
Positions of nonzero terms in
A341509 (apart from the initial zero).
Positions of squarefree terms in
A260443.
-
import Data.Set (singleton, deleteFindMin, insert)
a023758 n = a023758_list !! (n-1)
a023758_list = 0 : f (singleton 1) where
f s = x : f (if even x then insert z s' else insert z $ insert (z+1) s')
where z = 2*x; (x, s') = deleteFindMin s
-- Reinhard Zumkeller, Sep 24 2014, Dec 19 2012
-
a:=proc(n) local n2,d: n2:=convert(n,base,2): d:={seq(n2[j]-n2[j-1],j=2..nops(n2))}: if n=0 then 0 elif n=1 then 1 elif d={0,1} or d={0} or d={1} then n else fi end: seq(a(n),n=0..2100); # Emeric Deutsch, Apr 22 2006
-
Union[Flatten[Table[2^i - 2^j, {i, 0, 100}, {j, 0, i}]]] (* T. D. Noe, Mar 15 2011 *)
Select[Range[0, 2^10], NoneTrue[Differences@ IntegerDigits[#, 2], # > 0 &] &] (* Michael De Vlieger, Sep 05 2017 *)
-
for(n=0,2500,if(prod(k=1,length(binary(n))-1,component(binary(n),k)+1-component(binary(n),k+1))>0,print1(n,",")))
-
A023758(n)= my(r=round(sqrt(2*n--))); (1<<(n-r*(r-1)/2)-1)<<(r*(r+1)/2-n)
/* or, to illustrate the "decreasing digit" property and analogy to A064222: */
A023758(n,show=0)={ my(a=0); while(n--, show & print1(a","); a=vecsort(binary(a+1)); a*=vector(#a,j,2^(j-1))~); a} \\ M. F. Hasler, May 06 2009
-
is(n)=if(n<5,1,n>>=valuation(n,2);n++;n>>valuation(n,2)==1) \\ Charles R Greathouse IV, Jan 04 2016
-
list(lim)=my(v=List([0]),t); for(i=1,logint(lim\1+1,2), t=2^i-1; while(t<=lim, listput(v,t); t*=2)); Set(v) \\ Charles R Greathouse IV, May 03 2016
-
def a_next(a_n): return (a_n | (a_n >> 1)) + (a_n & 1)
a_n = 1; a = [0]
for i in range(55): a.append(a_n); a_n = a_next(a_n) # Falk Hüffner, Feb 19 2022
-
from math import isqrt
def A023758(n): return (1<<(m:=isqrt(n-1<<3)+1>>1))-(1<<(m*(m+1)-(n-1<<1)>>1)) # Chai Wah Wu, Feb 23 2025
A152568
Triangle T(n,k) read by rows: T(n,n) = -1, T(n,0) = 2^(n - 1), T(n,k) = -2^(n - k - 1), 1 <= k <= n - 1.
Original entry on oeis.org
-1, 1, -1, 2, -1, -1, 4, -2, -1, -1, 8, -4, -2, -1, -1, 16, -8, -4, -2, -1, -1, 32, -16, -8, -4, -2, -1, -1, 64, -32, -16, -8, -4, -2, -1, -1, 128, -64, -32, -16, -8, -4, -2, -1, -1, 256, -128, -64, -32, -16, -8, -4, -2, -1, -1, 512, -256, -128, -64, -32, -16, -8, -4, -2
Offset: 0
Triangle begins:
-1;
1, -1;
2, -1, -1;
4, -2, -1, -1;
8, -4, -2, -1, -1;
16, -8, -4, -2, -1, -1;
32, -16, -8, -4, -2, -1, -1;
64, -32, -16, -8, -4, -2, -1, -1;
128, -64, -32, -16, -8, -4, -2, -1, -1;
256, -128, -64, -32, -16, -8, -4, -2, -1, -1;
512, -256, -128, -64, -32, -16, -8, -4, -2, -1, -1;
...
-
b[0] = {-1}; b[1] = {1, -1};
b[n_] := b[n] = Join[{2^(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 2^(n - 1) else -2^(n - k - 1)$
create_list(T(n, k), n, 0, 20, k, 0, n); /* Franck Maminirina Ramaharo, Jan 08 2019 */
Unrelated material removed by the Assoc. Eds. of the OEIS, Jun 07 2010
A342126
The binary expansion of a(n) corresponds to that of n where all the 1's have been replaced by 0's except in the first run of 1's.
Original entry on oeis.org
0, 1, 2, 3, 4, 4, 6, 7, 8, 8, 8, 8, 12, 12, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 24, 24, 24, 24, 28, 28, 30, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, 56, 56, 56, 56, 60, 60, 62, 63, 64, 64, 64, 64
Offset: 0
The first terms, alongside their binary expansion, are:
n a(n) bin(n) bin(a(n))
-- ---- ------ ---------
0 0 0 0
1 1 1 1
2 2 10 10
3 3 11 11
4 4 100 100
5 4 101 100
6 6 110 110
7 7 111 111
8 8 1000 1000
9 8 1001 1000
10 8 1010 1000
11 8 1011 1000
12 12 1100 1100
13 12 1101 1100
14 14 1110 1110
15 15 1111 1111
-
a(n) = { my (b=binary(n), p=1); for (k=1, #b, b[k] = p*=b[k]); fromdigits(b, 2) }
-
def A342126(n):
s = bin(n)[2:]
i = s.find('0')
return n if i == -1 else (2**i-1)*2**(len(s)-i) # Chai Wah Wu, Apr 29 2021
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 */
A155038
Triangle read by rows: T(n,k) is the number of compositions of n with first part k.
Original entry on oeis.org
1, 1, 1, 2, 1, 1, 4, 2, 1, 1, 8, 4, 2, 1, 1, 16, 8, 4, 2, 1, 1, 32, 16, 8, 4, 2, 1, 1, 64, 32, 16, 8, 4, 2, 1, 1, 128, 64, 32, 16, 8, 4, 2, 1, 1, 256, 128, 64, 32, 16, 8, 4, 2, 1, 1, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 1, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 1, 2048, 1024, 512
Offset: 1
T(5,2) = 4 because the compositions of 5 with first part 2 are: [2,3], [2,2,1], [2,1,2], and [2,1,1,1]. - _Emeric Deutsch_, Jan 12 2018
Table begins:
1,
1, 1,
2, 1, 1,
4, 2, 1, 1,
8, 4, 2, 1, 1,
16, 8, 4, 2, 1, 1,
32, 16, 8, 4, 2, 1, 1,
64, 32, 16, 8, 4, 2, 1, 1,
Production matrix begins:
1, 1
1, 0, 1
1, 0, 0, 1
1, 0, 0, 0, 1
1, 0, 0, 0, 0, 1
1, 0, 0, 0, 0, 0, 1
1, 0, 0, 0, 0, 0, 0, 1
1, 0, 0, 0, 0, 0, 0, 0, 1
... - _Philippe Deléham_, Oct 04 2014
- Reinhard Zumkeller, Rows n = 1..100 of table, flattened
- Jean-Luc Baril, Javier F. González, and José L. Ramírez, Last symbol distribution in pattern avoiding Catalan words, Univ. Bourgogne (France, 2022).
- Emeric Deutsch, L. Ferrari and S. Rinaldi, Production Matrices and Riordan arrays, arXiv:math/0702638 [math.CO], 2007.
-
a155038 n k = a155038_tabl !! (n-1) !! (k-1)
a155038_row n = a155038_tabl !! (n-1)
a155038_tabl = iterate
(\row -> zipWith (+) (row ++ [0]) (init row ++ [0,1])) [1]
-- Reinhard Zumkeller, Aug 08 2013
-
T := proc(n, k) if k = n then 1 elif k < n then 2^(n-k-1) else 0 end if end proc: for n to 13 do seq(T(n, k), k = 1 .. n) end do; # yields sequence in triangular form - Emeric Deutsch, Jan 12 2018
G:= (1-2*x+t*x^2)/((1-2*x)*(1-t*x)): Gser := simplify(series(G, x = 0, 15)): for n to 14 do P[n] := coeff(Gser, x, n) end do: for n to 14 do seq(coeff(P[n], t, j), j = 1 .. n) end do; # yields sequence in triangular form - Emeric Deutsch, Jan 19 2018
-
nn = 15; a = 1/(1 - y x); f[list_] := Select[list, # > 0 &];Map[f, CoefficientList[Series[ a/(1 - x/(1 - x)), {x, 0, nn}], {x, y}]] // Flatten (* Geoffrey Critzer, Feb 15 2012 *)
A152570
Triangle T(n,k) read by rows: T(n,n) = -1, T(n,0) = 3^(n - 1), T(n,k) = -3^(n - k - 1), 1 <= k <= n - 1.
Original entry on oeis.org
-1, 1, -1, 3, -1, -1, 9, -3, -1, -1, 27, -9, -3, -1, -1, 81, -27, -9, -3, -1, -1, 243, -81, -27, -9, -3, -1, -1, 729, -243, -81, -27, -9, -3, -1, -1, 2187, -729, -243, -81, -27, -9, -3, -1, -1, 6561, -2187, -729, -243, -81, -27, -9, -3, -1, -1, 19683, -6561, -2187
Offset: 0
Triangle begins:
-1;
1, -1;
3, -1, -1;
9, -3, -1, -1;
27, -9, -3, -1, -1;
81, -27, -9, -3, -1, -1;
243, -81, -27, -9, -3, -1, -1;
729, -243, -81, -27, -9, -3, -1, -1;
2187, -729, -243, -81, -27, -9, -3, -1, -1;
6561, -2187, -729, -243, -81, -27, -9, -3, -1, -1;
19683, -6561, -2187, -729, -243, -81, -27, -9, -3, -1, -1;
...
-
b[0] = {-1}; b[1] = {1, -1};
b[n_] := b[n] = Join[{3^(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 3^(n - 1) else -3^(n - k - 1)$
create_list(T(n, k), n, 0, 20, k, 0, n); /* Franck Maminirina Ramaharo, Jan 08 2019 */
A152572
Triangle T(n,k) read by rows: T(n,n) = -1, T(n,0) = 5^(n - 1), T(n,k) = -5^(n - k - 1), 1 <= k <= n - 1.
Original entry on oeis.org
-1, 1, -1, 5, -1, -1, 25, -5, -1, -1, 125, -25, -5, -1, -1, 625, -125, -25, -5, -1, -1, 3125, -625, -125, -25, -5, -1, -1, 15625, -3125, -625, -125, -25, -5, -1, -1, 78125, -15625, -3125, -625, -125, -25, -5, -1, -1, 390625, -78125, -15625, -3125, -625, -125, -25, -5, -1, -1
Offset: 0
Triangle begins:
-1;
1, -1;
5, -1, -1;
25, -5, -1, -1;
125, -25, -5, -1, -1;
625, -125, -25, -5, -1, -1;
3125, -625, -125, -25, -5, -1, -1;
15625, -3125, -625, -125, -25, -5, -1, -1;
78125, -15625, -3125, -625, -125, -25, -5, -1, -1;
390625, -78125, -15625, -3125, -625, -125, -25, -5, -1, -1;
1953125, -390625, -78125, -15625, -3125, -625, -125, -25, -5, -1, -1;
...
-
b[0] = {-1}; b[1] = {1, -1};
b[n_] := b[n] = Join[{5^(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 5^(n - 1) else -5^(n - k - 1);
create_list(T(n, k), n, 0, 20, k, 0, n); /* Franck Maminirina Ramaharo, Jan 08 2019 */
Showing 1-7 of 7 results.
Comments