OFFSET
1,2
LINKS
Malachi de Ælfweald and Charles R Greathouse IV, Table of n, a(n) for n = 1..10000 (first 199 terms from Malachi de Ælfweald)
Wikipedia, Balanced ternary
EXAMPLE
For n=5, a(5)=61 and in balanced ternary notation is 1ī1ī1.
PROG
(PARI)
bt(k, n)={
sum(i=0, (n-1)\2,
my(t=k%3-1);
k\=3;
n--;
if(n==i, 3^n, 3^i+3^n)*t
)
};
do(N)={
my(v=List([1]), t);
for(n=1, N,
forstep(k=2, 3^((n+1)\2)-1, 3,
t=bt(k, n);
if(isprime(t), listput(v, t))
)
);
vecsort(Vec(v))
}; \\ Charles R Greathouse IV, Apr 08 2013
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Malachi de Ælfweald, Apr 08 2013
STATUS
approved