Search: a103582 -id:a103582
|
|
A103583
|
|
Same as A103582, but read antidiagonals in upward direction.
|
|
+20
6
|
|
|
1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
|
|
LINKS
|
David Applegate, Benoit Cloitre, Philippe Deléham and N. J. A. Sloane, Sloping binary numbers: a new sequence related to the binary numbers [pdf, ps].
|
|
MATHEMATICA
|
t = Table[ Take[ Flatten[ Table[ Join[ Table[1, {i, n}], Table[0, {i, n}]], {10}]], 15], {n, 15}]; Flatten[ Table[ t[[n - i + 1, i]], {n, 14}, {i, n}]] (* Robert G. Wilson v, Mar 24 2005 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|
|
|
|
0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
Comment from Jared Benjamin Ricks (jaredricks(AT)yahoo.com), Jan 31 2009: (Start)
This sequence be also be obtained in the following way. Write numbers in binary from left to right and read the resulting array by antidiagonals upwards:
0 : (0, 0, 0, 0, 0, 0, 0, ...)
1 : (1, 0, 0, 0, 0, 0, 0, ...)
2 : (0, 1, 0, 0, 0, 0, 0, ...)
3 : (1, 1, 0, 0, 0, 0, 0, ...)
4 : (0, 0, 1, 0, 0, 0, 0, ...)
5 : (1, 0, 1, 0, 0, 0, 0, ...)
6 : (0, 1, 1, 0, 0, 0, 0, ...)
7 : (1, 1, 1, 0, 0, 0, 0, ...)
... (End)
|
|
LINKS
|
David Applegate, Benoit Cloitre, Philippe Deléham and N. J. A. Sloane, Sloping binary numbers: a new sequence related to the binary numbers [pdf, ps].
|
|
EXAMPLE
|
Triangle begins:
0
1 0
0 0 0
1 1 0 0
0 1 0 0 0
1 0 0 0 0 0
0 0 1 0 0 0 0
1 1 1 0 0 0 0 0
0 1 1 0 0 0 0 0 0
1 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0
1 1 0 1 0 0 0 0 0 0 0 0
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|
|
A102370
|
|
"Sloping binary numbers": write numbers in binary under each other (right-justified), read diagonals in upward direction, convert to decimal.
|
|
+10
72
|
|
|
0, 3, 6, 5, 4, 15, 10, 9, 8, 11, 14, 13, 28, 23, 18, 17, 16, 19, 22, 21, 20, 31, 26, 25, 24, 27, 30, 61, 44, 39, 34, 33, 32, 35, 38, 37, 36, 47, 42, 41, 40, 43, 46, 45, 60, 55, 50, 49, 48, 51, 54, 53, 52, 63, 58, 57, 56, 59, 126, 93, 76, 71, 66, 65, 64, 67, 70, 69
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
All terms are distinct, but certain terms (see A102371) are missing. But see A103122.
Trajectory of 1 is 1, 3, 5, 15, 17, 19, 21, 31, 33, ..., see A103192.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = n + Sum_{ k >= 1 such that n + k == 0 mod 2^k } 2^k. (Cf. A103185.) In particular, a(n) >= n. - N. J. A. Sloane, Mar 18 2005
|
|
EXAMPLE
|
........0
........1
.......10
.......11
......100
......101
......110
......111
.....1000
.........
The upward-sloping diagonals are:
0
11
110
101
100
1111
1010
.......
giving 0, 3, 6, 5, 4, 15, 10, ...
The sequence has a natural decomposition into blocks (see the paper): 0; 3; 6, 5, 4; 15, 10, 9, 8, 11, 14, 13; 28, 23, 18, 17, 16, 19, 22, 21, 20, 31, 26, 25, 24, 27, 30; 61, ...
Reading the array of binary numbers along diagonals with slope 1 gives this sequence, slope 2 gives A105085, slope 0 gives A001477 and slope -1 gives A105033.
|
|
MAPLE
|
A102370:=proc(n) local t1, l; t1:=n; for l from 1 to n do if n+l mod 2^l = 0 then t1:=t1+2^l; fi; od: t1; end;
|
|
MATHEMATICA
|
f[n_] := Block[{k = 1, s = 0, l = Max[2, Floor[Log[2, n + 1] + 2]]}, While[k < l, If[ Mod[n + k, 2^k] == 0, s = s + 2^k]; k++ ]; s]; Table[ f[n] + n, {n, 0, 71}] (* Robert G. Wilson v, Mar 21 2005 *)
|
|
PROG
|
(PARI) A102370(n)=n-1+sum(k=0, ceil(log(n+1)/log(2)), if((n+k)%2^k, 0, 2^k)) \\ Benoit Cloitre, Mar 20 2005
(PARI) {a(n) = if( n<1, 0, sum( k=0, length( binary( n)), bitand( n + k, 2^k)))} /* Michael Somos, Mar 26 2012 */
(Haskell)
a102370 n = a102370_list !! n
a102370_list = 0 : map (a105027 . toInteger) a062289_list
(Python)
def a(n): return 0 if n<1 else sum([(n + k)&(2**k) for k in range(len(bin(n)[2:]) + 1)]) # Indranil Ghosh, May 03 2017
|
|
CROSSREFS
|
Related sequences (1): A103542 (binary version), A102371 (complement), A103185, A103528, A103529, A103530, A103318, A034797, A103543, A103581, A103582, A103583.
Related sequences (2): A103584, A103585, A103586, A103587, A103127, A103192 (trajectory of 1), A103122, A103588, A103589, A103202 (sorted), A103205 (base 10 version).
Related sequences (3): A103747 (trajectory of 2), A103621, A103745, A103615, A103842, A103863, A104234, A104235, A103813, A105023, A105024, A105025, A105026, A105027, A105028.
Related sequences (5): A105229, A105271, A104378, A104401, A104403, A104489, A104490, A104853, A104893, A104894, A105085.
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|
|
|
|
1, 2, 7, 12, 29, 62, 123, 248, 505, 1018, 2047, 4084, 8181, 16374, 32755, 65520, 131057, 262130, 524279, 1048572, 2097133, 4194286, 8388587, 16777192, 33554409, 67108842, 134217711, 268435428, 536870885
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Indices of negative numbers in A103122.
Write numbers in binary under each other; start at 2^k, read in upward direction with the first bit omitted and convert to decimal:
. . . . . . . . . . 0
. . . . . . . . . . 1
.. . . . . . . . . 10 < -- Starting here, the upward diagonal (first bit omitted) reads 1 -> 1
.. . . . . . . . . 11
. . . . . . . . . 100 < -- Starting here, the upward diagonal (first bit omitted) reads 10 -> 2
. . . . . . . . . 101
. . . . . . . . . 110
. . . . . . . . . 111
.. . . . . . . . 1000 < -- Starting here, the upward diagonal (first bit omitted) reads 111 -> 7
. . . . . . . . .1001
Thus a(n) = A102370(2^n - n) - 2^n.
|
|
LINKS
|
David Applegate, Benoit Cloitre, Philippe Deléham and N. J. A. Sloane, Sloping binary numbers: a new sequence related to the binary numbers [pdf, ps].
|
|
FORMULA
|
a(2^k + k) -a(k) = 2^(2^k + k) - 2^k, with k>= 1.
a(1)=1, for n>1, a(n) = a(n-1) XOR (a(n-1) + n), where XOR is the bitwise exclusive-or operator. - Alex Ratushnyak, Apr 21 2012
|
|
MAPLE
|
A102371:= proc (n) local t1, l; t1 := -n; for l to n do if `mod`(n-l, 2^l) = 0 then t1 := t1+2^l end if end do; t1 end proc;
|
|
PROG
|
(Python)
a=1
for n in range(2, 66):
print(a, end=", ")
a ^= a+n
(Haskell)
a102371 n = a102371_list !! (n-1)
a102371_list = map (a105027 . toInteger) $ tail a000225_list
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|
|
|
|
1, 10, 111, 1100, 11101, 111110, 1111011, 11111000, 111111001, 1111111010, 11111111111, 111111110100, 1111111110101, 11111111110110, 111111111110011, 1111111111110000, 11111111111110001, 111111111111110010
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
|
|
LINKS
|
David Applegate, Benoit Cloitre, Philippe Deléham and N. J. A. Sloane, Sloping binary numbers: a new sequence related to the binary numbers [pdf, ps].
|
|
FORMULA
|
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|
|
|
|
0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
LINKS
|
David Applegate, Benoit Cloitre, Philippe Deléham and N. J. A. Sloane, Sloping binary numbers: a new sequence related to the binary numbers [pdf, ps].
|
|
EXAMPLE
|
Triangle begins:
0
0 1
0 0 0
0 0 1 1
0 0 0 1 0
0 0 0 0 0 1
0 0 0 0 1 0 0
0 0 0 0 0 1 1 1
0 0 0 0 0 0 1 1 0
0 0 0 0 0 0 0 1 0 1
0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0 1 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|
|
|
|
1, 1, 3, 2, 4, 5, 6, 5, 7, 8, 11, 9, 11, 12, 13, 12, 14, 15, 18, 18, 19, 20, 21, 20, 22, 23, 26, 24, 26, 27, 28, 27, 29, 30, 33, 33, 36, 36, 37, 36, 38, 39, 42, 40, 42, 43, 44, 43, 45, 46, 49, 49, 50, 51, 52, 51, 53, 54, 57, 55, 57, 58, 59, 58, 60, 61, 64, 64, 67, 69, 69, 68, 70
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
A089398(n) = n-th column sum of binary digits of k*2^(k-1), where summation is over all k>=1, without carrying from columns sums that may exceed 2.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = n/2+1/2*sum(k=1, n, (-1)^floor((n-k)/2^(k-1))). - Benoit Cloitre, Mar 28 2005
Let a(0)=0; when n - 2^[log_2(n)] <= [log_2(n)] then a(n) = a(n - 2^[log_2(n)]) + n - [log_2(n)], else a(n) = a(n - 2^[log_2(n)]) + 2^[log_2(n)] - 1. Thus a(2^m) = 2^m - m for all m>=0; for 0<=k<=m: a(2^m + k) = a(k) + 2^m + k - m; for m<k<=2^m: a(2^m + k) = a(k) + 2^m - 1. - Paul D. Hanna, Mar 28 2005
|
|
EXAMPLE
|
a(6)=5 since 7 - A089398(2^7 + 6) = 7 - 2 = 5.
|
|
MATHEMATICA
|
f[n_] := Block[{lg = Floor[Log[2, n]] + 1}, Sum[ Join[ Reverse[ IntegerDigits[n - i + 1, 2]], {0}][[i]], {i, lg}]]; Table[n - f[2^n + n] + 2, {n, 0, 72}] (* Robert G. Wilson v, Mar 29 2005 *)
|
|
PROG
|
(PARI) a(n)=n/2+1/2*sum(k=1, n, (-1)^floor((n-k)/2^(k-1))) \\ Benoit Cloitre
(PARI) {a(n)=if(n<=0, 0, m=floor(log(n)/log(2)); if(n-2^m<=m, n-m+a(n-2^m), 2^m-1+a(n-2^m)))} \\ Paul D. Hanna, Mar 28 2005
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|
|
A103842
|
|
Triangle read by rows: row n is binary expansion of 2^n-n, n >= 1.
|
|
+10
1
|
|
|
1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
This sequence can also be obtained by reading (from bottom to top, column by column) the array given in A103582 after suppressing the terms below the main diagonal.
|
|
LINKS
|
David Applegate, Benoit Cloitre, Philippe Deléham and N. J. A. Sloane, Sloping binary numbers: a new sequence related to the binary numbers [pdf, ps].
|
|
EXAMPLE
|
Table begins:
1
1 0
1 0 1
1 1 0 0
1 1 0 1 1
1 1 1 0 1 0
1 1 1 1 0 0 1
|
|
MAPLE
|
p:=proc(n) local A, j, b: A:=convert(2^n-n, base, 2): for j from 1 to nops(A) do b:=j->A[nops(A)+1-j] od: seq(b(j), j=1..nops(A)): end: for n from 1 to 15 do p(n) od; # yields sequence in triangular form # Emeric Deutsch, Apr 16 2005
|
|
MATHEMATICA
|
Table[IntegerDigits[2^n-n, 2], {n, 20}]//Flatten (* Harvey P. Dale, Feb 06 2022 *)
|
|
PROG
|
(PARI) tabl(nn) = for (n=1, nn, print(binary(2^n-n))); \\ Michel Marcus, Mar 01 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
Search completed in 0.059 seconds
|