[Question]
  [
## Introduction
A "lobster number", by my own designation, is a number that contains within itself all of its prime factors. The "lobster" description was inspired by the recent question "[Speed of Lobsters](https://codegolf.stackexchange.com/questions/217690/speed-of-lobsters)". The basic idea is that each prime factor can be made by lobsters munching away digits of the number until you are left with just the factor.
Example: `51375` is a lobster number, since its prime factors are `[3,5,137]`, which can be made by lobsters thusly: `[**3**, 5**** / ****5, *137*]`. Another lobster number is `62379`, as the factors `[3,29,239]` can be formed as `[**3**,*2**9,*23*9]`.
## Challenge
Given a number as input, return whether it is a lobster number or not. Preferentially this is a boolean output, such as 1 or 0, or True or False.
Astute readers may realize that prime numbers are a trivial solution to this requirement, but since they don't allow the lobsters to eat any digits, they are out. Your program must not identify prime numbers as lobster numbers.
This is similar to OEIS [A035140](https://oeis.org/A035140), but has the additional requirement that each digit of the factor must appear at least the same number of times in the number, and in the correct order. In other words, `132` is not a lobster number, since its factors are `[2,3,11]`, and the `11` cannot be made by munching away at just `132`. `312` is also not a lobster number, because its factors are `[2,3,13]`, and `13` is out of order.
I believe the "mathematical" definition would be: "Determine if the number n is a composite number such that all prime factors of n are a subsequence of n".
## Test Cases
```
59177  -> True
62379  -> True
7      -> False
121    -> True
187    -> False
312    -> False
```
As always, Standard Loopholes are forbidden.
## Note:
It has come to my attention that the original reasoning I gave for not needing to handle 0 or 1 as input is faulty. However, requiring the proper output at this point would invalidate a number of answers. Therefore, let it hereby be known that neither 0 nor 1 are lobster numbers, but you also do not need to handle them as input (they are not valid test cases). If your code does handle them correctly, you may give yourself the Lobster Advocate Badge™.
  
[Answer]
# [Python 3](https://docs.python.org/3/), ~~155~~, ~~126~~, ~~124~~, ~~123~~, ~~120~~ ~~116~~, 113 bytes
Yes! First python answer!
Saved **21 bytes** due to a suggestion by Dominic van Essen to remove the `for` loop!
Saved **8 bytes** because I realized I could use `t*=True/False` instead of `t+=[True/False]`.
Saved another **2 bytes** right after I finished editing because I realized `t` could simply be set to the same value as `i` and `l`!
Saved **1 byte** based off Danis's python 2 comment.
Saved another **3 bytes** based off Tipping Octopus's comment.
Saved another **4 bytes** due to Tipping Octopus again!
Saved another **3 bytes** thanks to Dominic's suggestion to remove the `t` variable.
# New Answer
```
x=input()
n=int(x)
i=l=2
while~-n:
 if n%i:i+=1
 else:n//=i;l+=1;j=iter(x);l*=2*all(c in j for c in str(i))
print(l>4)
```
# How it works
The `while` loop computes the prime factors of the input. If a prime factor is found, it checks if it is a subsequence of the input. `l` is multiplied by whether or not this is `True`. This takes advantage of the fact that python's `True` and `False` values act like 1s and 0s when you multiply by them. This means that instead of appending `True/False` to `t` and checking whether `all(t)` is `True` like in my old answer, I can just multiply `l` by `2*True/False` and check its value in the `print` statement. The `print` statement prints `True` if `l>4`.
[Try it online!](https://tio.run/##HczBCsIwDIDhe54iF6GdyGj11BHfRaRjGSErXYbz4qvX6e27/H9527TotbWdWMtmzoMeMrd7YBKK8JpY8ueiCZBH1BMnPlMAzLLmpH1PPMzEluuRDNJR7B4i7omsOOO4VPxzterYeyj1N5f7zbcWYvgC "Python 3 – Try It Online")
# Old Answer
```
x=n=int(input())
l=[]
i=2
while i<=n:
 if n%i:i+=1
 else:n/=i;l+=[i]
t=[]
for p in l:i=iter(str(x));t+=[all(c in i for c in str(p))]
print(all(t)*len(l)>1)
```
[Try it online!](https://tio.run/##HY5BCsJADEX3OUU2wkQXUnXj1HiR0oXIlAZCOkwj1tOPjrsP7z34@ePzYudaNzYW8yCWXx6IQHkYQfgE71k0odzYIqBMaDuJcuAOMOmaoh1Zej3wICN4a6alYEYx1CgsnkpYvYSNqPef9VANz0YFm/ifjWeiEXJpF5ritNdkQeneUa2X6xc "Python 3 – Try It Online")
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 5 bytes
That's basically this: "Determine if the number n is a composite number such that all prime factors of n are a subsequence of n".
```
ḋṀ⊆ᵛ?
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/pfXa6koGunoFSuVv2obcOjpuZHHcuVSopKU/WUakDMtMScYiC79uGuztqHWyf8f7ij@@HOhkddbQ@3zrb//z/a1NLQ3FxHwczI2NxSRwHIMjQyBBIWQJaxoRFcwtTQ2Nw0FgA "Brachylog – Try It Online")
```
ḋṀ⊆ᵛ? (with implicit input n)
ḋ     get the prime factors of n
 Ṁ    they must be Ṁany (at least 2 to filter out primes)
  ⊆ᵛ  all of them must be an (ordered) subset of
    ? the input
```
[Answer]
# [Zsh](https://www.zsh.org/) `-e -o glob_subst -o extended_glob`, ~~40~~ 38 bytes
```
>$1:
for i (`factor $1`)>${i///*}*~$i:
```
[Try it online!](https://tio.run/##qyrO@K9RnFqioJuqoJuvkJ6TnxRfXJpUXALipVaUpOalpKbEg4T/26kYWnGl5RcpZCpoJKQlJpcAmSqGCZp2KtWZ@vr6WrVadSqZVv811ez0U1LL9PNKc3K4bGxsVOz//zc0MgQA "Zsh – Try It Online")
Outputs via exit code: `0` is a lobster number, `1` is not a lobster number
Explanation:
* `>` - do nothing, and send the output to:
	+ `$1:` - the input with a `:` appended (e.g. `51375:`). This is because `factor` outputs the input number itself, then a colon, then its factors, and we need to match based on that later.
* `factor $1` - factorise the input (in the format `51375: 3 5 137`)
* `for i` - for each element in the factorisation:
	+ `${i}` - take that element
	+ `///*` - prefix each character with a `*` (e.g. `*1*3*7`)
	+ append `*~` + the input + `:`
	+ `>`, `-o glob_subst` - do nothing, and try to output to a file matching that pattern (there is only one file in the directory, the one we created earlier):
		- at this point the pattern is something like `*1*3*7*~51375:`
		- `*` - match zero or more characters; so `*1*3*7*` tests for a subsequence.
		- `~`, `-o extended_glob` - the file must match `*1*3*7*` but *not* `51375:` itself - this is to prevent prime numbers from being matched.
	+ `-e` - exit immediately if there is an error (no files match that pattern) and set the exit code to `1`. If all factors matched a file, there is no error and the exit code is `0`.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~9~~ 6 bytes
```
æ¨IfåP
```
[Try it online!](https://tio.run/##yy9OTMpM/f//8LJDKzzTDi8N@P/f1NLQ3BwA "05AB1E – Try It Online") or [Try all cases!](https://tio.run/##S0oszvj/PzU5I19BN09B/fCyQys80w4vDVBXsFNIzk9J1UtMSuXiKs/IzElVKEpNTFHIzONKyedSUNDPLyjRzy9OTMpMhVJw9Qo2NjYKKmCFean//5taGpqbc5kZGZtbcplzGRoZchlamHMZGxpBxQA)
**Commented:**
```
æ          # get the powerset / all subsequences of the input
 ¨         # remove the last one (the input itself)
  If       # get all prime factors of the input
    å      # is each prime factor in the powerset?
     P     # take the product
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~13~~ ~~10~~ 9 bytes
*(`Πm` -> `Λ` simultaneously golfed-down by [Razetime](https://codegolf.stackexchange.com/users/80214/razetime)!)*
```
Λo€hṖd¹dp
```
[Try it online!](https://tio.run/##yygtzv6f@6ip8f@52fmPmtZkPNw5LeXQzpSC////R5saGpub6phaGpqb65gZGZtb6pjrGBoZ6hhamOsYGxpBxGIB "Husk – Try It Online")
Returns `0` (falsy) for non-lobster numbers, and a positive nonzero integer (truthy) for lobster numbers.
**How?**
```
Λo       p    # is this true for each prime factor of input:
   €          # index (or zero if absent) of
        d     # its digits among
    hṖ        # all subsets (in order, without full set) of
      d¹      # digits of input
```
[Answer]
# [Python 2](https://docs.python.org/2/), 93 bytes
Outputs via exit code: `0` if it is a Lobster number, `1` otherwise.
```
n=m=input()
i=1
while~-m:
 i+=1
 while m%i<1:m/=reduce(lambda s,c:s[c==s[:1]:],`n`,`i`)or i%n
```
[Try it online!](https://tio.run/##dY3LasMwEEX38xWDwcSmLu3YdRSLatf@QVcNAaeyIAPRA1lp601/3RXuupuBOdx7T1jSxbt2/brw1SBJwBSXfNF8G42xKIrVKavYhVuqamBFsEV/7m1O8V3@8a9rS34maR9UNNNNm@p6th/TGedGy/molZqPkk7y1IxubEYeax@RS7ciZkf2hcgu4a7sJ5ndnFD7yeDjDkt0kIk2IWH1tgTzGqOPDb6b6F/4k2f2bkO1/HeGtpm1H0gI2LedGEAAtQR0ENBRCy108AQ97DM/wPAL "Python 2 – Try It Online")
The algorithm for determining subsequences was borrowed from [@xnor's answer](https://codegolf.stackexchange.com/a/180287/88546) to [Is string X a subsequence of string Y?](https://codegolf.stackexchange.com/q/5529/88546). A `TypeError` is raised when the subsequence check fails, and the `i%n` causes a `ZeroDivisionError` to occur on prime inputs.
### [Python 2](https://docs.python.org/2/), 92 bytes
One byte can be saved using `exec`, at the cost of segfaulting on large inputs.
```
n=m=input()
i=1
exec"i+=1\nwhile m%i<1:m/=reduce(lambda s,c:s[c==s[:1]:],`n`,`i`)or i%n\n"*n
```
[Try it online!](https://tio.run/##dY3BbsIwEETv@xUrSxEJjdRuKIRa9a39g54KSKGOJVYia8sx0Hx96tJzL3N4o5kXpnTy0sy3E58dkgZMccqJ7ttZjEqpWcxgWMIllRWwIfhtFD8Y2svfaij4lfTwaKLrL9aV5@Pw1R9xrK0ed9aYcafpoA91J13dcVf5iFzIXtRSZsSsyLoQWRIuinWvs5oTWt87fFpggQKZWBcSlh9TcO8x@ljjp4v@ja88spc7qvS/N3S/mVughoC2LayogQZW8Axr2EALW3j5AQ "Python 2 – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 10 bytes
```
DŒPḌḟiⱮÆfẠ
```
[Try it online!](https://tio.run/##y0rNyan8/9/l6KSAhzt6Hu6Yn/lo47rDbWkPdy34b324XeVR0xr3//9NLQ3NzXUUzIyMzS11FIAsQyNDIGEBZBkbGsElTA2NzU0B "Jelly – Try It Online")
## How it works
```
DŒPḌḟiⱮÆfẠ - Main link. Takes an integer n on the left
D          - Digits of n
 ŒP        - Powerset of the digits
   Ḍ       - Convert back to integers
    ḟ      - Remove n from this list
       Æf  - Yield the prime factors of n
      Ɱ    - Over each prime factor:
     i     -   Index of the factor in the powerset, or 0
         Ạ - All are true?
```
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 95 bytes
```
.+
$*_¶$&
%O^$`.
+`^(__+?)(\1)*¶
$#2$*__¶$.1¶
_¶((.)+¶(?=(.+¶)*((?<-2>\2)|.)+$(?(2).))){2,}.+$
```
[Try it online!](https://tio.run/##FYoxDsIwDEV3XwMX2QlYsisIlYCMjFygasrQgYUBsQHX6gF6sWCm97/ee06v@@NWG7qMVSJgKMuMa2iuA44CEMeBSomZqVcOywy4Mm/@kahfH0TC0ZFPJE4ORPm4tXNv/HGDlMlYmPltm69ErHXXaUqwtzZ1kEBNQQ8JWrUf "Retina 0.8.2 – Try It Online") Link includes test cases. Explanation:
```
.+
$*_¶$&
```
Duplicate the input, converting one copy to unary.
```
%O^$`.
```
Reverse both copies. (Reversing the unary copy has no effect, of course, other than being golfier.) Reversing the input allows it to be used for nondestructive subsequence matching (a simple subsequence matching Retina program works by destroying both strings on success).
```
+`^(__+?)(\1)*¶
$#2$*__¶$.1¶
```
Repeatedly extract the smallest proper (and therefore necessarily prime) factor of the unary input, until it is reduced to 1.
```
_¶((.)+¶(?=(.+¶)*((?<-2>\2)|.)+$(?(2).))){2,}.+$
```
Attempt to match the unary 1, followed by at least 2 factors, each of which can be matched against the reversed input by popping its previously captured characters as they are seen, followed by the reversed input.
[Answer]
# [Husk](https://github.com/barbuz/Husk), 11 bytes
*I got ninja'd..*
```
§&tΛo€Ṗd¹dp
```
[Try it online!](https://tio.run/##ARwA4/9odXNr///CpyZ0zptv4oKs4bmWZMK5ZHD///81 "Husk – Try It Online")
Outputs truthy for a lobster number and falsy otherwise. This would be shorter if `all` returned 0 for empty lists.
## Explanation
```
§&tΛo€Ṗd¹dp
          p prime factorization of the input
§           fork:
  t          is the list not composed of a single element?
 &          and,
   Λo    d   are all the prime factors' digits
     €       present in
      Ṗd¹    the powerset of the input's digits?
```
[Answer]
# [Haskell](https://www.haskell.org/), ~~135~~ 128 bytes
Saved 7 bytes thanks to @ovs!
```
f n=all(\x->x/=n&&(show n%show x))$foldl(\f x->[x|all((>0).mod x)f&&mod n x<1]++f)[][2..n]
(a:b)%(c:d)=b%([c|a/=c]++d)
_%x=x==[]
```
[Try it online!](https://tio.run/##bYxBDoIwEEX3nGIWQtqAaCGKEOtFamMqpYFYCgGMNfHuWIhLN39@5r38WoyPSut5VmCo0Bpd7fZid9QEARrr7gXGX4/FeKM6LZ2gwCnMfhYbXfY4bjvpuAqCpRiwZ8LDUGHGWRLHhntIFHfso7KQmN59xMqP2NHSORJ7N99SSynjcysaAxRk5wHoaoJpeE71230YSUgEh5xkWQTHJM1y/lOU0ONqOEBOLlKSLKwfGjPBBlrRA1L4N/UHrAPzFw "Haskell – Try It Online")
[Answer]
# [J](http://jsoftware.com/), 27 bytes
```
1<[:*/](]#.@E.[-.-.)&":"+q:
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/DW2irbT0YzVilfUcXPWidfV09TTVlKyUtAut/mtypSZn5CuohxSVpqpD2GkKppaG5uYwjpmRsbkljGNoZMgF1eGWmFOM0AJXbmgBZxobGv0HAA "J – Try It Online")
Takes list of prime factors `q:` and original input, and for each pair, formats each as a string `&":"+` and then applies the following verb in parens: `]#.@E.[-.-.`
This verb set subtracts the factor digits from the input digits `-.` (leaving digits *not* in the factor) and then subtracts those from the input digits `[-.`, leaving only input digits that *are* in factor, with order preserved.
We then check if the factor is a substring match of that `E.`, which returns a boolean list of length input, with a 1 at any index where a match begins. Finally we interpret that as a base 2 number and convert to an integer `#.@`. This means that for a true result we need *all* factors to be greater than or equal to 1, and at least 1 factor to be greater than 1.
So we multiply all the results together `[:*/` and check if that is greater than 1 `1<`.
[Answer]
# [Wolfram Language](https://www.wolfram.com/language/), 118 bytes
```
i|->Catch@AllTrue[MemberQ[a=FactorInteger@i,{i,_}]&&Throw@False;a,LongestCommonSequence@##==#&@@ToString/@{#[[1]],i}&]
```
[Try it online!](https://tio.run/##TU/RSsQwEHz3K8IV@hSQtGg9SyFyUBAUlOtbCNcY99pAk5zpFoXSb6@9E@9un3aY2Z0Zq7AFq9BoNc/7ohycRuOdMJRsFOqWP3VdFQYQr2A/ILwLVZRKow/PDqGBwA0dDd1NMo6rNvhvXqquh1zRF@8a6HHjrfVuC18DOA08iooiijmv/BaDcc0tHyMhmJTUTLGU@YzLTU8KMo53a5ZllBzNJ0rG@yTN1he4MCen484SdiHYwzWVsuQfTfnNud3oKIGfA2iEz0X2tkRB8ZeoAnvoFIJY1ax@PKtIndSUNB5JndYrKa4eULIXTi5DOOfkVCCf518 "Wolfram Language – Try It Online")
Pure function; uses the `|->` syntax, which is new in version 12.2. TIO is running version 12.0, so I've used Function FullForm there.
Test cases:
```
59177: expected True, got True
62379: expected True, got True
7: expected False, got False
121: expected True, got True
187: expected False, got False
312: expected False, got False
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), ~~12~~ 15 bytes
```
&!P_Q.A}Ry`Q`MP
```
[Try it online!](https://tio.run/##K6gsyfj/X00xID5Qz7E2qDIhMME34P9/MyNjc0sA "Pyth – Try It Online")
*-2 bytes by using ``` instead of `+k`, +5 to account for primes needing to return false.*
[Answer]
# [Python 2](https://docs.python.org/2/), 137 bytes
```
lambda n:(p(n)<1)*all(re.search('.*'.join(`d`),`n`)for d in range(2,n)if n%d<1and p(d))
p=lambda n:all(n%i for i in range(2,n))
import re
```
[Try it online!](https://tio.run/##XU7LasMwELzrKxZDiDYIgxxaNyG@5txDb23BqrWO1TprIanQ9uddK31Au4fZHZiZHf@ehomruW8e5tGcn6wB3ksvGQ8aN2YcZaAykgndINflZl0@T45la1tULbfYTwEsOIZg@ESyUoyuB17ZgzZswUuLKHzzm5wDeeUg@9xfHwp39lNIEGhOFFOEBuTVTte1gutqW@8ULJeu9AI3y7XVFQp689Qlsll7F15JwRcezRj/k8tC0Q3UvVDIjuJo3FgoKG5NjAWK3Copyr0@nJeXFgp@fuBewDK5Vy8TXogPjtPigUX3HXwfm4Ye508 "Python 2 – Try It Online")
[Answer]
# JavaScript (ES6), ~~80~~ 79 bytes
Expects a string.
```
f=(n,m=n,k=2)=>n%k?k>n||f(n,m,k+1):m-k&&m.match([...k+''].join`.*`)&&f(n/k,m,k)
```
[Try it online!](https://tio.run/##fcxPC4IwGMfxe69CBumWOtmklsHs1ivoFoHDtHRuC7VOvvelRIf@0HN8vh9@tbiLLm@rax9qcyqsLTnUgeI6kJwinuq53MpUD0M5vQPpE7RRoXRdhZXo8ws8YIyl73lHXJtKZ3iRIdcdcSQnjmxudGeaAjfmDEsIlglhDCDkRJGzb2/F7KOvaMySP50BZ7xn34mm@wKEEvACvwbImoG/AzGh78A@AA "JavaScript (Node.js) – Try It Online")
### Commented
```
f = (              // f is a recursive function taking:
  n,               //   n = initially the input as a string,
                   //       then an integer
  m = n,           //   m = copy of the input
  k = 2            //   k = current divisor candidate
) =>               //
  n % k ?          // if k is not a divisor of n:
    k > n ||       //   stop the recursion if k > n
    f(n, m, k + 1) //   otherwise: do a recursive call with k + 1
  :                // else:
    m - k &&       //   if k is not equal to m
    m.match(       //   and we can find in m:
      [...k + '']  //     the digits of k in the correct order
      .join`.*`    //     possibly with other digits in between
    ) &&           //   then:
    f(n / k, m, k) //     do a recursive call with n / k
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~264~~ ~~236~~ 219 bytes
-45 bytes thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat)!
```
i,j,k,b,n,r,z;char p[9],c[6];l(int*s){b=1;for(j=k=!strcpy(c,s);p[j]*b;j++)for(b=0;c[k]&&(c[k]==p[j]?c[k]=5,b=1,0:1);k++);b=b;}f(int*s){r=1;n=z=atoi(s);for(i=2;n>1;i++)for(;sprintf(p,"%d",i),n%i<1;n/=i)r&=i-z&&l(s);b=r;}
```
[Try it online!](https://tio.run/##fVFbb4IwFH73V3QskqLVCcbbSt0PQR6kwCywQtr6MA2/nR2YF8iSNYRz6HfOdwl89sl58yokL85xgnxtYlHOT/tGkIzkJCKSKHKh/HRUqAp2IeHBOqQFFtJMtHONmEvTUuGM5exFG8Wrb8yJdmgVZOEkotl06rR4xBaUB3lo27gtjLX4R9euCJCQxbvr0BymacQiWqd3AQUCkl3Y0ZQCA29LJphH5d6l4kZOdaVgPMUVscaxRYRD5Fj4sPjGhKNsJmYX2y7a9YgpWjcwjL6OQmIHXUcjBKfLZxJtIB08iAGAbsda7dzNxiLPi7W33Oz6FwPU9dzB53aALl3PQjXtLrpXlwgMGRBdUCg@WkOBbD0Pj@aW1Bpri/waNqFD/87dWePS6F/irvPRdga/qUgkfix3yFBuQNWXnVs9sfofe/FBHiRYTB86t8X6mVwl5qwkeBvVzQ8 "C (gcc) – Try It Online")
But it's a shame that C needs all those bytes. I believe that a better approach could be found, so here is an ungolfed and highly commented version that you can use to get yourself into the problem and hopefully develop something better.
```
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// indexes
int i,j,k;
// int copy of the input s, used to find prime factors
int n;
// array to store char* copy of the prime factors of n
char p[20];
// bool telling whether a particular digit of p
// has been successfully "lobsted" in s
int b;
// checks whether a given factor p "lobsters" s
int l(char*s)
{
    // just copy of s, so that we can preserve the input
    // to check whether the next factors "lobster" it or not
    char c[6];
    
    strcpy(c,s);
    
    // we don't do it at the start of the k-loop
    // because we want to continue the loop from
    // where we left it. 31 do not "lobster" 12345.
    // After checking for 3, we don't check for 1 from the beginning
    k = 0;
    
    // until p has digits to check for lobsterness
    for(j=0;p[j];j++) {
        
        // assume the digit can't be lobsted in c
        b = 0;
        
        // untill c has digit that could potentially
        // "lobster" the digit of p
        for(;c[k];k++) {
            
            // if the digit of p double equals one of the digits of c
            if(p[j]==c[k]) {
                
                c[k] = '*'; // delete the digit of c
                b = 1; // set "lobsted" to true
                break;
            }
        }
        
        // if a digit couldn't be lobsted
        if(!b) break;
    }
    
    // return 0 if at least one digit couldn't be lobsted,
    // return 1 if all of them were sucessfully lobsted
    return b;
}
// find factors of s and launch l() for each factor found
int f(char*s)
{
    // n is, initially, the int copy of the input
    n = atoi(s);
    
    // until a factor can be found in n
    for(i=2;n>1;i++) {
    
        // if i is a factor of n
        if( !(n%i) ) {
            
            // if the first factor found is the original number
            if(i==atoi(s)) return 0;
        
            // until i divides n, divide n by i
            for(;!(n%i);n/=i);
            
            // make a char[] copy of the factor i, named p
            sprintf(p,"%d",i);
            
            // if p doesn't "lobster" s
            if(!l(s)) return 0;
        }
    }
    
    // reachable only if each factor p "lobsted" the original number s
    return 1;
}
int main() {
    char test[6][6] = {
        "59177",
        "62379",
        "7",
        "121",
        "187",
        "312" };
    
    for(int t = 0; t < 6; t++) {
        
        printf("%s", test[t]);
        
        for(int dots = 0; dots < 8-strlen(test[t]); dots++) {
            
            printf(".");
        }
        
        printf("%d\n\n", f(test[t]));
        
        memset(p,0,20);
    }
    
    return 0;
}
```
And in case you want to golf from here, rather than start a new approach, here is [the same code without comments](https://tio.run/##hVPbjoIwEH3nKyobI1V0AbNeUvFH0AcpqBWsBurDZsO3u1NAoAraGNueuZ2eGej4QOn9i3Ea34IQrVIRsMvkuG6BNAWKmf@MJYwfJKYxLhAzT2ZEijOHnR53Cbp6jrUtQb/cY0OahinW/jQEK3ek3gz85DX/g9z0@mtQM8UNNEIushr3/SUxTq5Frt5pS06jEUZFxspBLr8OUnAZTKgXbUmkRipecrG9ISu4rvR@9nzxzp8EjlB2MByQF5vkY7fASbiLVDjTXk9ag1TPx82wrBYmCcUt4VLxrNB8/6Q5BxI7cWGGoq@UhLkO4WubsFqUZk3UM3ifYfRJMOa6ZX78YNPWhKoRRVrCv12GSXfm9AozJ6Afpt4PdPOtr1Qo7iCQdShmV4qdd4wb8pX1jIowFTCm8AP16ufrP0t7PtfNGpg50/myCShW27GV60KxTm1HR9lzU4CQyOcYthWawdYx7aU@ej/VzYKw2OKO6ZdZg4tIi8T5aYUWY/j24pAbVXBu@fCJPMpOdEzeTW1FL9jwDQeK@6pOG8tzeE5DAd22TMfCXWMOfc3u938 "C (gcc) – Try It Online")
[Answer]
# [PowerShell Core](https://github.com/PowerShell/PowerShell), 126 bytes
```
param($n)(($u=2..($n-1)|?{!($n%($a=$_)-or(2..($a-1)|?{!($a%$_)}))})|?{$n-match(("$_"|% t*y)-join'.*')}).Count-eq$u.count-and$u
```
[Try it online!](https://tio.run/##bZBda8IwFIbv@yuyEmcitpAW13lRJoi73Zi7G0OyGOmkbVw@2Ib2t3enLauKHnpx@rzPeSndqW@pTSbzPBBKyxpv0n2945oXBJeUEOzSKAxhDxg9POxvYBsQzFO8ooHSpM14n/EB8IrCA@9wU3ArMkJ8vPIPA2RHvzTYqs9yGI6G4IRz5UobyC/sQtGuvFxjV1eeNyMeghmjGZmwOJmMEbbaSXqkU5YkF/QuipPpBW28Dc/NCWIRu9DY/RUxZtGV6/gEUnRAj0ovuMiCp4@tFBbtWxNbaSx48mcHUK5RivCqS7Q0LrcAbvGm81r@9rycO2NV0fW8z7qiZpZOCGlMu6d9Afy7Y3/v@q9QiAQ30m/cvr6Zl@7wvKdPF/@f2qVnzZVX1X8 "PowerShell Core – Try It Online")
Takes an integer and returns a boolean
```
($u=2..($n-1)|?{!($n%($a=$_)        # finds the factors of the input
-or(2..($a-1)|?{!($a%$_)}))})       # keep them only if they are prime
|?{$n-match(("$_"|% t*y)-join'.*')} # add a .* between each digits of each prime factors and check if they match the input
.Count-eq$u.count-and$u             # Check that the input has factors and that they all match the input
```
]