login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A323782 Prime numbers such that the reverse of the balanced ternary representation is a prime or a negated prime. 2
2, 5, 7, 11, 13, 17, 29, 31, 37, 43, 53, 59, 61, 71, 73, 83, 89, 101, 103, 137, 139, 149, 163, 173, 179, 181, 193, 199, 223, 233, 241, 263, 269, 277, 311, 313, 331, 347, 353, 367, 373, 379, 383, 389, 401, 421, 443, 449, 457, 467, 479, 487, 499, 509, 541 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

The "warp" operation is an inverse map connecting this sequence and A323783.

LINKS

Table of n, a(n) for n=1..55.

Github, Python code repository

Rosetta Code, Balanced Ternary Code

Wikipedia, Balanced Ternary

EXAMPLE

29 is a term:

29 is +0+- in balanced ternary notation

+0+- reversed is -+0+

-+0+ is -17 in balanced ternary notation

the absolute value of -17 is 17.

17 is prime

Therefore 29 is "warped" to -17.

This operation is reversible: -17 "warps" to 29.

PROG

(Python) See links.

(PARI) d3(n) = if ((n%3)==2, n\3+1, n\3);

m3(n) = if ((n%3)==2, -1, n % 3);

t(n) = if (n==0, [0], if (abs(n) == 1, [n], concat(m3(n), t(d3(n)))));

f(n) = subst(Pol(Vec(t(n))), x, 3);

isok(n) = isprime(n) && isprime(abs(f(n))); \\ Michel Marcus, Jan 29 2019

(PARI) is(n) = {if(!isprime(n), return(0)); my(d = digits(n, 3)); forstep(i = #d, 2, -1, if(d[i] >= 2, d[i] -= 3; d[i-1]++)); if(d[1] >= 2, d[1]-=3; d = concat(1, d)); isprime(abs(fromdigits(Vecrev(d), 3)))} \\ David A. Corneth, Feb 14 2019

CROSSREFS

Cf. A000040, A134028.

Supersequence of A224502.

Corresponding primes and -primes are in sequence A323783.

Primes that don't "warp" to a prime numbers are in sequence A323784.

Sequence in context: A245063 A168033 A257974 * A020591 A197188 A265809

Adjacent sequences:  A323779 A323780 A323781 * A323783 A323784 A323786

KEYWORD

nonn,base

AUTHOR

Philippe Cochin, Jan 27 2019

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 15 13:06 EDT 2019. Contains 328030 sequences. (Running on oeis4.)