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.

A073324 Smallest x such that prime(x) mod c(x) = n, where prime(j) is the j-th prime, c(j) is the j-th composite number.

This page as a plain text file.
%I A073324 #26 Nov 26 2022 12:29:25
%S A073324 5,1,2,8,3,242,4,245,100,8313,10,50190,23,8338,3390,12,24,308926,13,
%T A073324 49,25,15,26,12556637,112,55,117,58,56,1400,59,265,122,267,31,
%U A073324 12556641,603,270,33,12556639,126,272,65,66,127,63,35,50270,37,1413,129,1434,38,1411
%N A073324 Smallest x such that prime(x) mod c(x) = n, where prime(j) is the j-th prime, c(j) is the j-th composite number.
%H A073324 Giovanni Resta, <a href="/A073324/b073324.txt">Table of n, a(n) for n = 1..400</a>
%F A073324 a(n) = Min{x; A000040(x) mod A002808(x) = n} = Min{x; A065859(x) = n}.
%e A073324 x=10: p(10)=29,c(10)=18, Mod[29,18]=11 appears first here, so a(11)=10.
%t A073324 f[x_] := Mod[Prime[x], FixedPoint[x+PrimePi[ # ]+1&, x]] t=Table[0, {256}]; Do[s=f[n]; If[s<257&&t[[s]]==0, t[[s]]=n], {n, 1, 400000}]; t
%t A073324 Module[{nn=500000,cmps,prs,len},cmps=Select[Range[nn],CompositeQ];len= Length[ cmps];Table[SelectFirst[Thread[{Range[len],Prime[Range[len]],cmps}],Mod[#[[2]], #[[3]]] ==n&],{n,23}]][[All,1]] (* The program generates the first 23 terms of the sequence. *) (* _Harvey P. Dale_, Nov 26 2022 *)
%o A073324 (PARI) isc(n) = (n != 1) && !isprime(n);
%o A073324 lista(nn) = {my(vp = primes(nn), vc = select(x->isc(x), [1..nn])); for (n=1, 50, my(k=1); while((vp[k] % vc[k]) != n, k++; if ((k>#vp) || (k>#vc), return)); print1(k, ", "););} \\ _Michel Marcus_, Sep 02 2019
%o A073324 (PARI) a(n) = my(p=2); forcomposite(c=4, oo, if(p % c == n, return(primepi(p))); p = nextprime(p+1)); \\ _Daniel Suteu_, Sep 02 2019
%Y A073324 Cf. A000040, A002808, A065859, A073325, A073326.
%K A073324 nonn
%O A073324 1,1
%A A073324 _Labos Elemer_, Jul 30 2002
%E A073324 a(24)-a(50) from _Michel Marcus_, Sep 02 2019
%E A073324 More terms from _Giovanni Resta_, Sep 03 2019