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

A225864 Composite numbers for which both sum and product of digits are primes.

Original entry on oeis.org

12, 21, 115, 511, 1112, 1121, 1211, 11711, 13111, 17111, 31111, 71111, 111112, 121111, 211111, 1111115, 1111117, 1111171, 1111511, 1115111, 1151111, 1511111, 1711111, 5111111, 7111111, 111111115, 111111151, 111111311, 111111511, 111115111, 111131111, 111151111
Offset: 1

Views

Author

Jayanta Basu, May 18 2013

Keywords

Crossrefs

Programs

  • Mathematica
    d[n_] := IntegerDigits[n]; t={}; Do[If[!PrimeQ[n] && PrimeQ[Plus@@(x=d[n])] && PrimeQ[Times@@x], AppendTo[t,n]], {n,2*10^6}]; t
    Select[Range[72*10^5],CompositeQ[#]&&AllTrue[{Total[IntegerDigits[#]],Times@@ IntegerDigits[ #]},PrimeQ]&] (* The program generates the first 25 terms of the sequence. *) (* Harvey P. Dale, May 24 2024 *)
  • Python
    from _future_ import division
    from sympy import isprime
    A225864_list = []
    for l in range(1,20):
        plist, q = [p for p in [2,3,5,7] if isprime(l-1+p)], (10**l-1)//9
        for i in range(l):
            for p in plist:
                r = q+(p-1)*10**i
                if not isprime(r):
                    A225864_list.append(r) # Chai Wah Wu, Aug 15 2017

Extensions

Extended by T. D. Noe, May 18 2013
Showing 1-1 of 1 results.