[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!)
Search: a006583 -id:a006583
Displaying 1-3 of 3 results found. page 1
     Sort: relevance | references | number | modified | created      Format: long | short | data
A003986 Table T(n,k) = n OR k read by antidiagonals. +10
82
0, 1, 1, 2, 1, 2, 3, 3, 3, 3, 4, 3, 2, 3, 4, 5, 5, 3, 3, 5, 5, 6, 5, 6, 3, 6, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 6, 7, 4, 7, 6, 7, 8, 9, 9, 7, 7, 5, 5, 7, 7, 9, 9, 10, 9, 10, 7, 6, 5, 6, 7, 10, 9, 10, 11, 11, 11, 11, 7, 7, 7, 7, 11, 11, 11, 11, 12, 11, 10, 11, 12, 7, 6, 7, 12, 11, 10, 11, 12, 13, 13, 11 (list; table; graph; refs; listen; history; text; internal format)
OFFSET
0,4
LINKS
FORMULA
T(x,y) = T(y,x) = A080098(x,y). - R. J. Mathar, May 28 2011
EXAMPLE
The upper left corner of the array starts in row x=0 with columns y>=0 as:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...
1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, ...
2, 3, 2, 3, 6, 7, 6, 7, 10, 11, 10, 11, 14, ...
3, 3, 3, 3, 7, 7, 7, 7, 11, 11, 11, 11, 15, ...
4, 5, 6, 7, 4, 5, 6, 7, 12, 13, 14, 15, 12, ...
5, 5, 7, 7, 5, 5, 7, 7, 13, 13, 15, 15, 13, ...
6, 7, 6, 7, 6, 7, 6, 7, 14, 15, 14, 15, 14, ...
7, 7, 7, 7, 7, 7, 7, 7, 15, 15, 15, 15, 15, ...
8, 9, 10, 11, 12, 13, 14, 15, 8, 9, 10, 11, 12, ...
9, 9, 11, 11, 13, 13, 15, 15, 9, 9, 11, 11, 13, ...
10, 11, 10, 11, 14, 15, 14, 15, 10, 11, 10, 11, 14, ...
MAPLE
read("transforms") ;
A003986 := proc(x, y) ORnos(x, y) ; end proc:
for d from 0 to 12 do for x from 0 to d do printf("%d, ", A003986(x, d-x)) ; end do: end do: # R. J. Mathar, May 28 2011
MATHEMATICA
Table[BitOr[k, n - k], {n, 0, 20}, {k, 0, n}] //Flatten (* Indranil Ghosh, Apr 01 2017 *)
PROG
(Haskell)
import Data.Bits ((.|.))
a003986 n k = (n - k) .|. k :: Int
a003986_row n = map (a003986 n) [0..n]
a003986_tabl = map a003986_row [0..]
-- Reinhard Zumkeller, Aug 05 2014
(PARI)
tabl(nn) = {for(n=0, nn, for(k=0, n, print1(bitor(k, n - k), ", "); ); print(); ); };
tabl(20) \\ Indranil Ghosh, Apr 01 2017
(Python)
for n in range(21):
print([k|(n - k) for k in range(n + 1)])
# Indranil Ghosh, Apr 01 2017
(C)
#include <stdio.h>
int main()
{
int n, k;
for (n=0; n<=20; n++){
for(k=0; k<=n; k++){
printf("%d, ", (k|(n - k)));
}
printf("\n");
}
return 0;
} /* Indranil Ghosh, Apr 01 2017 */
CROSSREFS
Cf. A003987 (XOR) and A004198 (AND). Cf. also A075173, A075175.
Antidiagonal sums are in A006583.
KEYWORD
tabl,nonn,look
AUTHOR
EXTENSIONS
Name edited by Michel Marcus, Jan 17 2023
STATUS
approved
A328566 a(n) is the sum of the elements of the set O_n = {(n-k) OR k, k = 0..n} (where OR denotes the bitwise OR operator). +10
4
0, 0, 1, 3, 3, 9, 8, 14, 7, 25, 21, 37, 18, 46, 31, 45, 15, 65, 54, 96, 45, 119, 79, 115, 38, 130, 97, 159, 65, 155, 94, 124, 31, 161, 135, 243, 112, 304, 199, 289, 93, 331, 246, 404, 163, 393, 237, 313, 78, 338, 267, 461, 199, 517, 326, 456, 133, 443, 317, 505 (list; graph; refs; listen; history; text; internal format)
OFFSET
-1,4
COMMENTS
The number of elements of the set O_n appears to be A002487(n+1); a(-1) = 0 as O_{-1} is the empty set.
Row sums of A326820.
LINKS
FORMULA
a(n) <= n + A006583(n) for n >= 2.
MAPLE
a:= n-> add(i, i={seq(Bits[Or](n-k, k), k=0..n)}):
seq(a(n), n=-1..80); # Alois P. Heinz, Oct 20 2019
PROG
(PARI) a(n) = vecsum(Set(apply(k -> bitor(k, n-k), [0..n])))
(Python)
def A328566(n): return sum(set(k|n-k for k in range((n>>1)+1))) # Chai Wah Wu, May 07 2023
CROSSREFS
Cf. A328564 (AND variant), A328565 (XOR variant).
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Oct 20 2019
STATUS
approved
A099027 a(n) = Sum_{k=0..n} n-k AND NOT k. +10
2
0, 1, 2, 6, 6, 11, 16, 28, 24, 29, 34, 50, 54, 71, 88, 120, 104, 105, 106, 126, 126, 147, 168, 212, 208, 229, 250, 298, 318, 367, 416, 496, 448, 433, 418, 438, 422, 443, 464, 524, 504, 525, 546, 610, 630, 695, 760, 872, 840, 857, 874, 942, 958, 1027, 1096 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
Antidiagonal sums of array A099026.
LINKS
Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Identities and periodic oscillations of divide-and-conquer recurrences splitting at half, arXiv:2210.10968 [cs.DS], 2022, p. 39.
FORMULA
Recurrence: a(0) = 0, a(2n) = 2a(n) + 2a(n-1), a(2n+1) = 4a(n) + n+1. [corrected by Peter J. Taylor, May 30 2024]
PROG
(PARI) a(n) = sum(k=0, n, bitand(n-k, bitneg(k))); \\ Michel Marcus, Oct 30 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Ralf Stephan, Sep 26 2004
STATUS
approved
page 1

Search completed in 0.008 seconds

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 18:55 EDT 2024. Contains 375518 sequences. (Running on oeis4.)