OFFSET
1,1
COMMENTS
Primitive sequence of A344825.
LINKS
David A. Corneth, Table of n, a(n) for n = 1..29793 (terms <= 10^15)
EXAMPLE
49 is in the sequence as its product of digits is 36 which is a perfect square > 0 and its sum of digits is 13 which is prime.
MATHEMATICA
ndoQ[n_]:=Module[{id=IntegerDigits[n]}, FreeQ[id, 0]&&Min[ Differences[id]]> = 0&&PrimeQ[Total[id]]&&IntegerQ[Sqrt[Times@@id]]]; Select[Range[ 12500], ndoQ] (* Harvey P. Dale, Jun 18 2021 *)
PROG
(Python)
from math import prod
from sympy import isprime, integer_nthroot
from itertools import combinations_with_replacement as mc
def ok(s):
d = list(map(int, s))
return '0' not in s and isprime(sum(d)) and integer_nthroot(prod(d), 2)[1]
def auptod(digits): return [int("".join(p)) for d in range(2, digits+1) for p in mc("123456789", d) if ok("".join(p))]
print(auptod(5)) # Michael S. Branicky, May 29 2021
(PARI) uptoqdigits(n) = { my(res = List()); for(j = 2, n, forvec(x = vector(j, i, [1, 9]), if(issquare(vecprod(x)) && isprime(vecsum(x)), listput(res, fromdigits(x)) ) , 1 ) ); res }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
David A. Corneth, May 29 2021
EXTENSIONS
Definition (Name) corrected by Harvey P. Dale, Jun 18 2021
STATUS
approved