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 A382785 #53 May 10 2025 11:29:50 %S A382785 4,6,30,420,2310,180180,4084080,106696590,892371480,103515091680, %T A382785 4412330782860,29682952539240,22514519501013540,313986271960080720, %U A382785 22750921955774182170,912496437361321252440,26918644902158976946980,1290172194953476680815970,1901713815361424627522739780 %N A382785 a(n) is the least multiple of the n-th primorial such that both a(n)-1 and a(n)+1 are prime and the prime factors of a(n) do not exceed prime(n). %C A382785 a(n) is the smallest multiple k of the n-th primorial, prime(n)#, such that both k-1 and k+1 are prime and the prime factors of m = k/prime(n)# do not exceed prime(n). %C A382785 From _Michael S. Branicky_, Apr 19 2025: (Start) %C A382785 a(n) first differs from A060255(n) + 1 at n = 29. %C A382785 a(349) has 1001 digits. (End) %H A382785 Michael S. Branicky, <a href="/A382785/b382785.txt">Table of n, a(n) for n = 1..348</a> %e A382785 For a(2), (2*3)*1 = 6 and the first twin primes are 5, 7. %e A382785 For a(3), (2*3*5)*1 = 30 and the first twin primes are 29, 31. %e A382785 For a(4), (2*3*5*7)*2 = 420, the first twin primes are 419, 421 and 2 <= prime(4). %e A382785 For a(5), (2*3*5*7*11)*1 = 2310 and the first twin primes are 3209, 3211. %e A382785 For a(6), (2*3*5*7*11*13)*2*3 = 180180. the first twin primes are 180179, 180181 and 2, 3 <= prime(6). %t A382785 a[n_] := Module[{P,k},P=Product[Prime[i],{i, 1, n}];k = 1; While[!(PrimeQ[k*P-1] && PrimeQ[k*P+1]), k++];k*P] (* _James C. McMahon_, May 09 2025 *) %o A382785 (Python) %o A382785 from itertools import count %o A382785 from sympy import factorint, isprime, prime, primorial %o A382785 def a(n): %o A382785 pn, prn = prime(n), primorial(n) %o A382785 return next(k for m in count(1) if max(factorint(m), default=1)<=pn and isprime((k:=m*prn)-1) and isprime(k+1)) %o A382785 print([a(n) for n in range(1, 20)]) # _Michael S. Branicky_, Apr 18 2025 %o A382785 (PARI) isok(k, p) = if (k>1, vecmax(factor(k)[,1])<=p, 1); %o A382785 a(n) = my(P=vecprod(primes(n)), k=1, p=prime(n)); while(!(isok(k, p) && ispseudoprime(k*P-1) && ispseudoprime(k*P+1)), k++); k*P; \\ _Michel Marcus_, Apr 27 2025 %Y A382785 Supersequence of A088256. %Y A382785 Cf. A000040, A002110, A060255, A060256, A088257. %K A382785 nonn %O A382785 1,1 %A A382785 _Rory Pulvino_, Apr 04 2025 %E A382785 Data corrected by _Michael S. Branicky_, Apr 18 2025