OFFSET
1,2
COMMENTS
In ternary representation:
- each term has as many 1's as 2's and the set of positions of 1's is the image under A300956 of the set of positions of 2's and vice versa (where the position 0 corresponds to the unit ternary digit),
- the digit at position a(k) of a term is always zero for any k > 0; in particular, as a(1) = 0, all terms are divisible by 3.
To compute a(n):
- consider the sequence of integers k, say f, such that A300956(k) < k,
- the sequence f starts: 2, 9, 10, 11, 17, 18, 19, 20, 23, 24, 25, 26, 19683, ...
- let g(k, t) be defined for k > 0 and t = 0..2 as: g(k, 0) = 0, g(k, 1) = 3^f(k) + 2 * 3^A300956(f(k)), g(k, 2) = 2 * 3^f(k) + 3^A300956(f(k)),
- let Sum_{i = 0..m} t_i * 3^i be the ternary representation of n-1,
- then a(n) = Sum_{i = 0..m} g(i+1, t_i).
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..6561
Rémy Sigrist, PARI program for A300958
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Mar 17 2018
STATUS
approved