cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A192503 Ludic prime numbers.

This page as a plain text file.
%I A192503 #17 Dec 10 2021 11:34:41
%S A192503 2,3,5,7,11,13,17,23,29,37,41,43,47,53,61,67,71,83,89,97,107,127,131,
%T A192503 149,157,173,179,181,193,211,223,227,233,239,257,277,283,307,313,331,
%U A192503 337,353,359,383,389,397,419,421,431,433,463,467,503,509,541,577
%N A192503 Ludic prime numbers.
%H A192503 Reinhard Zumkeller, <a href="/A192503/b192503.txt">Table of n, a(n) for n = 1..1000</a>
%F A192503 A010051(a(n))*A192490(a(n)) = 1.
%t A192503 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];
%t A192503 ludicQ[n_, nmax_] /; 1 <= n <= nmax := MemberQ[a3309[nmax], n];
%t A192503 terms = 1000;
%t A192503 f[nmax_] := f[nmax] = Select[Range[nmax], ludicQ[#, nmax] && PrimeQ[#]&] // PadRight[#, terms]&;
%t A192503 f[nmax = terms];
%t A192503 f[nmax = 2 nmax];
%t A192503 While[f[nmax] != f[nmax/2], nmax = 2 nmax];
%t A192503 seq = f[nmax] (* _Jean-François Alcover_, Dec 10 2021, after _Ray Chandler_ in A003309 *)
%o A192503 (Haskell)
%o A192503 a192503 n = a192503_list !! (n-1)
%o A192503 a192503_list = filter ((== 1) . a010051) a003309_list
%o A192503 (PARI) A192503(maxn,bflag=0)={my(Vw=vector(maxn, x, x+1), Vl=Vec([1]), vwn=#Vw,i,vj,L=List());
%o A192503 while(vwn>0, i=Vw[1]; Vl=concat(Vl,[i]);
%o A192503       Vw=vector((vwn*(i-1))\i,x,Vw[(x*i+i-2)\(i-1)]); vwn=#Vw);
%o A192503 kill(Vw); vwn=#Vl;
%o A192503 for(j=1,vwn, vj=Vl[j]; if(isprime(vj),listput(L,vj))); kill(Vw); vwn=#L;
%o A192503 if(bflag, for(i=1,vwn, print(i," ",L[i]))); if(!bflag, return(Vec(L)));
%o A192503 } \\ _Anatoly E. Voevudko_, Feb 28 2016
%Y A192503 Intersection of A000040 and A003309.
%Y A192503 Cf. A010051, A192490.
%Y A192503 Cf. A192506 (neither ludic nor prime).
%K A192503 nonn
%O A192503 1,1
%A A192503 _Reinhard Zumkeller_, Jul 05 2011