|
|
A253887
|
|
Row index of n in A191450: a(3n) = 2n, a(3n+1) = 2n+1, a(3n+2) = a(n+1).
|
|
13
|
|
|
1, 1, 2, 3, 1, 4, 5, 2, 6, 7, 3, 8, 9, 1, 10, 11, 4, 12, 13, 5, 14, 15, 2, 16, 17, 6, 18, 19, 7, 20, 21, 3, 22, 23, 8, 24, 25, 9, 26, 27, 1, 28, 29, 10, 30, 31, 11, 32, 33, 4, 34, 35, 12, 36, 37, 13, 38, 39, 5, 40, 41, 14, 42, 43, 15, 44, 45, 2, 46, 47, 16, 48, 49, 17, 50, 51, 6, 52, 53, 18, 54, 55, 19, 56, 57, 7
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
a(n) gives the row index of n in square array A191450, or equally, the column index of n in A254051.
|
|
LINKS
|
|
|
FORMULA
|
a(3n) = 2n, a(3n+1) = 2n+1, a(3n+2) = a(n+1).
|
|
PROG
|
(Scheme, with memoization-macro definec)
(define (inv_for_A032766 n) (+ (* 2 (floor->exact (/ n 3))) (modulo n 3)))
(Python)
def a(n):
if n%3==0: return 2*n//3
elif n%3==1: return 2*(n - 1)//3 + 1
else: return a((n - 2)//3 + 1)
|
|
CROSSREFS
|
Cf. A254046 (the corresponding column index).
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|