Ludic numbers: Difference between revisions

Content added Content deleted
(→‎{{header|Elixir}}: used in operator)
m (→‎{{header|PARI/GP}}: editing lang tags)
Line 1,279: Line 1,279:
===Version #1. Creating vector of ludic numbers' flags, where the index of each flag=1 is the ludic number.===
===Version #1. Creating vector of ludic numbers' flags, where the index of each flag=1 is the ludic number.===


<lang PARI/GP>
<lang parigp>
\\ Creating Vlf - Vector of ludic numbers' flags,
\\ Creating Vlf - Vector of ludic numbers' flags,
\\ where the index of each flag=1 is the ludic number.
\\ where the index of each flag=1 is the ludic number.
\\ 2/28/16 aev
ludic(maxn)={my(Vlf=vector(maxn,z,1),n2=maxn/2,k,j1);
ludic(maxn)={my(Vlf=vector(maxn,z,1),n2=maxn/2,k,j1);
for(i=2,n2,
for(i=2,n2,
Line 1,328: Line 1,329:
Upgraded script from [http://oeis.org/A003309 A003309] to meet task requirements.
Upgraded script from [http://oeis.org/A003309 A003309] to meet task requirements.


<lang PARI/GP>
<lang parigp>
\\ Creating Vl - Vector of ludic numbers.
\\ Creating Vl - Vector of ludic numbers.
\\ 2/28/16 aev
ludic2(maxn)={my(Vw=vector(maxn, x, x+1),Vl=Vec([1]),vwn=#Vw,i);
ludic2(maxn)={my(Vw=vector(maxn, x, x+1),Vl=Vec([1]),vwn=#Vw,i);
while(vwn>0, i=Vw[1]; Vl=concat(Vl,[i]);
while(vwn>0, i=Vw[1]; Vl=concat(Vl,[i]);