[Question]
  [
Given a number `n` and an upper limit `l` list the numbers that can be created by multiplying two or more numbers consisting of **only sevens** of length `n` or less that are less than `l`. [A161145](http://oeis.org/A161145) is close to this challenge, however, you will NOT be including the 7, 77, 777, 7777, 77777, etc..
# Examples
**`n=anything, l<49` would result in:**
```
[]
```
**`n=1, l=49` would result in:**
```
7*7=49
f(1,49)=[49]
```
**`n=1, l=343` would result in:**
```
7*7   =49
7*7*7 =343
f(1,343)=[49,343]
```
**`n=2,l=6000` would result in:**
```
7*7    =49
7*7*7  =343
7*7*7*7=2401
7*77   =539
7*7*77 =3773
77*77  =5929
f(2,6000)=[49,343,539,2401,3773,5929]
```
**`n=3, l=604000` would result in:**
```
[49, 343, 539, 2401, 3773, 5439, 5929, 16807, 26411, 38073, 41503, 59829, 117649, 184877, 266511, 290521, 418803, 456533, 603729]
```
Etc...
# Rules
1. You **do not** have to output intermediate steps, this was done for clarity.
2. Output can be as an array or separated by any character (even newlines).
3. Output must be in numerical order, lowest to highest.
4. To make the title relevant, highest `n` that must be handled is `n=77` (if you can't handle that high, note why - language restrictions are acceptable, laziness is not). This limitation is to hinder those looking to build the entire superset in memory.
5. If TIO cannot run `n=77` for your code, explain what specs were required to achieve `n=77`.
6. For a product to be valid it must consist of at least 2 numbers.
7. This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") lowest byte-count will be deemed victorious.
8. You may choose the list to contain items less than `l` or less than/equal to `l`.
9. **BONUS**: If your code is exactly 77 bytes, kudos from me; worthless, I know.
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~21~~ ~~20~~ ~~19~~ 18 bytes
```
R7ẋḌµ;ŒċP€⁹f€FµÐLḟ
```
Note that the output doesn't match the OP's. I've left a comment.
[Try it online!](https://tio.run/nexus/jelly#@x9k/nBX98MdPYe2Wh@ddKQ74FHTmkeNO9OAlNuhrYcn@DzcMf/////G/80MTAwMDAA "Jelly – TIO Nexus")
### How it works
```
R7ẋḌµ;ŒċP€⁹f€FµÐLḟ  Main link. Left argument: n. Right argument: l
R                   Range; yield [1, ..., n].
 7ẋ                 Times; yield [[7], ..., [7] * n].
   Ḍ                Undecimal; yield s := [7, 77, ...].
    µ         µÐL   Begin a new chain with argument s and call the chain between 
                    until the results no longer chain.
                    Return the last unique result.
      Œċ            Combinations; return all unordered pairs in integers in the
                    return value.
     ;              Concatenate the return value and its pairs.
        P€          Take the product of each individual integer and each pair in
                    the result.
          ⁹f€       Filter each; for each j in [1, ..., l], intersect [j] with the
                    array of products. The result is sorted and contains no 
                    duplicates.
                 ḟ  Filterfalse; remove the elements of s from the result.
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~116~~ ~~113~~ 109 bytes
```
n,l=input()
r=t={1}
exec't|={10**n/9*7};n-=n>1;r=r|{x*y for x in r for y in t if l/x/y};'*l
print sorted(r-t)
```
Note that TIO doesn't have enough memory for the last test case.
[Try it online!](https://tio.run/nexus/python2#HcZLCoMwEADQfU4xO3VQErtoKWG8TBshEEaZTiFBc/b081av8Zgo8v7WfjBCSsdcTcjh0en5vUNke8db9TwRL7MXkvPIWGDdBDJEBvm3/KoQV0g221J9h8nsElnhtYmGZy@TDq1dRrg65z4 "Python 2 – TIO Nexus")
[Answer]
## JavaScript (ES6), ~~103~~ 101 bytes
Takes input in currying syntax `(n)(l)`.
```
n=>l=>(a=[],g=(n,m,p,i)=>(p>l||g(n,m,(a[i>1?p:a]=p)*m,-~i),--n?g(n,m+7,p,i):a.filter(n=>n)))(n,'7',1)
```
### Test cases
The last test case may take a few seconds to complete.
```
let f =
n=>l=>(a=[],g=(n,m,p,i)=>(p>l||g(n,m,(a[i>1?p:a]=p)*m,-~i),--n?g(n,m+7,p,i):a.filter(n=>n)))(n,'7',1)
console.log(f(1)(49))
console.log(f(1)(343))
console.log(f(2)(6000))
console.log(f(3)(604000))
```
[Answer]
# PHP, 142 Bytes
```
$r=[];for([,$n,$l]=$argv;$n--;)f($v[]=$z.=7);function f($t){global$v,$l,$r;while($c=$t*$v[+$i++])$l<$c?:f($c)&$r[$c]=$c;}sort($r);print_r($r);
```
-5 Bytes removing `$r=[];` and replace `sort($r);` with `@sort($r);`
[Online Version](http://sandbox.onlinephpfunctions.com/code/a65d4abd194ccf6032ce3764f4b027fe469d491e)
Expanded
A recursive function make all permutations including the limit
```
$r=[];
for([,$n,$l]=$argv;$n--;)
  f($v[]=$z.=7);
function f($t){
    global$v,$l,$r;
    while($c=$t*$v[+$i++])
      $l<$c?:f($c)&$r[$c]=$c;
}
sort($r);
print_r($r);
```
PHP, 145 Bytes
```
for([,$n,$l]=$argv;$n;)$t[]=str_pad(7,$n--,7);for(;$l>=$i+=49;$v>1?:$u[]=$r)for($v=$i,$r=!$c=0;$d=$t[$c];)$v%$d?$c++:($v/=$d)&$r*=$d;print_r($u);
```
Expanded
a loop till including the limit
check every value that is divisible by 49
```
for([,$n,$l]=$argv;$n;)
  $t[]=str_pad(7,$n--,7);
for(;$l>=$v=$i+=49;$v>1?:$u[]=$r)
  for($r=!$c=0;$d=$t[$c];)
    $v%$d?$c++:($v/=$d)&$r*=$d;
print_r($u);
```
[Online Version](http://sandbox.onlinephpfunctions.com/code/4546b26d83b5fff5d384b0dc7a579e2fdbfd5757)
a few bytes more and an associative array can be created
key the number and as value an array of the used sevens
```
for([,$n,$l]=$argv;$n;)
  $t[]=str_pad(7,$n--,7);
for(;$l>=$v=$i+=49;$v>1?:$u[array_product($r)]=$r)
  for($r=[],$c=0;$d=$t[$c];)
    $v%$d?$c++:($v/=$d)&$r[]=$d;
print_r($u);
```
[Online Version](http://sandbox.onlinephpfunctions.com/code/ee6891be780577cbf373848c4b2dca782ff0ce7e)
[Answer]
# Ruby, ~~89~~ 86 bytes
A recursive solution.
-3 bytes by remembering that anything times 0 is 0.
```
f=->n,l,b=1{n*l>0?(f[n,l/k=eval(?7*n),b*k]+f[n-1,l,b]+(b>1&&l>=k ?[k*b]:[])).sort: []}
```
[Try it online!](https://tio.run/nexus/ruby#HY3BCgIhFADvfcU7ibquKUWBoH6ISKywG4vmLildom836zoMM23Ro8kssaDlO9NkhMWL6@AY9fyaErZXmgkLNPqh81H@VD/gYCRCyegI1kUavHKeEF62Z1Xg/Kf1Ami4z7Xwsqe18se0A1J1u62HHf4H305wEWchxBc "Ruby – TIO Nexus")
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 22 bytes
```
JsM._*\7Eu@s*LR+JGJSQJ
JsM._*\7E
        E               second input
     *\7                repeat "7" as many times as the above
   ._                   all prefixes of above
 sM                     convert each to integer
J                       store list as J
         u@s*LR+JGJSQJ
         u              repeat the following until results not unique
                     J  starting from G = J
                        at each iteration, G is the current value
               +JG      append G to J
                  J     J
            *LR         multiply the elements of the above two, vectorizing each
           s            flatten list
          @        SQ   intersect with [1,2,3,...,first input]
                        this takes elements from [1,2,3,...,first input] and
                        check if each element is in the previous list
                        which ensures the result is sorted and unique
```
[Try it online!](http://pyth.herokuapp.com/?code=JsM._%2a%5C7Eu%40s%2aLR%2BJGJSQJ&input=6000%0A2&debug=0)
## Specs
* Input: `l[newline]n`
* Output: `array containing the sorted result`
[Answer]
# PHP, ~~128 125 130 129 127~~ 123 bytes
will work up to 22 `7`s but will round larger values (7\*\*23 is floating point on a 64 bit machine).
3 bytes saved by Jörg, 3 by me, ~~5 4~~ 1 added to avoid warning for empty results.
```
for([,$c,$z]=$argv,$n=$c+1;$c<$z;$p<$z&&$r[$p]=$p)for($b=$c+=$p=1;$b|0;$b/=$n)$p*=str_pad(7,$b%$n,7);@sort($r);print_r($r);
```
takes input from command line arguments; run with `-nr` or [try it online](http://sandbox.onlinephpfunctions.com/code/f2b1f71dc5e9e1eb56c7478c639c126edcd1f3ef).
**breakdown**
```
for([,$c,$z]=$argv,$n=$c+1;         # $z=L, $n=N+1
    $c<$z;                          # loop $c from N to L-1:
    $p<$z&&$r[$p]=$p                    # 2. if product is < L, add to array
)                                       #    (key=val to avoid duplicates)
    for($b=$c+=$p=1;$b|0;$b/=$n)        # 1. loop $b through ++$c as base-N+1 number
        $p*=str_pad(7,$b%$n,7);             # take each base-N+1 digit as length
                                            # for a streak of 7s as factor
        // (str_pad is 1 byte shorter than str_repeat and saves 3 by ensuring positive $p)
@sort($r);                          # sort array (muted to avoid warning for empty result)
print_r($r);                        # print array
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 28 bytes
```
h>.ḋ{p~c×ᵐ{=h7&l}ᵐobt≤~t?∧!}
```
There's a lot of scope for improvement in the language itself, here; quite a few things I wrote look like they'd be obviously improvable with some changes to the language's design. This is the shortest way I've found with the current version. I may well make some suggestions for Brachylog which would make this program more efficient, shorter, and more readable.
Very, very slow; TIO times out even on the simplest possible nontrivial answer, so there's not much point in providing a TIO link. I've verified this program by running it locally.
This is a function (not a full program), whose output is a generator (as opposed to a list). Add `.w⊥` to the end of the function if you want to see all outputs, rather than just the first. (Note that this doesn't really matter in practice, because as the program is too slow for TIO anyway, you have to run it locally, and the local Brachylog interpreter runs in a REPL which can describe a generator just fine.)
## Explanation
```
h>.ḋ{p~c×ᵐ{=h7&l}ᵐobt≤~t?∧!}
  .                           The desired output is
h>                            a number less than the first input
   ḋ p                        such that taking its prime factors in some order,
      ~c                      partitioning them,
        ×ᵐ                    and taking the product of each partition
          {     }ᵐ            produces a number for which each digit
           =h7                is composed only of 7s
              &l              and for which the lengths of those numbers
                  o           are in sorted order
                    t         and the last element
                   b          (which is not also the first element)
                     ≤        is less than or equal to
                      ~t?     the last input.
                         ∧    (Delete an unwanted implicit constraint.)
   ḋ{                     !}  Output each number only once.
```
[Answer]
# Bash + GNU utilities, 108
```
seq -f3o%gp $2|dc|sed -r "/0|1{$1}/d;s/./&7/g;s/1//g;s/2/*/g;/[*]/!d;s/^/a=7/;s/$/;if(a<=$2)a;/"|bc|sort -un
```
[Try it online](https://tio.run/nexus/bash#NY5BDoIwEEX3nmJsqlGSOi0QiVYS72E0qbQgG6oUV9az40DibN7Ln8zP1L6HwYWhMsFB2wFTkB/YhCzPiCnspZQkGUk@qQbrF0AT3ABCAP@fz6GrHn4uBMbP7DgG9wJRZ37VPIGn0VYxOAuiB4Yyqg9XX7Q64A7XBTYkCmekmBDxklxxOe1vaMoCSTjqtt6YU8nTrdHI4p0afU@fvLvR@s6NPw). TIO takes about a minute for the last testcase. My [results match](https://codegolf.stackexchange.com/questions/117637/seventy-seven-sevens#comment287866_117637) @Dennis's.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 19 bytes
```
L7×1¸ì©IF®âPD²‹Ïê®K
```
[Try it online!](https://tio.run/nexus/05ab1e#ATAAz///TDfDlzHCuMOswqlJN3ptw65Gwq7DolBEwrLigLnDj8Oqwq5L//83Nwo2MDQwMDA "05AB1E – TIO Nexus")
**Explanation**
Very inefficient. TIO link performs `ceil(l^(1/7))` iterations instead of the `l` iterations used in the golfed version to easier test large testcases.
```
L7×                   # create the list ['7', '77', '777' ...] 
                      # with the final item having n 7's 
   1¸ì©               # prepend a 1 and store a copy in register
       IF             # l times do:
         ®â           # cartesian product between current list and the list in register 
           P          # product of each sublist
            D²‹Ï      # keep only numbers smaller than l
                ê     # remove duplicates and sort
                 ®K   # remove 1, 7, 77, 777 ... from the list
```
[Answer]
# Pyth -- ~~57~~ ~~51~~ ~~49~~ 42 bytes
```
FY}2eQKYJv*\7hQWJIqYJBW!%KJ=/KJ)=/JT)Iq1KY
```
[Try it](http://pyth.herokuapp.com/?code=FY%7D2eQKYJv%2a%5C7hQWJIqYJBW%21%25KJ%3D%2FKJ%29%3D%2FJT%29Iq1KY&input=3%2C9999&debug=0)
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~94~~ ~~91~~ 88 bytes
```
n=>l=>(X=[]).filter(g=(i,j=1,k)=>j>l|i[n]||(X[g(i+7,j,k)|g(i,j*i,-~k),k>1&&j]=j),l=g`7`)
```
[Try it online!](https://tio.run/##ZcpNCoMwEEDhfQ8iM20UbaRSyuQcggiK1ZAfkqLSVejV09pttt97enyP27Sq1547/5zjQtGRsCSgpa7HYlF2n1eQBIppqphBElrYoDrXhwBtJ0FdGqZ/IcjjOSuWfwwyI6os0z1pZJbk0AwYH6fJu83bubBewgIVQn1HTJXXPOErwq0sy8T54fW/xC8 "JavaScript (Node.js) – Try It Online")
```
n=>l=>         // input
(X=[]).filter( // X stores index=results
g=(i,j=1,k)=>  // recurse             Reuse of g for filter:
j>l|i[n]||     // out of range        49>1|49[n] (true)
(X[g(i+7,j,k)|g(i,j*i,-~k),k>1&&j]=j)
               // k<=1: X[false]=j, ignored
               // k>1: X[j]=j
,l=g`7`)       // First call [0/1]|[0/1]||1 ==1
```
]