OFFSET
0,2
EXAMPLE
a(0) = 1 by the usual convention for an empty product. - N. J. A. Sloane, Feb 15 2024
a(5) = 15015 because 3 * 5 * 7 * 11 * 13 = 15015.
MATHEMATICA
nextTwin[{list_, q_}] := Module[{p=NextPrime[q]}, {Join[list, If[PrimeQ[p-2]||PrimeQ[p+2], {p}, {}]], p}]
a001097[n_] := First[NestWhile[nextTwin, {{3}, 3}, Length[First[nextTwin[#]]]<=n&]]
a048599[n_] := FoldList[Times, 1, a001097[n]]
a048599[16] (* Hartmut F. W. Hoft, Apr 27 2021 *)
Join[{1}, FoldList[Times, Union[Flatten[Select[Partition[Prime[Range[30]], 2, 1], #[[2]]-#[[1]]==2&]]]]] (* Harvey P. Dale, Feb 15 2024 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Den Roussel (DenRoussel(AT)webtv.net)
EXTENSIONS
More terms from Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999
STATUS
approved