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.

A344842 Numbers with digits in nondecreasing order whose digit sum is prime and whose digit product is a perfect square > 0.

Original entry on oeis.org

11, 14, 49, 111, 119, 122, 128, 133, 155, 166, 188, 199, 229, 236, 289, 368, 449, 559, 779, 1114, 1334, 1444, 1466, 1477, 1499, 2249, 2489, 3349, 4559, 4889, 4999, 11111, 11119, 11122, 11128, 11144, 11155, 11177, 11188, 11236, 11339, 11368, 11449, 11669, 11999, 12233
Offset: 1

Views

Author

David A. Corneth, May 29 2021

Keywords

Comments

Primitive sequence of A344825.

Examples

			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.
		

Crossrefs

Programs

  • 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 *)
  • 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 }
  • 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
    

Extensions

Definition (Name) corrected by Harvey P. Dale, Jun 18 2021