login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A309574 n-th prime minus its ternary (base 3) reversal. 1
0, 2, -2, 2, -8, 0, -8, 8, 0, -26, -6, 6, -26, -6, -14, -26, -6, 14, 26, -6, 38, 26, -80, -128, -48, -80, -24, -128, 24, -80, 24, -80, -32, 24, -56, 0, 24, 80, -24, 0, -48, 80, 24, 80, -24, 104, 80, 80, 48, 104, 0, 24, 80, -398, -338, -278, -434, 18, -138 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
a(n) = 0 if and only if n is palindromic in base 3 - if and only if A000040(n) is in A014190.
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
FORMULA
a(n) = A000040(n) - A030102(A000040(n)).
a(n) = A055947(A000040(n)).
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
Sequence in context: A367857 A121258 A087421 * A132697 A160689 A179976
KEYWORD
sign,base,look
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 06:44 EDT 2024. Contains 371782 sequences. (Running on oeis4.)