OFFSET
0,4
LINKS
EXAMPLE
The top left [0 .. 16] x [0 .. 19] section of the array:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
0, 1, 4, 2, 6, 8, 3, 7, 10, 12, 15, 11, 5, 13, 16, 14, 18, 20, 23, 19
0, 1, 3, 2, 9, 8, 5, 4, 13, 12, 17, 16, 7, 6, 15, 14, 21, 20, 25, 24
0, 1, 3, 2, 9, 5, 4, 6, 13, 17, 16, 18, 10, 8, 15, 7, 21, 25, 24, 26
0, 1, 3, 2, 6, 7, 4, 5, 18, 19, 16, 17, 10, 11, 8, 9, 26, 27, 24, 25
0, 1, 3, 2, 8, 6, 4, 5, 20, 18, 9, 17, 7, 11, 10, 12, 28, 26, 33, 25
0, 1, 3, 2, 7, 6, 4, 5, 19, 18, 11, 10, 9, 8, 13, 12, 27, 26, 35, 34
0, 1, 3, 2, 7, 6, 4, 5, 19, 11, 14, 12, 8, 10, 13, 9, 27, 35, 38, 36
0, 1, 3, 2, 7, 6, 4, 5, 12, 13, 14, 15, 8, 9, 10, 11, 36, 37, 38, 39
0, 1, 3, 2, 7, 6, 4, 5, 14, 16, 11, 15, 8, 9, 12, 10, 38, 40, 35, 39
0, 1, 3, 2, 7, 6, 4, 5, 17, 16, 13, 12, 8, 9, 11, 10, 41, 40, 37, 36
0, 1, 3, 2, 7, 6, 4, 5, 17, 13, 12, 14, 8, 9, 11, 10, 41, 37, 36, 38
0, 1, 3, 2, 7, 6, 4, 5, 14, 15, 12, 13, 8, 9, 11, 10, 38, 39, 36, 37
0, 1, 3, 2, 7, 6, 4, 5, 16, 14, 12, 13, 8, 9, 11, 10, 40, 38, 21, 37
0, 1, 3, 2, 7, 6, 4, 5, 15, 14, 12, 13, 8, 9, 11, 10, 39, 38, 23, 22
0, 1, 3, 2, 7, 6, 4, 5, 15, 14, 12, 13, 8, 9, 11, 10, 39, 23, 26, 24
0, 1, 3, 2, 7, 6, 4, 5, 15, 14, 12, 13, 8, 9, 11, 10, 24, 25, 26, 27
PROG
(Scheme)
(define (A268830 n) (A268830bi (A002262 n) (A025581 n))) ;; o=0: Square array of shifted powers of A268718.
(define (A268830bi row col) (cond ((zero? row) col) ((zero? col) 0) (else (+ 1 (A268830bi (- row 1) (- (A268718 col) 1))))))
(define (A268830bi row col) (cond ((zero? row) col) ((zero? col) 0) (else (+ 1 (A268830bi (- row 1) (A003188 (+ -1 (A006068 col))))))))
(Python)
def a003188(n): return n^(n>>1)
def a006068(n):
s=1
while True:
ns=n>>s
if ns==0: break
n=n^ns
s<<=1
return n
def a278618(n): return 0 if n==0 else 1 + a003188(a006068(n) - 1)
def A(r, c): return c if r==0 else 0 if c==0 else 1 + A(r - 1, a278618(c) - 1)
for r in range(21): print([A(c, r - c) for c in range(r + 1)]) # Indranil Ghosh, Jun 07 2017
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, Feb 14 2016
STATUS
approved