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.

A161354 Cubes whose reversal is a prime number.

Original entry on oeis.org

125, 125000, 140608, 704969, 1643032, 1815848, 3511808, 3723875, 3869893, 7301384, 9393931, 10360232, 11543176, 14526784, 15069223, 15252992, 15813251, 16777216, 19902511, 34328125, 34645976, 35287552, 70444997, 92345408
Offset: 1

Views

Author

Claudio Meller, Jun 07 2009

Keywords

Examples

			1815848 is a term because it is a cube and 8485181 is a prime.
		

Crossrefs

Programs

  • Maple
    rev := proc (n) local nn: nn := convert(n, base, 10): add(nn[j]*10^(nops(nn)-j), j = 1 .. nops(nn)) end proc: a := proc (n) if isprime(rev(n^3)) = true then n^3 else end if end proc: seq(a(n), n = 1 .. 460); # Emeric Deutsch, Jun 27 2009
  • Mathematica
    Select[Range[500]^3,PrimeQ[IntegerReverse[#]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 03 2019 *)
  • PARI
    lista(nn) = { for(n=1, nn, if(ispseudoprime(eval(concat(Vecrev(Str(n^3))))), print1(n^3, ", ")); ); } \\ Altug Alkan, Dec 20 2015
  • Python
    from sympy import isprime
    A161354_list, i, j = [], 0, 0
    while j < 10**15:
        p = int(str(j)[::-1])
        if isprime(p):
            A161354_list.append(j)
        j += 3*i*(i+1)+1
        i += 1
    A161354_list = sorted(A161354_list) # Chai Wah Wu, Dec 20 2015