Cody

# Problem 1742. Generate a Parasitic Number

This problem is the next step up from Problem 156. Rather than determining if an input is a parasitic number, you will be asked to generate one. You will be given the last digit of the number (k), and the number you're using to multiply to shift the parasitic number one digit (n). Both n and k will always be between 1 and 9.

For example, if n=4 and k=7:

```    4x7=2*8*
4x87=3*48*
4x487=1*948*
4x9487=3*7948*
4x79487=3*17948*
4x179487=717948.```

So 179487 is a 4-parasitic number with units digit 7.

We are looking for the smallest possible number that meets these criteria, so while 179487, 179487179487, and 179487179487179487 are all valid answers for n=4 and k=7, the correct output for this function is 179487.

Because some of the values that are generated by this function are very large, the output should be a string rather than an integer. Please bear in mind that some of these values will have leading zeros. This will occur when n>k.

### Solution Stats

32.34% Correct | 67.66% Incorrect
Last Solution submitted on Nov 04, 2019
{"ft_lang_label":"__label__en","ft_lang_prob":0.8371722,"math_prob":0.95936626,"size":1572,"snap":"2019-51-2020-05","text_gpt3_token_len":412,"char_repetition_ratio":0.124362245,"word_repetition_ratio":0.00754717,"special_character_ratio":0.2951654,"punctuation_ratio":0.0952381,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.998311,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-12-08T15:29:12Z\",\"WARC-Record-ID\":\"<urn:uuid:bdf9e199-7c88-438b-b1e5-e0e0bf279f54>\",\"Content-Length\":\"103109\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:6f94c68f-3515-4437-b95a-6657c7102b82>\",\"WARC-Concurrent-To\":\"<urn:uuid:1ad006c0-261c-45d9-bae2-1a0c6f8431e6>\",\"WARC-IP-Address\":\"104.110.193.39\",\"WARC-Target-URI\":\"https://fr.mathworks.com/matlabcentral/cody/problems/1742-generate-a-parasitic-number\",\"WARC-Payload-Digest\":\"sha1:FFWQ7OL7TU3UZ4MUPSPGE4Q5O36A3FTK\",\"WARC-Block-Digest\":\"sha1:VGQSIM4THSDH56VUKGHXZC2V6JOPUFIO\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-51/CC-MAIN-2019-51_segments_1575540511946.30_warc_CC-MAIN-20191208150734-20191208174734-00017.warc.gz\"}"}