OFFSET
1,1
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
MATHEMATICA
a3309[nmax_] := a3309[nmax] = Module[{t = Range[2, nmax], k, r = {1}}, While[Length[t] > 0, k = First[t]; AppendTo[r, k]; t = Drop[t, {1, -1, k}]]; r];
ludicQ[n_, nmax_] /; 1 <= n <= nmax := MemberQ[a3309[nmax], n];
terms = 1000;
f[nmax_] := f[nmax] = Select[Range[nmax], ludicQ[#, nmax] && PrimeQ[#]&] // PadRight[#, terms]&;
f[nmax = terms];
f[nmax = 2 nmax];
While[f[nmax] != f[nmax/2], nmax = 2 nmax];
PROG
(Haskell)
a192503 n = a192503_list !! (n-1)
a192503_list = filter ((== 1) . a010051) a003309_list
(PARI) A192503(maxn, bflag=0)={my(Vw=vector(maxn, x, x+1), Vl=Vec([1]), vwn=#Vw, i, vj, L=List());
while(vwn>0, i=Vw[1]; Vl=concat(Vl, [i]);
Vw=vector((vwn*(i-1))\i, x, Vw[(x*i+i-2)\(i-1)]); vwn=#Vw);
kill(Vw); vwn=#Vl;
for(j=1, vwn, vj=Vl[j]; if(isprime(vj), listput(L, vj))); kill(Vw); vwn=#L;
if(bflag, for(i=1, vwn, print(i, " ", L[i]))); if(!bflag, return(Vec(L)));
} \\ Anatoly E. Voevudko, Feb 28 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jul 05 2011
STATUS
approved