Skip to content

Instantly share code, notes, and snippets.

@kana
Created October 31, 2012 09:33
Show Gist options
  • Save kana/3986088 to your computer and use it in GitHub Desktop.
Save kana/3986088 to your computer and use it in GitHub Desktop.
:function! F()
let xs = [2]
let i = 3
while len(xs) < 100
if empty(filter(copy(xs), 'i % v:val == 0'))
call add(xs, i)
endif
let i += 1
endwhile
put =xs
1 delete
endfunction
:call F()
:wq
:fu F()
let s=[2]
let i=3
wh len(s)<100
if empty(filter(copy(s),'i%v:val==0'))
cal add(s,i)
en
let i+=1
endw
pu=s
1d
endf
:cal F()
ZZ
:pu=filter(range(2,541),'filter(range(2,v:val-1),v:val.''%v:val==0'')==[]')|1d
ZZ
:pu=filter(range(2,541),'repeat(''x'',v:val)!~''\v^(xx+)\1+$''')|1d
ZZ
:pu=filter(range(2,541),'repeat(8,v:val)!~''\v^(88+)\1+$''')|1d
ZZ
:pu=map(range(2,541),'repeat(8,v:val)')|g/\v^(88+)\1+$/d
qaC=len(@-)
k0q99@addZZ
SxxqaYpAxq540@a:g/\v^(xx+)\1+$/d
qbC=len(@-)
k0q99@bZZ
S qa>>Ypq540@a:g/\v^( +)\1+$/d
qb0C=len(@-)
kq99@bZZ
S 0qa>>Ypq540@a:g/\v^( +)\1+0/d
qb/
xq99999@bZZ
S 1qa>>Ypq540@a:g/\v^( +)\1+\d/d
:%s/ //g|wq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment