g | x | w | all
Bytes Lang Time Link
059JavaScript V8251014T074206Zl4m2
016Husk251013T225439ZGlory2Uk
011Jelly251009T200139ZJonathan
018Japt251011T005206ZShaggy
082Maple251010T225414Zdharr
136C clang251010T185452Zc--
057R251009T192343ZGiuseppe
068Python 3.8+251010T164551Zm90
043APL+WIN251010T105929ZGraham
013Vyxal 3251010T095626ZThemooni
01105AB1E251010T070534ZKevin Cr
023Charcoal251009T194030ZNeil
109Google Sheets251009T213805Zdoubleun
039APLNARS251009T200421ZRosario

JavaScript (V8), 59 bytes

for(a=[,,1,i=1];;)a[++i]&&a.map((_,j)=>a[i*j+1]=1,print(i))

Try it online!

Slow because it iterates ~2^n items to get first n

or 64B fast

Husk, 16 bytes

!Ou!¹ƒGS+×o→*d23

Performance-optimized version (outputs up to 700th element without timing out)

16 bytes codegolf (times out for n > 4.)

Inputs \$n\$ = the element's index in the sequence. Outputs the number at the position \$n\$. The short version times out if the input is > 4.

The program constructs an infinite list of (finite) lists starting from the outer product of \$[2,3]\$ with itself, then joins the first list to the result and so on. Note that the original lists are kept in place. This way the sublists can be sorted, which is not the case for an infinite list.

The problem is that the sublists are missing some numbers. For example, in the 5th list the 41st element (94) is followed by 99, which is the 43rd element. To overcome this, I have used an observation that the \$n\$th element of the \$n\$th list is correct.

The program subsets the \$n\$th list, deduplicates and sorts it and outputs its \$n\$th element.

Commented version:
         ƒ           -- recursive function f(f(f(f(...)))) :
                 d23 --  | take list; the initial value is [2,3]
             ×  *    --  | multiply by itself (outer product)  
              o→     --  | add 1 to each number
         GS+         --  | join the right list and the result with a hook and scanl
       !¹            -- take N-th sublist
     Ou              -- deduplicate and sort
    !                -- output its N-th number

Jelly,  13  11 bytes

2×þ`‘jƊ¡QṢḣ

A monadic Link that accepts a positive integer, \$n\$, and yields a list of the first \$n\$ values in the sequence

Don't try it online! - anything above \$n=3\$ will time out :D
(It constructs a list of \$a_n=a_{n-1}(2a_{n-1}-1)\$ integers where \$a_1=5\$.)


Faster version,  15  13 bytes

2×þ`‘FḟƲṂṭƊ¡ḣ

Try it online!

How?

11:

2×þ`‘jƊ¡QṢḣ - Link: N
2           - two (starting value of Current)
       ¡    - repeat {N} times:
      Ɗ     -   last three links as a monad - f(Current):
 ×þ`        -     multiplication table of {Current} with itself
                    N.B. Initially Current is the integer 2, the range [1,2]
                         is made implicitly, so we get [[1, 2], [2, 4]]
    ‘       -     increment all values                 [[2, 3], [3, 5]]
     j      -     join with {Current}                  [2, 3, 2, 3, 5]      
        Q   - deduplicate
         Ṣ  - sort
          ḣ - head to 1-index {N}

13:

2×þ`‘FḟƲṂṭƊ¡ḣ - Link: N
2             - two (starting value of Current)
           ¡  - repeat {N} times:
          Ɗ   -   last three links as a monad - f(Current):
       Ʋ      -     last four links as a monad - f(Current):
 ×þ`          -     multiplication table of {Current} with itself
                      N.B. Initially, Current is the integer 2, the range [1,2]
                           is made implicitly, so we get [[1, 2], [2, 4]]
    ‘         -     increment all values                 [[2, 3], [3, 5]]
     F        -     flatten                              [2, 3, 3, 5]
      ḟ       -     discard those in {Current}           [5]
        Ṃ     -   minimum                                5
         ṭ    -   tack to {Current}                      [2, 3, 5]
            ḣ - head to 1-index {N}

Japt, 18 bytes

Outputs the first n terms

@Zï* mÄ kZ rm}h23ì

Try it

@Zï* mÄ kZ rm}h23ì     :Implicit input of integer U
@                      :Function taking an array Z as argument
 Zï                    :  Cartesian product of Z
   *                   :  Reduce each pair by multiplication
     m                 :  Map
      Ä                :    Add 1
        kZ             :  Remove all elements of Z
           r           :  Reduce by
            m          :    Minimum
             }         :End function
              h        :Starting with the following array, run it through the function and push the result until it reaches length U
               23ì     :  23 converted to digit array

Maple, 82 bytes

proc(n)s:={2,3};to n-2 do s:=s union{min({seq(seq(i*j+1,i=s),j=s)}minus s)}od;end;

Takes n and produces a set containing the sequence. Straightforward code.

C (clang), 136 bytes

c(*a,*b){return*a-*b;}f(*a,n){int b[n*n],i,k=a[i=0]=2;for(a[1]=3;k<n;++i/k/k?a[k++]=b[wcsspn(b,a)]:qsort(b,i,4,c))b[i]=a[i/k]*a[i%k]+1;}

Try it online!

R, 62 60 57 bytes

\(n)Reduce(\(g,.)c(g,min(setdiff(g%o%g+1,g))),1:n,2:3)[n]

Attempt This Online!

-3 bytes thanks to M--.

Uses Reduce to iterate n times, resulting in a list of length n+2, then extracts the nth element.

Python 3.8+, 68 bytes

c={2,3}
s=c-c
while 1:print(x:=min(c-s));s|={x};c|={x*y+1for y in s}

Attempt This Online! (modified to stop)

s holds a set of numbers already output. c holds a set of numbers eligible for the sequence: the initial 2 and 3, and later products of numbers in s plus 1.

c-c is a short way to produce the empty set ({} gives a dict, not a set).

Each iteration of the loop finds the lowest number in c that is not in s, outputs it, adds it to s, and adds to c the products involving that number, plus 1.

APL+WIN, 43 bytes

Prompts for the number of terms to display:

n←2 3⋄⍎∊(⎕-2)⍴⊂'n←n,↑(m[⍋m←1+,n∘.×n])~n⋄'⋄n

Try it online! Thanks to Dyalog APL Classic

Vyxal 3, 13 bytes

23⎄#¤D▦×f›$⦰g

Vyxal It Online!

23⎄#¤D▦×f›$⦰g­⁡​‎‎⁡⁠⁣‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁤⁡‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁣⁤‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏⁠‎⁡⁠⁣⁣‏‏​⁡⁠⁡‌⁢⁢​‎⁠⁠⁠‎⁡⁠⁢⁣‏⁠‎⁡⁠⁢⁤‏⁠‎⁡⁠⁣⁡‏‏​⁡⁠⁡‌⁢⁣​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏‏​⁡⁠⁡‌⁢⁤​‎‎⁡⁠⁣⁢‏‏​⁡⁠⁡‌­
  ⎄            # ‎⁡a generator
23             # ‎⁢with initial values 2,3
            g  # ‎⁣that returns the minimum of
           ⦰   # ‎⁤the set difference
   #¤D    $    # ‎⁢⁡of each previous term
      ▦×f      # ‎⁢⁢and the inner product of
   #¤D         # ‎⁢⁣the list of previous terms, with itself,
         ›     # ‎⁢⁤incremented
💎

Created with the help of Luminespire.

run snippet for 30 first terms, then you can provide an argument to specify how many terms:

<script type="vyxal3">
23⎄#¤D▦×f›$⦰g  ]⊖
</script>
<script>
    args=[["30"]]
</script>
<script src="https://themoonisacheese.github.io/snippeterpreter/snippet.js" type="module"/>

05AB1E, 11 bytes

23SλλãP>λKß

(Lazily) outputs the infinite sequence.

Try it online.

Explanation:

   λ         # Create a recursive environment,
             # to implicitly output the infinite sequence afterwards
23S          # Starting with a(0)=2 and a(1)=3
             # Where every following a(n) is calculated as:
    λ        #  Push the list of all previous values: [a(0),a(1),...]
     ã       #  Take its cartesian product to create all possible pairs
      P      #  Take the product of each inner pair
       >     #  Increase each by 1
        λK   #  Remove all previous values from this list
          ß  #  Then pop and push the minimum

Charcoal, 23 bytes

FN⊞υ⎇‹ι²⁺²ι⌊⁻⊕ΣEυ×κυυIυ

Attempt This Online! Link is to verbose version of code. Outputs the first n terms. Explanation:

FN

Input n and loop that many times.

⊞υ⎇‹ι²⁺²ι⌊⁻⊕ΣEυ×κυυ

Push 2 and 3 as the first two terms to the predefined empty list, then for the remaining terms vectorised multiply the list by each of its elements, concatenate the results, remove elements already in the list, and push the minimum.

Iυ

Output the terms.

Google Sheets, 109 bytes

=let(f,lambda(f,a,if(rows(a)=A1,a,let(b,sort(tocol(a*torow(a)+1)),f(f,{a;+filter(b,b>max(a))})))),f(f,{2;3}))

A recursive function that expects \$n ≥ 2\$ in cell A1 and outputs the sequence up to that index.

screenshot

Ungolfed:

=let(
  f, lambda(f, a, 
    if(rows(a) >= A1, a, let(
      b, sort(tocol(a * torow(a) + 1)),
      c, single(filter(b, b > max(a))),
      f(f, { a; c })
    ))
  ),
  f(f, { 2; 3 })
)

APL(NARS), 39 chars

{⍵≤1:,2⋄⍵{⍺≤≢⍵:⍵⋄⍺∇⍵,⌊/⍵∼⍨1+,⍵∘.×⍵}2,3}

This function has as input one positive integer 'w', as output a list of integers of length 'w'.

Test:

  f←{⍵≤1:,2⋄⍵{⍺≤≢⍵:⍵⋄⍺∇⍵,⌊/⍵∼⍨1+,⍵∘.×⍵}2,3}
  f 1
2 
  f 2
2 3 
  f 3
2 3 5 
  f 4
2 3 5 7 
  f 10
2 3 5 7 10 11 15 16 21 22 
  f 100
2 3 5 7 10 11 15 16 21 22 23 26 31 33 34 36 43 45 46 47 49 50 51 53 56 63 64 67 69 70 71 
  73 76 78 79 81 87 91 93 94 95 99 100 101 103 106 107 109 111 113 116 122 127 129 
  130 131 135 136 139 141 142 143 147 148 151 153 154 155 156 157 159 160 161 162 163 
  166 169 171 175 177 181 183 187 189 190 191 193 199 201 202 203 207 208 211 213 214 
  215 216 218 219