Möbius function: Difference between revisions

Content deleted Content added
Mr Dalien (talk | contribs)
Mr Dalien (talk | contribs)
Line 142: Line 142:


cálculo de Mobius (n)
cálculo de Mobius (n)
si( #(n==1) )
si( #(n==1) ); tomar '" 1"'
sino; p=0
tomar '" 1"'
iterar para (i=1, #(i<=n+1), ++i)
sino
p=0
iterar para (i=1, #(i<=n+1), ++i)
si ( #( iszero(n%i) && isprime(i)) )
si ( #( iszero(n%i) && isprime(i)) )
cuando ( #( iszero(n%(i*i)) ) ){
cuando ( #( iszero(n%(i*i)) ) ){
tomar '" 0"'
tomar '" 0"'; ir a (herejía) /* ¡! */
ir a (salida hereje) /* ¡! */
} ++p
} ++p
fin si
fin si
siguiente
siguiente
tomar si ( es impar(p), " -1", " 1" )
tomar si ( es impar(p), " -1", " 1" )
fin si
fin si


/* ¡Dios! ¡Purifica esta mierda! ----+ */
/* ¡Dios! ¡Purifica esta mierda! ----+ */
/* | */
/* | */
salida hereje: /* <------------------+ */
herejía: /* <----------------------+ */
retornar
retornar
</syntaxhighlight>
</syntaxhighlight>