Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
3
votes
Tuples of digits with a given number of distinct elements
False]
Usage:
Table[Select[Range[10^(k - 1), 10^k - 1], validQ[#, k] &], {k, 2, 4}]
This will suffer from memory allocation failure at k=10 but you can rephrase your problem so this generation of tuples … Each of these tuples represents an integer and there is no need to ever store integers. …
4
votes
Working with tables: add new level of nested tables
One possible implementation could be:
getCombinations[n_Integer] := Module[{t},
t = Select[Tuples[Range[n, 0, -1], {n}], Total@# == n &];
Map[Times @@ Power[ToExpression /@Alphabet[][[1 ;; n]], #] … ^3 d,b^2 c^2,b^2 c d,b^2 d^2,b c^3,b c^2 d,b c d^2,b d^3,c^4,c^3 d,c^2 d^2,c d^3,d^4\right\}$$
EDIT
To make it more general:
getCombinationsFromFactors[n_Integer, k_List] := Module[{t},
t = Select[Tuples …