cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A323782 Prime numbers such that the reverse of the balanced ternary representation is a prime or a negated prime.

Original entry on oeis.org

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
Offset: 1

Views

Author

Philippe Cochin, Jan 27 2019

Keywords

Comments

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

Examples

			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.
		

Crossrefs

Supersequence of A224502.
Corresponding primes and -primes are in sequence A323783.
Primes that don't "warp" to a prime numbers are in sequence A323784.

Programs

  • 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
  • Python
    # See links.
    

A323783 a(n) = A134028(A323782(n)): Primes and negated primes such that the reverse of the balanced ternary representation is a prime.

Original entry on oeis.org

-2, -11, 7, -5, 13, -29, -17, 37, 31, 43, -83, -101, 61, -89, 73, -53, -71, -59, 103, -173, 313, -353, 241, -137, -263, 223, 331, 277, 181, -269, 163, -179, -233, 199, -347, 139, 193, -311, -149, 367, 853, 691, -929, -443, -983, 421, -389, -839, 457, -677
Offset: 1

Views

Author

Philippe Cochin, Jan 27 2019

Keywords

Comments

The "warp" operation is reversible between A323782 and this sequence.
Negating a number in balanced ternary notation is done by inverting the + and -.

Examples

			-17 is a term:
-17 is -+0+ in balanced ternary notation
-+0+ reversed is +0+-
+0+- is 29 in balanced ternary notation
29 is prime
Therefore -17 is "warped" to 29.
This operation is reversible: 29 "warps" to -17.
		

Crossrefs

Corresponding warp prime numbers to A323782.
Supersequence of A224502.

Programs

  • 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);
    lista(nn) = {forprime(n=1, nn, if (isprime(abs(f(n))), print1(f(n), ", ")););} \\ Michel Marcus, Jan 29 2019
  • Python
    # See Github link.
    
Showing 1-2 of 2 results.