OFFSET
1,1
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..1458
EXAMPLE
A001651(5) = 7 as 7 is the fifth number not divisible by 3. According to the algorithm described in the comment of A053446 we have in the form of a "finite continued fraction"
1 + 14
------ + 7
3^1
---------- + 14
3^1
----------------- + 7
3^2
---------------------- = 1
3^2
Cumulatively multiplying (with A019565) together the prime-numbers corresponding to 1-bits in the binary expansions of the exponents of 3 in the denominators (that are 1, 1, 2, 2, in binary 1, 1, 10, 10, with 1's in bit-positions 0 and 1), yields prime(0+1) * prime(0+1) * prime(1+1) * prime(1+1) = 2^2 * 3^2 = 36, thus a(5) = 36.
(Adapted from Vladimir Shevelev's explanation in A053446.)
Another example: A001651(19) = 28 as 28 is the 19th number not divisible by 3. (1 + 28) is not a multiple of 3, so we start with (1 + 2*28) = 1+56 = 57 and proceed as:
1 + 56
------ + 56 [that is, (57/3) + 56 = 75]
3^1
---------- + 56 [that is, (75/3) + 56 = 81]
3^1
----------------- = 1 [that is, (81/81) = 1]
3^4
So we obtained exponents 1, 1, 4 (in binary "1", "1" and "100") where the 1-bits are in positions 0, 0 and 2. We form a product prime(0+1) * prime(0+1) * prime(2+1) = 2*2*5, thus a(19) = 20.
PROG
(Scheme)
(define (A293445 n) (define (next_one k m) (if (zero? (modulo (+ k m) 3)) (+ k m) (+ k m m))) (let* ((u (A001651 n)) (x_init (next_one 1 u))) (let loop ((x x_init) (z (A019565 (A007949 x_init)))) (let ((r (A038502 x))) (if (= 1 r) z (let ((x_next (next_one r u))) (loop x_next (* z (A019565 (A007949 x_next))))))))))
(define (A001651 n) (let ((x (- n 1))) (if (even? x) (+ 1 (* 3 (/ x 2))) (- (* 3 (/ (+ x 1) 2)) 1))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 09 2017
STATUS
approved