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-4 of 4 results.

A007488 Primes whose reversal is a square.

Original entry on oeis.org

61, 163, 487, 691, 1297, 1861, 4201, 4441, 4483, 5209, 5227, 9049, 9631, 12391, 14437, 16141, 16987, 61483, 63211, 65707, 65899, 67057, 69481, 92767, 94273, 96979, 106303, 108061, 123031, 123373, 125329, 127291, 129643, 142771, 146857, 148249, 165901
Offset: 1

Views

Author

Keywords

Comments

Number of terms less than 10^k: 0, 0, 1, 4, 13, 26, 74, 213, 615, 1773, 5000, 14356, 41474, 120186, 352310, 1035235, ... - Muniru A Asiru, Jan 19 2018 and David A. Corneth, Jan 12 2019

Examples

			61 is in the sequence because 16 = 4^2.
163 is in the sequence because 361 = 19^2.
167 is not in the sequence because 761 is also prime, not a square.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 113.
  • Charles W. Trigg, Primes with Reverses That Are Powers, J. Rec. Math., 17 (1985), 172-176.

Crossrefs

Cf. A059007, A068989. See A132388 for another version.
Primes whose reversal is a k-th power: A057699 (k=3), A058996 (k=4), A059000 (k=5), A059001 (k=6), A059002 (k=7), A059003 (k=8), A350363 (k=9), A059005 (k=10).

Programs

  • Magma
    [p: p in PrimesUpTo(150000)|IsSquare(Seqint(Reverse(Intseq(p))))];// Marius A. Burtea, Jan 12 2019
  • Maple
    revdigs:= proc(n)
    local L,nL,j;
    L:= convert(n,base,10);
    nL:= nops(L);
    add(L[i]*10^(nL-i),i=1..nL);
    end:
    map(proc(i) local r; r:= revdigs(i^2); if isprime(r) then r else NULL fi end proc, {$1..9999}); # Robert Israel, Aug 14 2014
  • Mathematica
    Select[Prime[Range[16000]], IntegerQ[Sqrt[ToExpression[StringReverse[ToString[#]]]]] &]
    Select[Prime[Range[16000]], IntegerQ[Sqrt[FromDigits[ Reverse[ IntegerDigits[ #]]]]] &] (* Harvey P. Dale, Jul 19 2011 *)
    Select[Prime@ Range[10^5], IntegerQ@ Sqrt@ IntegerReverse@ # &] (* Michael De Vlieger, Jan 20 2018 *)
  • PARI
    is(n)=isprime(n) && issquare(fromdigits(Vecrev(digits(n)))) \\ Charles R Greathouse IV, Feb 06 2017
    
  • PARI
    uptoQdigits(n) = {my(res=List(), i2); for(i=4, sqrtint(10^n), i2 = i^2; if(i%10!=0 && gcd(10, i2 \ (10^logint(i2, 10))) == 1, c=fromdigits(Vecrev(digits(i2))); if(isprime(c), listput(res,c) ) ) ); listsort(res); res } \\ David A. Corneth, Jan 12 2019
    
  • Python
    from gmpy2 import is_square
    from sympy import prime
    A007488 = [prime(n) for n in range(1,10**6) if is_square(int(str(prime(n))[::-1]))] # Chai Wah Wu, Aug 14 2014
    

A350441 Numbers m such that 4^m reversed is prime.

Original entry on oeis.org

2, 5, 12, 35, 75, 182, 828, 1002, 1063, 2168, 6345, 6920, 10054, 14444, 51465
Offset: 1

Views

Author

Mohammed Yaseen, Dec 31 2021

Keywords

Comments

From Bernard Schott, Jan 30 2022: (Start)
If m is a term, then u = 2*m is a term of A057708, because 4^m = 2^(2*m). In fact, terms of this sequence here are half the even terms of A057708.
If m is a term that is multiple of 3, then k = 2*m/3 is a term of A350442, because 4^m = 8^(2m/3). First examples: m = 12, 75, 828, 1002, 6345, 51465, ... and corresponding k = 8, 50, 552, 668, 4230, 34310, ... (End)

Crossrefs

Cf. Numbers m such that k^m reversed is prime: A057708 (k=2), this sequence (k=4), A058993 (k=5), A058994 (k=7), A350442 (k=8), A058995 (k=13).

Programs

  • Mathematica
    Select[Range[2200], PrimeQ[IntegerReverse[4^#]] &] (* Amiram Eldar, Dec 31 2021 *)
  • PARI
    isok(m) = isprime(fromdigits(Vecrev(digits(4^m))))
    
  • Python
    from sympy import isprime
    m = 4
    for n in range (1, 2000):
        if isprime(int(str(m)[::-1])):
            print(n)
        m *= 4

Extensions

a(11)-a(15) from Amiram Eldar, Dec 31 2021

A350363 Primes whose reversal is a ninth power.

Original entry on oeis.org

23888027348153, 17571893445665616311, 3627487775963728773631, 5213075488148035940813, 232364835105859429802371, 1648344985192619771689693, 6522990445513252220198849, 6771520922071318266744521, 23295376285906990980268061, 29758574646480445207299379
Offset: 1

Views

Author

Mohammed Yaseen, Dec 27 2021

Keywords

Crossrefs

Primes whose reversal is a k-th power: A007488 (k=2), A057699 (k=3), A058996 (k=4), A059000 (k=5), A059001 (k=6), A059002 (k=7), A059003 (k=8), A059005 (k=10).

Programs

  • Mathematica
    Union[(i=IntegerReverse)@Select[Range@1000^9,PrimeQ@i@#&]] (* Giorgos Kalogeropoulos, Jan 04 2022 *)
    Select[IntegerReverse/@(Range[1000]^9),PrimeQ]//Union (* Harvey P. Dale, Nov 27 2024 *)
  • PARI
    flip(n)=fromdigits(Vecrev(digits(n))) \\ A004086
    Set(select(isprime, vector(1000, n, flip(n^9)))) \\ adapted from A057699
    
  • Python
    from sympy import isprime
    flip9 = (int(str(k**9)[::-1]) for k in range(1, 1000) if k%10)
    print(sorted(filter(isprime, flip9))) # Michael S. Branicky, Jan 02 2022

A253912 Fourth powers whose reversal is a prime.

Original entry on oeis.org

16, 38416, 130321, 160000, 923521, 1500625, 13845841, 14776336, 16777216, 38950081, 163047361, 181063936, 312900721, 322417936, 384160000, 937890625, 1303210000, 1600000000, 3722098081, 7992538801, 9235210000, 13841287201, 15006250000, 16610312161, 17748900625, 31414372081, 37141383841
Offset: 1

Views

Author

Rabii Younès, Jan 18 2015

Keywords

Comments

Intersection of A000583 and A095179.
As the last digits of primes are not even or 5 (except for primes 2 and 5), the terms do not start with an even number or 5. If m is an integer such that the reversal of m^4 is prime and sqrt4(n) is the fourth root of n then m is not of the form [sqrt4(2 * 10^k), sqrt4(3 * 10^k)] or [sqrt4(4 * 10^k), sqrt4(7 * 10^k)] for nonnegative k etc. - David A. Corneth, Jun 02 2016
All terms == 1 mod 3. - Robert Israel, Jun 03 2016

Examples

			Example: a(1) = 16 is a fourth power because 16 = 2^4 and the reverse of 16 is 61 which is a prime number.
		

Crossrefs

Cf. A000583 (fourth power), A095179 (reversal of n is prime).
Cf. A058996 (primes whose reversal is a fourth power).

Programs

  • Mathematica
    Select[Range[440]^4, PrimeQ[FromDigits@ Reverse@ IntegerDigits@ #] &] (* Michael De Vlieger, Jan 19 2015 *)
  • Python
    from sympy import isprime
    A253912_list = [n for n in (i**4 for i in range(10**6)) if isprime(int(str(n)[::-1]))] # Chai Wah Wu, Jun 02 2016
Showing 1-4 of 4 results.