# Idoneal numbers

```ruby
func is_idoneal (n) {

    for a in (1..n) {
        for b in (a+1 .. n) {
            break if (a*b + a + b > n)
            for c in (b+1 .. n) {
                var sum = (a*b + b*c + a*c)
                return false if (n == sum)
                break if (sum > n)
            }
        }
    }

    return true
}

1..255 -> grep(is_idoneal).each_slice(10, {|*a|
    say a.map { '%4s' % _ }.join(' ')
})
```

#### Output:

```
   1    2    3    4    5    6    7    8    9   10
  12   13   15   16   18   21   22   24   25   28
  30   33   37   40   42   45   48   57   58   60
  70   72   78   85   88   93  102  105  112  120
 130  133  165  168  177  190  210  232  240  253
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://trizen.gitbook.io/sidef-lang/programming_tasks/i/idoneal_numbers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
