I use [Tcl] as my scripting language of choice, and recently someone asked me why. This article is an attempt to answer that question.
Ousterhout's dichotomy claims that there are two general categories of programming languages:
"latex-workshop.latex.tools": [ | |
{ | |
"name": "texify", | |
"command": "texify", | |
"args": [ | |
"--synctex", | |
"--pdf", | |
"--interaction=nonstopmode", | |
"--file-line-error", | |
"%DOC_EXT%" |
Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
for k in 1:1000000 | |
isprime(k) | |
end |
const ConjuntoPrimos=Set(2, 3, 5, 7, 11, 13, 17, 19, | |
23, 29, 31, 37, 41, 43, 47, 53, | |
59, 61, 67, 71, 73, 79, 83, 89, | |
97, 101, 103, 107, 109, 113, 127, 131, | |
137, 139, 149, 151, 157, 163, 167, 173, | |
179, 181, 191, 193, 197, 199, 211, 223, | |
227, 229, 233, 239, 241, 251, 257, 263, | |
269, 271, 277, 281, 283, 293, 307, 311, | |
313, 317, 331, 337, 347, 349, 353, 359, | |
367, 373, 379, 383, 389, 397, 401, 409, |
ConjuntoPrimos={\ | |
2, 3, 5, 7, 11, 13, 17, 19,\ | |
23, 29, 31, 37, 41, 43, 47, 53,\ | |
59, 61, 67, 71, 73, 79, 83, 89,\ | |
97, 101, 103, 107, 109, 113, 127, 131,\ | |
137, 139, 149, 151, 157, 163, 167, 173,\ | |
179, 181, 191, 193, 197, 199, 211, 223,\ | |
227, 229, 233, 239, 241, 251, 257, 263,\ | |
269, 271, 277, 281, 283, 293, 307, 311,\ | |
313, 317, 331, 337, 347, 349, 353, 359,\ |
const ListaPrimos=[2, 3, 5, 7, 11, 13, 17, 19, | |
23, 29, 31, 37, 41, 43, 47, 53, | |
59, 61, 67, 71, 73, 79, 83, 89, | |
97, 101, 103, 107, 109, 113, 127, 131, | |
137, 139, 149, 151, 157, 163, 167, 173, | |
179, 181, 191, 193, 197, 199, 211, 223, | |
227, 229, 233, 239, 241, 251, 257, 263, | |
269, 271, 277, 281, 283, 293, 307, 311, | |
313, 317, 331, 337, 347, 349, 353, 359, | |
367, 373, 379, 383, 389, 397, 401, 409, |
# Ahora procedemos con una criba basada en una tabla precalculada | |
# (Por ejemplo, una tabla precalculada hasta 10000 serviría para | |
# cribar más eficientemente hasta cien millones) | |
# Obsérvese que esta criba permite encontrar todos los primos | |
# hasta un millón en unos cuantos segundos. Si el resultado se almacena | |
# y se usa como nueva tabla, se puede decidir la primalidad | |
# de cualquer número hasta 1000000000000 (un billón). | |
from itertools import * |
import math | |
def EsPrimo(n): | |
if n<2: return False | |
if n==2 or n==3 : return True | |
sq=math.ceil(math.sqrt(n)) | |
for k in range(2,sq+1): | |
if n%k ==0: return False |