OFFSET
0,3
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..10000 (terms 0..1000 from Clark Kimberling)
FORMULA
a(n) = 3*a(n/4) if n == 0 (mod 4); otherwise a(n) = a(n-1)+1.
MATHEMATICA
t = Table[FromDigits[RealDigits[n, 4], 3], {n, 0, 100}]
PROG
(PARI) a(n) = fromdigits(digits(n, 4), 3); \\ Michel Marcus, May 02 2018
(Julia)
function a(n)
m, r, b = n, 0, 1
while m > 0
m, q = divrem(m, 4)
r += b * q
b *= 3
end
r end; [a(n) for n in 0:70] |> println # Peter Luschny, Jan 03 2021
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Clark Kimberling, Aug 03 2012
STATUS
approved