OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
If (3^d-1)/2 <= n < (3^(d+1)-1)/2, then a(n+3^d) = a(n) + 6^n, a(n+2*3^d) = a(n) + 2*6^n, and a(n+3^(d+1)) = a(n) + 5*6^n. - Robert Israel, Aug 16 2018
MAPLE
g:= proc(t, d) local L;
L:= convert(3^d+t, base, 3);
add((2*L[i]+1)*6^(i-1), i=1..d);
end proc:
seq(seq(g(t, d), t=0..3^d-1), d=1..4); # Robert Israel, Aug 16 2018
MATHEMATICA
Table[FromDigits[#, 6]&/@Tuples[{1, 3, 5}, n], {n, 4}]//Flatten (* Harvey P. Dale, Dec 24 2022 *)
PROG
(PARI) isok(n) = (n) && (#select(x->((x%2)==0), digits(n, 6)) == 0); \\ Michel Marcus, Aug 17 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved