Numbers whose count of divisors is prime

From Rosetta Code
Revision as of 02:28, 11 July 2021 by CalmoSoft (talk | contribs) (Created page with "{{Draft task}} ;Task:Find numbers which count of divisors is prime, where '''n < 200''' <br><br> =={{header|Ring}}== <lang ring> load "stdlib.ring" row = 0 see "working......")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Numbers whose count of divisors is prime is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.
Task
Find numbers which count of divisors is prime, where n < 200



Ring

<lang ring> load "stdlib.ring" row = 0

see "working..." + nl see "Numbers which count of divisors is prime are:" + nl

for n = 1 to 200

   num = 0
   for m = 1 to n
       if n%m = 0
          num++
       ok
   next
   if isprime(num)
      see "" + n + " "
      row++
      if row%5 = 0
         see nl
      ok
   ok  

next

see "donw..." + nl </lang>

Output:
working...
Numbers which count of divisors is prime are:
2 3 4 5 7 
9 11 13 16 17 
19 23 25 29 31 
37 41 43 47 49 
53 59 61 64 67 
71 73 79 81 83 
89 97 101 103 107 
109 113 121 127 131 
137 139 149 151 157 
163 167 169 173 179 
181 191 193 197 199 
donw...