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.
%I A348424 #57 Mar 22 2025 08:43:35 %S A348424 1,1,1,1,2,4,1,1,1,3,8,8,6,7,1,13,1,1,11,5,7,1,14,22,2,2,25,21,3,19, %T A348424 13,7,18,84,18,2,3,48,14,7,3,5,34,8,89,20,91,64,17,27,12,35,15,8,5,3, %U A348424 23,6,9,16,34,6,2,15,3,6,15,15,85,32,151,17,16,1,8,5,102,22,17,35,49 %N A348424 a(n) is the difference between the index of the prime p = A035345(n)-A002110(n) and n, or 0 if the difference is composite. %C A348424 The sequence relates to the number of iterations to reach the primes of A035345 (0 if composite) from the terms of A002110. The mechanism evaluates primality of P# + prime offset, where offset begins above the largest prime factor, increasing until a prime is encountered. The first term (n=0) is just the trivial case of 2 added to A002110(0)=1, producing prime=3. Adjacent primes are not treated by the mechanism. %C A348424 Considering the primorials to length 2000 digits, the average and maximum iteration respectively are approximately 149 and 1707. As might be expected, both values increase as larger primorials are considered. However, the 303rd term = 3 for example, so it is sometimes possible to produce primes of a desired size within a few iterations. %C A348424 Conjecture 1: The mechanism always returns a prime in a finite number of iterations (term always exists). So the sequence would be infinite. %C A348424 Conjecture 2: Terms will always be less than the associated offset. (So for n=33, the base primorial is 72047817630210000485677936198920432067383702541010310, with largest pf=137. The entry of 84 is less than 137.) %e A348424 A002110(7) = 510510 whose next prime is 510529. 510529 - 510510 = 19 which is the 8th prime, so a(7) = 8 - 7 = 1. %e A348424 A002110(9) = 223092870 = 2*3*5*7*11*13*17*19*23. We evaluate 223092870 + 29, 223092870 + 31 then 223092870 + 37 is prime, so a(9) = 3. %o A348424 (GAP) %o A348424 # GAP 4.11.1 %o A348424 mySeq:= [];;ptr:=1;;prodd:=1;;while ptr<169 do tcnt:=0;;prodd:=prodd*Primes[ptr];;z:= Primes[ptr];;repeat tcnt:=tcnt+1;;z:= NextPrimeInt(z);;until IsPrime (prodd+z);Add(mySeq,tcnt);ptr:=ptr+1;;od;Print(mySeq); %o A348424 (PARI) P(n) = prod(i=1, n, prime(i)); \\ A002110 %o A348424 Q(n) = nextprime(P(n)+2); \\ A035345 %o A348424 a(n) = my(x=Q(n)-P(n)); if (isprime(x), primepi(x) - n, 0); \\ _Michel Marcus_, Nov 15 2021 %Y A348424 Cf. A002110, A035345. %K A348424 nonn %O A348424 0,5 %A A348424 _Bill McEachen_, Nov 04 2021 %E A348424 More terms from _Michel Marcus_, Nov 16 2021