g | x | w | all
Bytes Lang Time Link
065TIBASIC TI84 Plus CE Python250912T135615Zmadeforl
592jBasher2250909T154911Zmadeforl
080APLNARS250905T160745ZRosario
081YASEPL250904T163917Zmadeforl
085Nibbles230226T130028ZAdam
022Pyt230225T172600ZKip the
005Vyxal 2.6.1211123T002659Zlyxal
094Python 3211204T213823Zempii
111Scala211126T203102Zuser
151Zephyr211125T195435ZDLosc
040Wolfram Language Mathematica211123T093511Zovs
011Stax211125T010117Zrecursiv
009Husk211124T231036ZDominic
248Core Maude211124T220621ZChris Bo
009Jelly211123T185842Zlynn
056Ruby211123T081206ZAZTECCO
063JavaScript V8211123T015501ZArnauld
079Python 3211123T085942ZJitse
052R211123T070657Zpajonk
013MathGolf211123T080027ZKevin Cr
046Raku211123T075327ZSean
065Factor + lists.lazy math.primes.factors math.unicode211123T022400Zchunes
042Pari/GP211123T012524Zalephalp
009Jelly211123T012430Zhyperneu
037Charcoal211123T003717ZNeil

TI-BASIC (TI-84 Plus CE Python), 74 67 65 bytes

While 1
Ans+1
If not(fPart(round(AnsΣ(int(Ans/K)-int((Ans-1)/K),K,1,1+Ans)/Σ(Knot(fPart(Ans/K)),K,1,1+Ans),9
Disp Ans
End

make sure Ans is set to 0 before running.

jBasher2, 592 bytes

create n with type number
while 1 == 1
add n by 1
set that to n
create k with type number
set 1 to k
create f with type number
create o with type number
while k <= n
create g with type number
subtract n by 1
divide that by k
parse that as int
set that to g
divide n by k
parse that as int
subtract that by g
add f by that
set that to f
divide n by k
modulo that by 1
if that == 0
add k by o
set that to o
endif
add 1 by k
set that to k
endwhile
divide 1 by 10
add o by that
parse that as int
set that to o
divide f by o
multiply that by n
modulo that by 1
if that == 0
output n
endif
endwhile

awesome translation of my YASEPL answer

APL(NARS), 80 chars

r←F w;x;m;k
r←⍬⋄x←0x
→0×⍳0≥w
x+←1⋄→3×⍳∼1=÷1∨(≢m)÷+/÷m←k/⍨0=x∣⍨k←⍳x
r,←x⋄w-←1⋄→2

// +/ 12 9 8 38 13=80

F 1-indexed, and it is slow it seems has at last O(n^5) if goes well. F use rationals.
÷1∨k finds the denominator of k rational.

Test:

  F 5
1 6 28 140 270 
  F 10
1 6 28 140 270 496 672 1638 2970 6200 
  F 1
1 

YASEPL, 81 bytes

=n!+=k$=f=o`1=g$n-/k(=l$n/k(-g!f+l=u$n/k%1+[2!o+k`2!k+}4,n!o+.9(!f/o*n%1+[3>n`3?3

this prints them infinitely

explanation

=n                        main increment
                          (after this is where the loop starts)
  !+                        add 1 to n
  =k$                       K variable for summation
  =f                        F is total amount of divisors of N
  =o                        O is sum of divisors of N
  `1                        start sum
                              ( calculating number of divisors )
    =g$n-/k(=l$n/k(-g         l = floor(n/k) - floor(n-1/k)
    !f+l                      add to sum
                              ( calculating sum of divisors )
    =u$n/k%1+[2               if (n/k) = 0...
      !o+k                    add K to O
    `2                      end if
    !k+                     increment K
  }4,n                      if K <= N, go back to `1
  !o+.9(                    ceil O
  !f/o*n%1+[3               if (f/o)*n = 0...
    >n                        print n
  `3                        endif
?3                        go back to the third char of the program (where !+ is)     

this assumes that \$ n \$ is a harmonic divisor number if the following is true:

$$ 0=(\frac{\sum_{k=1}^{n}(\left\lfloor\frac{n}{k}\right\rfloor-\left\lfloor\frac{n-1}{k} \right\rfloor)}{\left\lceil\sum_{i=1}^{n}(0^{\frac{n}{i}\mod1}i)\right\rceil}\times n)\mod1 $$ I'm not the best with writing math equations so take it with a grain of salt.

this thing gets really slow.

Nibbles, 8.5 bytes

|,~~%*,;|,$~%@$@+

Attempt This Online!

Pyt, 22 bytes

1`ĐðĐĐΠ⇹/Ʃ⇹Π|?ŕĐƥ:ŕ;⁺ł

Try it online!

Prints Ore numbers forever.

1                              Push 1
 `                   ł         Do... while top of stack is truthy
  Đ                            Đuplicate
   ð                           Get list of ðivisors
    ĐĐ                         Đuplicate twice
      Π                        Get product
       ⇹                       Swap top two elements on stack
        /                      Divide
         Ʃ                     Ʃum
          ⇹                    Swap top two elements
           Π|?                 Does the sum divide the product cleanly?
              ŕĐƥ              If so, ŕemove the boolean, Đuplicate, and ƥrint
                 :ŕ            Otherwise, ŕemove the boolean
                   ;⁺          Either way, increment

Vyxal 2.6.1, 5 bytes

≬KṁḊȯ

Try it Online!

This doesn't work in 2.4 because 2.6 uses sympy rationals to store non-integers. Essentially a port of hyper's hypothetical Jelly answer.

Explained

≬KṁḊȯ
≬     # The next three elements as a function, taking single argument n:
 K    #    divisors of n
  ṁ   #    the average of that
   Ḋ  #    does that divide n?
    ȯ # First input numbers that satisfy the above function.

Python 3, 94 bytes

v=0
while 1:p=q=1;v+=1;-~len([(p:=p*d+q,q:=q*d)for d in range(2,v+1)if v%d<1])*q%p or print(v)

Try it online!

Outputs indefinitely. This is otherwise like (my edit to) @Jitse's answer, but computes the sum of the reciprocals p/q exactly as a pair of (big)ints (p,q).

Scala, 111 bytes

Stream.iterate(1:BigInt)(_+1)filter{n=>val d=n to(1,-1)filter(n%_<1)
val p=d.product
p*d.size%d.map(p./).sum<1}

Try it online!

Returns an infinite Stream.

Scala, 92 bytes

Stream from 1 filter{n=>val d=1 to n filter(n%_<1)
val p=d.product
p*d.size%(0/:d)(_+p/_)<1}

Try it online!

This one uses normal Ints, evading some of the boilerplate above, but it only generates the first three elements correctly due to integer overflows.

Zephyr, 151 bytes

set n to 1
while 1=1
set s to 0
set c to 0
for d from 1to n
if(n mod d)=0
set s to(/d)+s
inc c
end if
next
if((c/s)mod 1)=0
print n
end if
inc n
repeat

Try it online! Uses the output-infinitely strategy; you'll need to kill the program before 60 seconds in order to see any output.

Ungolfed

# Start from 1
set num to 1
# Loop forever
while true
  # Calculate the sum of the reciprocals of the divisors
  # and also the total number of divisors
  set reciprocalSum to 0
  set divisorCount to 0
  for divisor from 1 to num
    if (num mod divisor) = 0
      set reciprocalSum to reciprocalSum + (/ divisor)
      inc divisorCount
    end if
  next
  # Print the number if the divisor count divided by the
  # divisor-reciprocal sum is an integer
  if ((divisorCount / reciprocalSum) mod 1) = 0
    print num
  end if
  # Go to the next number
  inc num
repeat

Wolfram Language (Mathematica), 42 40 bytes

-2 bytes thanks to att!

Do[Mean@Divisors@n∣n&&Print@n,{n,∞}]

Try it online!

Stax, 11 bytes

¡♪♫ö╪ü♣↕¥Vv

Run and debug it

Runs an infinite loop with no input.

Husk, 9 bytes

fo§¦ṁ\LḊN

Try it online! (header outputs the first few elements to avoid timing-out)

         N  # from the infinite list of integers
fo          # output those for which
     ṁ\     # the sum of the reciprocals of their divisors
  §¦        # exactly divides
       LḊ   # the length (number) of their divisors

Core Maude, 248 bytes

mod H is pr LIST{Rat}. ops o h : Rat ~> Rat . var A B C D : Rat . eq o(A)= o(2
A). eq o(s A 0)= A . eq o(A s B)= o(s A(B + ceiling(frac(h(A A 0 0))))). eq h(A
s B C D)= h(A B(0 ^(A rem s B)/ s B + C)(0 ^(A rem s B)+ D)). eq h(A 0 C D)=
D / C . endm

The result is obtained by reducing the o function with the zero-indexed input \$n\$.

Example Session

Maude> red o(0) .  --- 1
result NzNat: 1
Maude> red o(1) .  --- 6
result NzNat: 6
Maude> red o(2) .  --- 28
result NzNat: 28
Maude> red o(3) .  --- 140
result NzNat: 140
Maude> red o(4) .  --- 270
result NzNat: 270
Maude> red o(5) .  --- 496
result NzNat: 496
Maude> red o(6) .  --- 672
result NzNat: 672
Maude> red o(7) .  --- 1638
result NzNat: 1638
Maude> red o(8) .  --- 2970
result NzNat: 2970
Maude> red o(9) .  --- 6200
result NzNat: 6200
Maude> red o(10) .  --- 8128
result NzNat: 8128
Maude> red o(11) .  --- 8190
result NzNat: 8190

Ungolfed

mod H is
    pr LIST{Rat} .

    ops o h : Rat ~> Rat .

    var A B C D : Rat .

    eq o(A) = o(2 A) .
    eq o(s A 0) = A .
    eq o(A s B) = o(s A (B + ceiling(frac(h(A A 0 0))))) .

    eq h(A s B C D) = h(A B (0 ^ (A rem s B) / s B + C) (0 ^ (A rem s B) + D)) .
    eq h(A 0 C D) = D / C .
endm

Maude has built-in support for rational arithmetic, so we just compute the harmonic mean of the divisors with h. Then, ceiling(frac(h(...))) will be 0 if h(...) is a natural number or 1 otherwise. Also, note that in Maude 0 ^ 0 == 1 and 0 ^ X = 0 for X =/= 1.

Jelly, 9 bytes

1Æd×ọÆsƲ#

Try it online!

More boring than the other answer:

             Implicit input: an integer z.
1      Ʋ#    Count up from 1, finding z numbers for which...
 Æd×           divisor_count(n) × n
    ọ          is divisible by
     Æs        divisor_sum(n).

Ruby, 71 56 bytes

1.step{|n|k=0;(1..n).count{|x|n%x<1&&k+=1r/x}%k>0||p(n)}

Try it online!

Outputs the sequence indefinitely.

JavaScript (V8), 63 bytes

Prints the sequence forever.

{for(n=0;;s%t||print(n))for(k=++n,t=s=0;k;)n%k--||(s+=n,t-=~k)}

Try it online!

Python 3, 79 bytes

n=0
while 1:n+=1;a=[i for i in range(1,n+1)if n%i<1];n*len(a)%sum(a)or print(n)

Try it online!

Outputs indefinitely.

R, 55 52 bytes

-3 bytes thanks to @Dominic van Essen.

while(F<-F+1)(1/mean(1/(y=1:F)[!F%%y]))%%1||print(F)

Try it online!

Prints Ore numbers infinitely.

MathGolf, 13 bytes

î∙─‼Σ£î*\÷╛p∟

Outputs indefinitely.

Try it online. (You do have to manually cancel it during runtime to see output apparently, before it times out after 60 seconds..)

Explanation:

            ∟  # Do-while true without popping:
î              #  Push the 1-based loop-index
 ∙             #  Triplicate it
  ─            #  Pop the top, and get a list of its divisors
   ‼           #  Apply the following two commands separately:
    Σ          #   Sum the divisors-list
     £         #   Get the length of the divisors-list
      î*       #  Multiply the length by the 1-based loop-index
        \      #  Swap the top two values on the stack
         ÷     #  Check that the length*î is divisible by the sum
          ╛    #  If this is truthy:
           p   #   Pop the remaining copy of the index, and print it

Raku, 46 bytes

grep {{@_%%sum 1 X/@_}(grep $_%%*,1..$_)},^∞

Try it online!

This is a lazy infinite sequence of the harmonic divisor numbers.

Factor + lists.lazy math.primes.factors math.unicode, 69 65 bytes

[ 1 lfrom [ divisors [ length 1 ] keep n/v Σ mod 0 = ] lfilter ]

Try it online!

It's a quotation that returns an infinite lazy list of the harmonic divisor numbers.

Explanation

Pari/GP, 42 bytes

for(n=1,oo,numdiv(n)*n%sigma(n)||print(n))

Try it online!

Jelly, 9 bytes

ÆDpWSḍ/µ#

Try It Online!

This is horribly scuffed because I couldn't figure out how to get it working with precision. I had the same idea as ovs it turns out, but ÆDÆmḍµ# fails due to precision issues.

I honestly hate how this is written.

ÆDpWSḍ/µ#    Main Link
       µ#    nfind; return first n values satisfying:
ÆD           divisors of n
  p          cartesian product with
   W         [n] (returns [[a, n], [b, n], ...])
    S        sum (returns [divisor sum, divisor count * n])
     ḍ/      reduce by divisibility check

Charcoal, 37 bytes

Nθ≔⁰ηWθ«≦⊕η≔Φ⊕η∧κ¬﹪ηκζ¿¬﹪×ηLζΣζ≦⊖θ»Iη

Try it online! Link is to verbose version of code. Outputs the 1-indexed nᵗʰ Ore number. Explanation:

Nθ

Input n.

≔⁰η

Start looking for Ore numbers greater than zero.

Wθ«

Repeat until the nᵗʰ number has been found.

≦⊕η

Try the next integer.

≔Φ⊕η∧κ¬﹪ηκζ

Get its factors.

¿¬﹪×ηLζΣζ

If the harmonic mean is an integer, then...

≦⊖θ

Decrement the count of remaining Ore numbers to find.

»Iη

Print the found Ore number.