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.

A053653 Number of ways to rearrange digits of prime(n)*prime(n+1) to form a prime.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 2, 0, 0, 3, 4, 8, 0, 6, 11, 3, 0, 3, 6, 1, 1, 4, 3, 0, 2, 5, 6, 15, 15, 17, 16, 12, 12, 4, 10, 8, 5, 8, 18, 11, 23, 5, 13, 9, 10, 8, 6, 27, 9, 4, 6, 14, 4, 24, 3, 14, 6, 4, 33, 7, 14, 11, 12, 6, 86, 26, 53, 13, 79, 27, 51, 81, 61, 26, 39, 25, 54, 17, 25
Offset: 1

Views

Author

Enoch Haga, Feb 18 2000

Keywords

Comments

Leading zeros are not allowed in the rearranged number.

Examples

			a(8) = 2 because 19*23 = 437 and 2 primes, 347 and 743, can be formed from the digits of 437.
		

Crossrefs

Programs

  • Mathematica
    nfp[n_]:=With[{id=IntegerDigits[n]},Length[Select[FromDigits/@Permutations[id],IntegerLength[ #] ==IntegerLength[n]&&PrimeQ[#]&]]]; nfp/@Times@@@Partition[Prime[Range[90]],2,1] (* Harvey P. Dale, Aug 29 2024 *)
  • Python
    from sympy import isprime, prime
    from sympy.utilities.iterables import multiset_permutations as mp
    def c(s):
        return sum(1 for t in mp(s) if t[0]!='0' and isprime(int("".join(t))))
    def a(n): return c(str(prime(n)*prime(n+1)))
    print([a(n) for n in range(1, 72)]) # Michael S. Branicky, Dec 22 2021

Extensions

Edited by Jens Kruse Andersen, Dec 01 2006

A053736 Run through primes p; if the digits of p*q (where q is the prime following p) can be rearranged to form one or more primes r, append these primes r to the sequence.

Original entry on oeis.org

53, 431, 233, 347, 743, 1471, 1741, 7411, 1571, 5171, 5711, 7151, 1367, 1637, 3167, 3617, 3671, 3761, 6173, 6317, 1249, 1429, 4129, 4219, 9241, 9421, 1237, 1327, 1723, 2137, 2371, 2713, 2731, 3217, 3271, 7213, 7321, 5399, 5939, 9539
Offset: 1

Views

Author

Enoch Haga, Feb 13 2000

Keywords

Comments

Leading zeros are not allowed in the rearranged number.

Examples

			7*11=77, but no prime rearrangements are possible; 11*13 is 143, whose digits can be rearranged to 431, a prime.
		

References

  • C. A. Pickover, "Vampire numbers," chapter 30 of Keys to Infinity. NY: Wiley, 1995. Pages 227-231

Crossrefs

A053652 gives the entries sorted and with duplicates removed. Cf. A014575, A053652.

Extensions

Corrected and extended by Jens Kruse Andersen, Dec 01 2006
Showing 1-2 of 2 results.