login
Moran numbers: k such that k/(sum of digits of k) is prime.
21

%I #54 Feb 19 2024 01:47:45

%S 18,21,27,42,45,63,84,111,114,117,133,152,153,156,171,190,195,198,201,

%T 207,209,222,228,247,261,266,285,333,370,372,399,402,407,423,444,465,

%U 481,511,516,518,531,555,558,592,603

%N Moran numbers: k such that k/(sum of digits of k) is prime.

%C Witno conjectures that a(n) ~ c*n log(n)^2 for some c. - _Charles R Greathouse IV_, Jul 26 2011

%D Bill Moran, Problem 2074: The Moran Numbers, J. Rec. Math., Vol. 25 No. 3, pp. 215, 1993.

%H Aaron Toponce, <a href="/A001101/b001101.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from T. D. Noe)

%H Amin Witno, <a href="http://www.ijopcm.org/Vol/10/IJOPCM(vol.3.2.3.J.10).pdf">Numbers which factor as their digital sum times a prime</a>, International Journal of Open Problems in Computer Science and Mathematics 3:2 (2010), pp. 132-136.

%t Select[Range[700], PrimeQ[ # / Total[IntegerDigits[#]]]&] (* _Jean-François Alcover_, Nov 30 2011 *)

%o (Haskell)

%o import Data.List (findIndices)

%o a001101 n = a001101_list !! (n-1)

%o a001101_list = map succ $ findIndices p [1..] where

%o p n = m == 0 && a010051 n' == 1 where

%o (n', m) = divMod n (a007953 n)

%o -- _Reinhard Zumkeller_, Jun 16 2011

%o (PARI) is(n)=(k->denominator(k)==1&&isprime(k))(n/sumdigits(n)) \\ _Charles R Greathouse IV_, Jan 10 2014

%o (Python)

%o # 1000000 primes: https://primes.utm.edu/lists/small/millions/primes1.zip

%o # "primes1.txt" must be formatted as a b-file before execution

%o import csv

%o with open("primes1.txt","r") as f:

%o ....reader = csv.reader(f, delimiter=" ")

%o ....primes = set([int(rows[1]) for rows in reader])

%o i, n = 1, 1

%o with open("b001101.txt","w") as f:

%o ....while i <= 10000:

%o ........if n % sum(map(int, str(n))) == 0 and n/sum(map(int, str(n))) in primes:

%o ............f.write("{} {}\n".format(i, n))

%o ............i += 1

%o ........n += 1

%o # _Aaron Toponce_, Feb 14 2018

%o (Python)

%o from sympy import isprime

%o def ok(n): s = sum(map(int, str(n))); return s and n%s==0 and isprime(n//s)

%o print([k for k in range(604) if ok(k)]) # _Michael S. Branicky_, Mar 28 2022

%Y Subsequence of A005349, Niven (or Harshad) numbers.

%Y Cf. A007953, A010051, A085775, A108780, A130338, A062339.

%K nonn,base,nice

%O 1,1

%A Bill Moran (moran1(AT)llnl.gov)

%E Name corrected by _Charles R Greathouse IV_, Jan 10 2014