OFFSET
1,2
COMMENTS
As it occurs in its binary cousin, we observe that a scatter plot of this sequence shows parallelograms.
All terms are even. - Alois P. Heinz, Aug 08 2019
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Samuel M. A. Luque, C++ Program (.cpp file) to generate this sequence in whichever m-th base you choose.
Samuel M. A. Luque, Scatter plot of a(n) up to n = 8132 (primes up to 50 000).
MAPLE
a:= n-> (p-> p-(l->add(l[-i]*3^(i-1), i=1..nops(l))
)(convert(p, base, 3)))(ithprime(n)):
seq(a(n), n=1..61); # Alois P. Heinz, Aug 08 2019
MATHEMATICA
(# - IntegerReverse[#, 3]) &@ Prime@ Range@ 60 (* Giovanni Resta, Aug 09 2019 *)
PROG
(Python)
from sympy import primerange
def rev(n, b):
m = 0
while n > 0:
m, n = m*b+n%b, n//b
return m
n, aa = 1, 1
while n <20:
if aa in primerange(1, 200):
print(n, aa-rev(aa, 3))
n = n+1
aa = aa+1 # A.H.M. Smeets, Aug 09 2019
(PARI) a(n) = my(p=prime(n)); p - fromdigits(Vecrev(digits(p, 3)), 3); \\ Michel Marcus, Aug 09 2019
CROSSREFS
KEYWORD
AUTHOR
Samuel M. A. Luque Astorga, Aug 08 2019
STATUS
approved