OFFSET
1,1
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..10000
EXAMPLE
floor(3/2)=1 not prime, floor(5/2)=2=prime(1) so a(1)=5.
floor(7/2)=3=prime(2), so a(2)=7.
floor(11/2)=5=prime(3), so a(3)=11.
floor(13/2)=6 and floor(17/2)=8 not prime, floor(23/3)=7=prime(4), so a(4)=23.
floor(23/2)=11=prime(5) so a(5)=23.
MATHEMATICA
a[n_] := For[p = Prime[n]; r = 2, True, r = NextPrime[r], For[q = NextPrime[r*p, -1], q <= (p + 1) r, q = NextPrime[q], If[Floor[q/r] == p, Return[q]]]]; Array[a, 100] (* Jean-François Alcover, Oct 25 2014 *)
PROG
( Excel & Visual Basic, the file pre.txt with the first 1000000 prime numbers )
Dim p(10000), q(1000000)
Open "pre.txt" For Input As #1
For i = 1 To 10000: Input #1, x: p(i) = x: q(i) = x: Next i
For i = 10001 To 1000000: Input #1, x: q(i) = x: Next i
o = 3
For l = 1 To 10000
x = p(l)
For i = 1 To 10000
a = p(i)
For j = o To 1000000
b = q(j)
c = Int(b / a)
If c < x Then GoTo 5
If c = x Then Cells(l, 1) = x: Cells(l, 2) = b: Cells(l, 3)= a: Cells(l, 4).Select: GoTo 20
GoTo 10
5 Next j
10 Next i
20 If i = 1 Then o = j
Next l
End Sub
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Oct 09 2014
STATUS
approved