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.

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

This page as a plain text file.
%I A225864 #13 May 24 2024 18:38:57
%S A225864 12,21,115,511,1112,1121,1211,11711,13111,17111,31111,71111,111112,
%T A225864 121111,211111,1111115,1111117,1111171,1111511,1115111,1151111,
%U A225864 1511111,1711111,5111111,7111111,111111115,111111151,111111311,111111511,111115111,111131111,111151111
%N A225864 Composite numbers for which both sum and product of digits are primes.
%H A225864 Chai Wah Wu, <a href="/A225864/b225864.txt">Table of n, a(n) for n = 1..10000</a>
%t A225864 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
%t A225864 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 *)
%o A225864 (Python)
%o A225864 from __future__ import division
%o A225864 from sympy import isprime
%o A225864 A225864_list = []
%o A225864 for l in range(1,20):
%o A225864     plist, q = [p for p in [2,3,5,7] if isprime(l-1+p)], (10**l-1)//9
%o A225864     for i in range(l):
%o A225864         for p in plist:
%o A225864             r = q+(p-1)*10**i
%o A225864             if not isprime(r):
%o A225864                 A225864_list.append(r) # _Chai Wah Wu_, Aug 15 2017
%Y A225864 Cf. A046713, A225863.
%K A225864 nonn,base
%O A225864 1,1
%A A225864 _Jayanta Basu_, May 18 2013
%E A225864 Extended by _T. D. Noe_, May 18 2013