<commit_before><commit_msg>*** empty log message ***<commit_after>/* The Computer Language Shootout
   http://shootout.alioth.debian.org

   contributed by <NAME> */

Sequence pad := method(w, s:=self; while (s size < w, s=" ".. s) )

sieve := Object clone do(
    flags := Sequence clone
    show := method(n,
        flags setSize(n)
        for (i, 2, n-1, flags atPut(i, 1))  # true
        primes := 0
        for (i, 2, n-1,
            if (flags at(i) == 1,
                primes = primes + 1
                j := i + i
                while (j < n,
                    flags atPut(j, 0)
                    j = j + i
                )
            )
        )
        writeln("Primes up to", n asString pad(9), primes asString pad(9))  
    )
)

n := args at(0) asNumber
sieve show(10000 shiftLeft(n))
sieve show(10000 shiftLeft(n-1))
sieve show(10000 shiftLeft(n-2))
{'fraction_non_alphanumeric': 0.1382857142857143, 'fraction_numerical': 0.03314285714285714, 'mean_word_length': 1.6788990825688073, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7020506', 'n_tokens_mistral': 318, 'n_tokens_neox': 286, 'n_words': 89}