OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
F:= proc(n) local i, j, t;
t:= (3^n-1)/2;
op(sort([seq(seq(t - 3^i + 3^j, i= {$0..j-1, $j+1..n-2}), j=0..n-1)]))
end proc:
map(F, [$2..7]); # Robert Israel, Mar 11 2020
MATHEMATICA
Select[Range[500], DigitCount[#, 3, 0]==DigitCount[#, 3, 2]==1&] (* Harvey P. Dale, Sep 04 2023 *)
PROG
(Python)
from sympy.ntheory import count_digits
def ok(n): d = count_digits(n, 3); return d[0] == 1 and d[2] == 1
print(list(filter(ok, range(500)))) # Michael S. Branicky, Jun 11 2021
CROSSREFS
KEYWORD
AUTHOR
STATUS
approved