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 A131457 #13 Jan 28 2024 03:20:35 %S A131457 4,9,10,21,22,25,26,33,34,35,46,49,51,55,57,58,65,69,77,82,85,86,87, %T A131457 91,93,94,95,106,111,115,118,119,121,122,123,129,133,134,141,142,143, %U A131457 145,146,155,161,166,169,177,178,183,185,187,201,202,203,205,206,209,213 %N A131457 a(n+1) is the next semiprime such that a(n+1)-1 divides (a(1)...a(n))^2. %C A131457 This is to semiprimes A001358 as A007459 is to primes A000040. %e A131457 a(1) = 4 because 4 = 2^2 is the first semiprime. %e A131457 a(2) = 9 because 9 = 3^2 is the next semiprime after 4, where 9-1=8 divides 4^2 = 16. %e A131457 a(3) = 10 because 10 = 2*5 is the next semiprime after 9 where 10-9=9 divides (4*9)^2. %e A131457 a(4) = 21 because 21 = 3*7 is the next semiprime after 10, where 10-1=9 divides (4*9*10)^2. %e A131457 a(5) = 22 because 22 = 2*11 is the next semiprime after 21, where 21-1=20 divides (4*9*10*21)^2. %p A131457 isA001358 := proc(n) if numtheory[bigomega](n) = 2 then true ; else false; fi ; end: A131457 := proc(n) option remember ; local a,prevpr; if n =1 then 4; else prevpr := (mul(A131457(i),i=1..n-1))^2 ; a := A131457(n-1)+1 ; while not isA001358(a) or prevpr mod (a-1) <> 0 do a := a+1 ; od; RETURN(a) ; fi ; end: seq(A131457(n),n=1..80) ; # _R. J. Mathar_, Oct 30 2007 %t A131457 semiprimeQ[n_] := PrimeOmega[n] == 2; %t A131457 a[n_] := a[n] = Module[{k, prevpr}, If[n == 1, 4, prevpr = Product[a[i], {i, 1, n-1}]^2; k = a[n-1]+1; While[!semiprimeQ[k] || Mod[prevpr, k-1] != 0, k++]; Return[k]]]; %t A131457 Table[a[n], {n, 1, 80}] (* _Jean-François Alcover_, Jan 28 2024, after _R. J. Mathar_ *) %Y A131457 Cf. A000040, A001358, A007459, A070552, A109373. %K A131457 easy,nonn %O A131457 1,1 %A A131457 _Jonathan Vos Post_, Oct 21 2007 %E A131457 Corrected and extended by _R. J. Mathar_, Oct 30 2007