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.

Previous Showing 11-16 of 16 results.

A371654 Numbers that are not multiples of 10 and that yield a prime if their digits are arranged in ascending order.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 32, 37, 47, 59, 67, 71, 73, 74, 76, 79, 89, 91, 92, 95, 97, 98, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 157, 167, 172, 173, 175, 176, 179, 193, 194, 197, 199, 203, 209, 217, 223, 227, 229, 232, 233, 239, 257
Offset: 1

Views

Author

César Eliud Lozada, Apr 01 2024

Keywords

Comments

If N is a term then all numbers with the same digits as N are terms too.

Examples

			91 is a term because arranging its digits in ascending order yields 19, which is a prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[500],  Mod[#, 10] != 0 && PrimeQ[FromDigits[Sort[IntegerDigits[#]]]] &]
  • Python
    from sympy import isprime
    def ok(n): return n%10 and isprime(int("".join(sorted(str(n)))))
    print([k for k in range(260) if ok(k)]) # Michael S. Branicky, Apr 01 2024
    
  • Python
    from itertools import count, islice, combinations_with_replacement
    from sympy import isprime
    from sympy.utilities.iterables import multiset_permutations
    def A371654_gen(): # generator of terms
        for l in count(1):
            xlist = []
            for p in combinations_with_replacement('0123456789',l):
                if isprime(int(''.join(p))):
                    xlist.extend(int(''.join(d)) for d in multiset_permutations(p) if d[0] != '0' and d[-1] != '0')
            yield from sorted(xlist)
    A371654_list = list(islice(A371654_gen(),20)) # Chai Wah Wu, Apr 10 2024

A088112 Perfect powers whose digit reversal is prime.

Original entry on oeis.org

16, 32, 125, 128, 196, 361, 784, 1024, 1369, 1444, 1600, 1681, 3844, 7225, 7921, 9025, 9409, 11236, 14161, 18496, 19321, 19600, 36100, 37249, 38416, 70756, 73441, 75076, 76729, 78400, 78961, 97969, 99856, 102400, 105625, 107584, 109561, 111556
Offset: 1

Views

Author

Amarnath Murthy, Sep 25 2003

Keywords

Comments

Conjectures: (1) Sequence is infinite. (2) For every n there are infinitely many members of the form k^n.

Crossrefs

Intersection of A001597 and A095179.

Programs

  • Mathematica
    Select[Range[120000],GCD@@FactorInteger[#][[All,2]]>1 && PrimeQ[ IntegerReverse[ #]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 03 2018 *)

Extensions

Corrected and extended by Ray Chandler, Oct 14 2003
Offset changed by Andrew Howroyd, Sep 22 2024

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

A257636 Numbers n such that the base 10 reversals of n and n+1 are both prime.

Original entry on oeis.org

2, 13, 16, 30, 31, 34, 37, 70, 73, 91, 97, 106, 112, 118, 124, 130, 133, 145, 151, 166, 181, 199, 300, 310, 346, 358, 361, 364, 370, 376, 382, 388, 391, 700, 709, 721, 727, 730, 739, 745, 751, 754, 757, 760, 763, 775, 778, 784, 787, 790, 904, 907, 916, 919
Offset: 1

Views

Author

Robert Israel, Nov 04 2015

Keywords

Comments

n such that n and n+1 are in A095179.
Leading 0's in the reversals are allowed.
Heuristically, the abundance of these numbers should be roughly similar to that of the twin primes. Thus the sequence should be infinite but the sum of the reciprocals should converge.
All terms == 1 (mod 3) except for 2 and 3*10^k where k is in A049054.

Examples

			13 is in the sequence because both 31 and 41 are prime.
		

Crossrefs

Programs

  • Maple
    revdigs:= proc(n) option remember; local x;
       x:= n mod 10;
       x*10^ilog10(n)+revdigs((n-x)/10);
    end proc:
    for i from 0 to 9 do revdigs(i):= i od:
    Rprimes:= select(isprime@revdigs, [$1..10^4]):
    Rprimes[select(t -> Rprimes[t+1]-Rprimes[t]=1, [$1..nops(Rprimes)-1])]; # Robert Israel, Nov 04 2015
  • Mathematica
    SequencePosition[Table[If[PrimeQ[IntegerReverse[n]],1,0],{n,1000}],{1,1}][[;;,1]] (* Harvey P. Dale, Jan 07 2024 *)
  • PARI
    for(n=1, 1e3, if(isprime(eval(concat(Vecrev(Str(n))))) && isprime(eval(concat(Vecrev(Str(n+1))))), print1(n, ", "))) \\ Altug Alkan, Nov 04 2015

A354881 Primes p such that, if q is the next prime, the digit reversal of p*q is prime.

Original entry on oeis.org

5, 31, 37, 41, 53, 103, 197, 263, 277, 337, 349, 353, 359, 373, 397, 401, 421, 431, 439, 547, 569, 587, 599, 857, 859, 863, 877, 883, 983, 1009, 1013, 1039, 1069, 1091, 1097, 1103, 1117, 1129, 1153, 1171, 1193, 1213, 1223, 1237, 1249, 1279, 1291, 1301, 1367, 1811, 1871, 1931, 1979, 2647, 2663
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jul 13 2022

Keywords

Comments

Primes p such that A013636(p) is in A095179.

Examples

			a(3) = 37 is a term because 37 is prime, the next prime is 41, 37*41 = 1517 and its digit reversal 7151 is prime.
		

Crossrefs

Programs

  • Maple
    revdigs:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    P:= [seq(ithprime(i),i=1..1000)]:
    P[select(i -> isprime(revdigs(P[i]*P[i+1])), [$1..999])];
  • Mathematica
    a354881[n_] := Select[Map[Prime, Range[n]], PrimeQ[FromDigits[Reverse[IntegerDigits[# NextPrime[#]]]]]&]
    a354881[390] (* Hartmut F. W. Hoft, Jul 20 2022 *)
    Select[Partition[Prime[Range[400]],2,1],PrimeQ[IntegerReverse[Times@@#]]&][[;;,1]] (* Harvey P. Dale, Feb 10 2024 *)

A272022 Look at the set of numbers obtained by permuting the digits of n in all possible ways, then remove n itself from the set. If the remaining numbers are all primes, then n is in the sequence.

Original entry on oeis.org

13, 14, 16, 17, 20, 30, 31, 32, 34, 35, 37, 38, 50, 70, 71, 73, 74, 76, 79, 91, 92, 95, 97, 98, 110, 113, 118, 119, 131, 133, 199, 311, 337, 373, 733, 772, 775, 778, 779, 919, 991, 1118, 3337, 7771, 77779
Offset: 1

Views

Author

César Eliud Lozada, Apr 18 2016

Keywords

Comments

If it exists, a(46) > 5*10^11. - Lars Blomberg, Mar 31 2018

Examples

			119 is in the sequence because every permutation of its digits excluding 119 (i.e., 191 and 911) is a prime.
11 is not in the sequence, because when 11 is removed from the set, no numbers are left.
		

Crossrefs

Cf. A003459. - Altug Alkan, Apr 18 2016

Programs

  • Maple
    lis := [];
    for n from 1 to 10000 do
      nn := convert(n, base, 10);
      pp := combinat[permute](nn);
      if nops(pp) = 1 then
        next
      end if;
      lOk := true;
      for p in pp do
        if p = nn then
          next: #exclude n
        end if;
        if `not`(isprime(convert(p, base, 10, 10^nops(p))[])) then
          lOk := false; break
        end if
      end do;
      if lOk then
        lis := [op(lis), n]
      end if
    end do:
    lis := lis;
  • Mathematica
    rnapQ[n_]:=Module[{p=Rest[FromDigits/@Permutations[IntegerDigits[ n]]]},If[ Length[p]==0, False, AllTrue[p,PrimeQ]]]; Select[Range[80000],rnapQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jan 24 2019 *)
  • PARI
    isok(n) = {v = []; d = digits(n); for (k=0, (#d)!-1, p = numtoperm(#d, k); dp = vector(#d, j, d[p[j]]); np = subst(Pol(dp), x, 10); v = Set(concat(v, np));); v = setminus(v, Set(n)); if (#v == 0, return (0)); for (k=1, #v, if (!isprime(v[k]), return (0));); return (1);} \\ Michel Marcus, Apr 18 2016
    
  • Python
    from sympy import isprime
    from itertools import count, islice, permutations
    def agen(): yield from (k for k in count(1) if len(set(s:=str(k)))!=1 and all((t:=int("".join(m)))==k or isprime(t) for m in permutations(s)))
    print(list(islice(agen(), 45))) # Michael S. Branicky, Dec 29 2023
Previous Showing 11-16 of 16 results.