OFFSET
1,1
COMMENTS
The even values in A026177 are A026177(3n) = 2n or 6n, and A026177(3n+2) = 6n+4. The odd values are A026177(3n+1) = 2n+1. So a(2n) = A026177(3n)/2 and a(2n+1) = A026177(3n+2)/2. The latter is always the "small" case in A026177. The former is A026177(3n) big or small according to the lowest non-0 ternary digit of 3n, and consequently the formula below for a(n). - Kevin Ryde, Feb 29 2020
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
FORMULA
From Kevin Ryde, Feb 29 2020: (Start)
a(n) = n/2 if n even and A060236(n)=2, otherwise a(n) = ceiling(3n/2), where A060236(n) is the lowest non-0 ternary digit of n.
a(n) = A026177(ceiling(3n/2))/2.
(End)
PROG
(PARI) a(n) = if(n%2 || (n/3^valuation(n, 3))%3==1, ceil(3*n/2), n/2); \\ Kevin Ryde, Feb 29 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved