MAT

Enigma #12

Find the first triangular number to have more than N divisors.

Vincoli

1 < N < 103

Esempio

If we look for the divisors of the first triangular numbers we find:

1: 1

3: 1, 3

6: 1, 2, 3, 6

10: 1, 2, 5, 10

15: 1, 2, 5, 15

21: 1, 2, 3, 7, 21

28: 1, 2, 4, 7, 14, 28

The first triangular number having N = 5 divisors is:

28.

Your program

<?php
    
function main($N) {

  $return = 0;
  /* Write your function here */
  
  return $return;
}
  
$IN = (array) json_decode(base64_decode($argv[1]));
extract($IN);
echo main($N);
?>

Il tuo input

{ 
  "N": 5 
}

Your output

-

Correct output

28

0 0 votes
Article Rating
Notifiche
Notificami
0 Comments
Inline Feedbacks
View all comments