Subdomain Posts
C# | 476 days ago
None | 492 days ago
None | 492 days ago
Lisp | 508 days ago
None | 511 days ago
Python | 513 days ago
Lisp | 513 days ago
Lisp | 513 days ago
None | 545 days ago
None | 580 days ago
Recent Posts
Python | 20 sec ago
Python | 23 sec ago
None | 27 sec ago
HTML | 36 sec ago
mIRC | 43 sec ago
None | 47 sec ago
None | 49 sec ago
None | 51 sec ago
C# | 51 sec ago
Bash | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By free-zombie on the 27th of Oct 2008 10:37:56 PM
Download |
Raw |
Embed |
Report
(defun with-unique-digits (to)
(let ((ndigits (ceiling (log to 10))))
(find-uniques to () ndigits 0)
))
(defun find-uniques (max forbidden ndigits add)
(cond
((> add max) ())
((= ndigits 0) (list add))
(t (append
(if (member 0 forbidden) ()
(find-uniques max (and forbidden (cons 0 forbidden)) (1- ndigits) add))
(loop for i from 1 to 9
append (if (member i forbidden) ()
(find-uniques max (cons i forbidden) (1- ndigits)
(+ add (* i (expt 10 (1- ndigits))))))
)
))
))
Submit a correction or amendment below.
Make A New Post