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 A141220 #21 Jul 18 2025 14:45:12 %S A141220 1,4,5,8,10,7,10,9,14,16,15,14,18,13,20,28,15,30,18,21,32,26,19,36,30, %T A141220 21,30,28,27,26,42,25,40,54,35,38,30,45,52,36,42,31,42,33,54,64,60,39, %U A141220 38,50,45,60,39,70,42,78,45,56,90,43,54,76,45,62,52,63,90 %N A141220 Write the n-th nonprime (A018252(n)) as a product of primes; increase one copy of the largest prime by 2 and decrease one copy of the smallest prime by 1, multiply the resulting numbers. %e A141220 1st nonprime = 1 (has no prime factors); a(1) = empty product = 1. %e A141220 2nd nonprime = 4 = (p(max)=2)*(p(min)=2); a(2) = (2+2)*(2-1) = 4*1 = 4. %e A141220 3rd nonprime = 6 = (p(max)=3)*(p(min)=2); a(3) = (3+2)*(2-1) = 5*1 = 5. %e A141220 4th nonprime = 8 = (p(max)=2)*(p=2)*(p(min)=2); a(4) = (2+2)*2*(2-1) = 4*2*1 = 8. %p A141220 A006530 := proc(n) if n = 1 then 1; else max(op(numtheory[factorset](n))) ; end if; end proc: %p A141220 A020639 := proc(n) if n = 1 then 1; else min(op(numtheory[factorset](n))) ; end if; end proc: %p A141220 A002808 := proc(n) if n = 1 then 4; else for a from procname(n-1)+1 do if not isprime(a) then return a; end if; end do; end if; end proc: %p A141220 A052369 := proc(n) A006530(A002808(n)) ; end proc: A056608 := proc(n) A020639(A002808(n)) ; end proc: %p A141220 A141220 := proc(n) if n = 0 then 1; else c := A002808(n) ; hi := A052369(n) ; lo := A056608(n) ; c*(hi+2)*(lo-1)/lo/hi ; end if; end proc: %p A141220 printf("1,") ; for n from 1 to 400 do a := A141220(n) ; if not isprime(a) then printf("%d,",a) ; end if; end do: # _R. J. Mathar_, Mar 29 2010 %t A141220 nonp[1]=1;i=1;Do[If[n-PrimePi[n]>i,nonp[i+1]=n;i++],{n,2,lim}];f[k_]:=k*(FactorInteger[k][[1,1]]-1)/FactorInteger[k][[1,1]]*(FactorInteger[k][[-1,1]]+2)/FactorInteger[k][[-1,1]];Join[{1},f/@Array[nonp,66,2]] (* _James C. McMahon_, Jul 18 2025 *) %K A141220 nonn %O A141220 1,2 %A A141220 _Juri-Stepan Gerasimov_, Aug 07 2008 %E A141220 Entry revised by _Jon E. Schoenfield_, Mar 09 2014, following revision of A141218 by _N. J. A. Sloane_