OFFSET
1,1
COMMENTS
The "warp" operation is an inverse map connecting this sequence and A323783.
LINKS
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
KEYWORD
nonn,base
AUTHOR
Philippe Cochin, Jan 27 2019
STATUS
approved