Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

Hostile Divisor Numbers

Some divisors of positive integers really hate each other and they don't like to share one or more common digits.

Those integers are called Hostile Divisor Numbers (HDN)

Examples

Number 9566 has 4 divisors: 1, 2, 4783 and 9566
(as you can see, no two of them share the same digit).
Thus, 9566 is a Hostile Divisor Number

Number 9567 is NOT HDN because its divisors (1, 3, 9, 1063, 3189, 9567) share some common digits.

Here are the first few HDN

1,2,3,4,5,6,7,8,9,23,27,29,37,43,47,49,53,59,67,73,79,83,86,87,89,97,223,227,229,233,239,257,263,267,269,277,283,293,307,337... 


Task

The above list goes on and your task is to find the nth HDN

Input

A positive integer n from 1 to 4000

Output

The nth HDN

Test Cases

here are some 1-indexed test cases.
Please state which indexing system you use in your answer to avoid confusion.

input -> output 
 1 1 
 10 23 
 101 853 
 1012 26053 
 3098 66686 
 4000 85009 

This is , so the lowest score in bytes wins.

EDIT

Good news! I submitted my sequence to OEIS and...
Hostile Divisor Numbers are now OEIS A307636

Answer*

Draft saved
Draft discarded
Cancel
6
  • \$\begingroup\$ is this 2-indexed? It's ok with me but please state it for others \$\endgroup\$ Commented May 3, 2019 at 14:20
  • \$\begingroup\$ It's whatever your test cases were, so 1 \$\endgroup\$ Commented May 3, 2019 at 14:21
  • 3
    \$\begingroup\$ No it isn't. 101 returns 839. and 102 -> 853. It works fine but it is 2-indexed \$\endgroup\$ Commented May 3, 2019 at 14:23
  • 1
    \$\begingroup\$ @J42161217 wait what? i guess when i moved the nfind it changed the indexing lol \$\endgroup\$ Commented May 3, 2019 at 14:33
  • 1
    \$\begingroup\$ =Q$ is the same as . \$\endgroup\$ Commented May 3, 2019 at 14:35

AltStyle によって変換されたページ (->オリジナル) /