Cuban primes: Difference between revisions

Dialects of BASIC moved to the BASIC section.
(Dialects of BASIC moved to the BASIC section.)
Line 272:
The 100000th Cuban prime is 1792617147127</pre>
 
=={{header|BASIC256BASIC}}==
==={{header|BASIC256}}===
<syntaxhighlight lang="vb">function isprime(v)
if v mod 2 = 0 then return v = 2
Line 314 ⟶ 315:
i += 1
end while</syntaxhighlight>
 
==={{header|FreeBASIC}}===
<syntaxhighlight lang="vb">function isprime( n as ulongint ) as boolean
if n mod 2 = 0 then return false
for i as uinteger = 3 to int(sqr(n))+1 step 2
if n mod i = 0 then return false
next i
return true
end function
 
function diff_cubes( n as uinteger ) as ulongint
return 3*n*(n+1) + 1
end function
 
function padto( n as uinteger, s as integer ) as string
dim as string outstr=""
dim as integer k = len(str(n))
for i as integer = 1 to s-k
outstr = " " + outstr
next i
return outstr + str(n)
end function
 
dim as integer nc = 0, i = 1, di
while nc < 100000
di = diff_cubes(i)
if isprime(di) then
nc += 1
if nc <= 200 then
print padto(di,8);" ";
if nc mod 10 = 0 then print
end if
if nc = 100000 then
print : print : print di
exit while
end if
end if
i += 1
wend</syntaxhighlight>
{{out}}
<pre>
7 19 37 61 127 271 331 397 547 631
919 1657 1801 1951 2269 2437 2791 3169 3571 4219
4447 5167 5419 6211 7057 7351 8269 9241 10267 11719
12097 13267 13669 16651 19441 19927 22447 23497 24571 25117
26227 27361 33391 35317 42841 45757 47251 49537 50311 55897
59221 60919 65269 70687 73477 74419 75367 81181 82171 87211
88237 89269 92401 96661 102121 103231 104347 110017 112327 114661
115837 126691 129169 131671 135469 140617 144541 145861 151201 155269
163567 169219 170647 176419 180811 189757 200467 202021 213067 231019
234361 241117 246247 251431 260191 263737 267307 276337 279991 283669
285517 292969 296731 298621 310087 329677 333667 337681 347821 351919
360187 368551 372769 374887 377011 383419 387721 398581 407377 423001
436627 452797 459817 476407 478801 493291 522919 527941 553411 574219
584767 590077 592741 595411 603457 608851 611557 619711 627919 650071
658477 666937 689761 692641 698419 707131 733591 742519 760537 769627
772669 784897 791047 812761 825301 837937 847477 863497 879667 886177
895987 909151 915769 925741 929077 932419 939121 952597 972991 976411
986707 990151 997057 1021417 1024921 1035469 1074607 1085407 1110817 1114471
1125469 1155061 1177507 1181269 1215397 1253887 1281187 1285111 1324681 1328671
1372957 1409731 1422097 1426231 1442827 1451161 1480519 1484737 1527247 1570357
 
 
1792617147127
</pre>
 
 
==={{header|Visual Basic .NET}}===
====Corner Cutting Version====
This language doesn't have a built-in for a ''IsPrime()'' function, so I was surprised to find that this runs so quickly. It builds a list of primes while it is creating the output table. Since the last item on the table is larger than the square root of the 100,000<sup>th</sup> cuban prime, there is no need to continue adding to the prime list while checking up to the 100,000<sup>th</sup> cuban prime. I found a bit of a shortcut, if you skip the iterator by just the right amount, only one value is tested for the final result. It's hard-coded in the program, so if another final cuban prime were to be selected for output, the program would need a re-write. If not skipping ahead to the answer, it takes a few seconds over a minute to eventually get to it (see Snail Version below).
<syntaxhighlight lang="vbnet">Module Module1
Dim primes As List(Of Long) = {3L, 5L}.ToList()
 
Sub Main(args As String())
Const cutOff As Integer = 200, bigUn As Integer = 100000,
tn As String = " cuban prime"
Console.WriteLine("The first {0:n0}{1}s:", cutOff, tn)
Dim c As Integer = 0, showEach As Boolean = True, skip As Boolean = True,
v As Long = 0, st As DateTime = DateTime.Now
For i As Long = 1 To Long.MaxValue
v = 3 * i : v = v * i + v + 1
Dim found As Boolean = False, mx As Integer = Math.Ceiling(Math.Sqrt(v))
For Each item In primes
If item > mx Then Exit For
If v Mod item = 0 Then found = True : Exit For
Next : If Not found Then
c += 1 : If showEach Then
For z = primes.Last + 2 To v - 2 Step 2
Dim fnd As Boolean = False
For Each item In primes
If item > mx Then Exit For
If z Mod item = 0 Then fnd = True : Exit For
Next : If Not fnd Then primes.Add(z)
Next : primes.Add(v) : Console.Write("{0,11:n0}", v)
If c Mod 10 = 0 Then Console.WriteLine()
If c = cutOff Then showEach = False
Else
If skip Then skip = False : i += 772279 : c = bigUn - 1
End If
If c = bigUn Then Exit For
End If
Next
Console.WriteLine("{1}The {2:n0}th{3} is {0,17:n0}", v, vbLf, c, tn)
Console.WriteLine("Computation time was {0} seconds", (DateTime.Now - st).TotalSeconds)
If System.Diagnostics.Debugger.IsAttached Then Console.ReadKey()
End Sub
End Module</syntaxhighlight>
{{out}}
<pre>The first 200 cuban primes:
7 19 37 61 127 271 331 397 547 631
919 1,657 1,801 1,951 2,269 2,437 2,791 3,169 3,571 4,219
4,447 5,167 5,419 6,211 7,057 7,351 8,269 9,241 10,267 11,719
12,097 13,267 13,669 16,651 19,441 19,927 22,447 23,497 24,571 25,117
26,227 27,361 33,391 35,317 42,841 45,757 47,251 49,537 50,311 55,897
59,221 60,919 65,269 70,687 73,477 74,419 75,367 81,181 82,171 87,211
88,237 89,269 92,401 96,661 102,121 103,231 104,347 110,017 112,327 114,661
115,837 126,691 129,169 131,671 135,469 140,617 144,541 145,861 151,201 155,269
163,567 169,219 170,647 176,419 180,811 189,757 200,467 202,021 213,067 231,019
234,361 241,117 246,247 251,431 260,191 263,737 267,307 276,337 279,991 283,669
285,517 292,969 296,731 298,621 310,087 329,677 333,667 337,681 347,821 351,919
360,187 368,551 372,769 374,887 377,011 383,419 387,721 398,581 407,377 423,001
436,627 452,797 459,817 476,407 478,801 493,291 522,919 527,941 553,411 574,219
584,767 590,077 592,741 595,411 603,457 608,851 611,557 619,711 627,919 650,071
658,477 666,937 689,761 692,641 698,419 707,131 733,591 742,519 760,537 769,627
772,669 784,897 791,047 812,761 825,301 837,937 847,477 863,497 879,667 886,177
895,987 909,151 915,769 925,741 929,077 932,419 939,121 952,597 972,991 976,411
986,707 990,151 997,057 1,021,417 1,024,921 1,035,469 1,074,607 1,085,407 1,110,817 1,114,471
1,125,469 1,155,061 1,177,507 1,181,269 1,215,397 1,253,887 1,281,187 1,285,111 1,324,681 1,328,671
1,372,957 1,409,731 1,422,097 1,426,231 1,442,827 1,451,161 1,480,519 1,484,737 1,527,247 1,570,357
 
The 100,000th cuban prime is 1,792,617,147,127
Computation time was 0.2989494 seconds</pre>
====Snail Version====
This one doesn't take any shortcuts. It could be sped up (Execution time about 15 seconds) by threading chunks of the search for the 100,000<sup>th</sup> cuban prime, but you would have to take a guess about how far to go, which would be hard-coded, so one might as well use the short-cut version if you are willing to overlook that difficulty.
<syntaxhighlight lang="vbnet">Module Program
Dim primes As List(Of Long) = {3L, 5L}.ToList()
 
Sub Main(args As String())
Dim taskList As New List(Of Task(Of Integer))
Const cutOff As Integer = 200, bigUn As Integer = 100000,
chunks As Integer = 50, little As Integer = bigUn / chunks,
tn As String = " cuban prime"
Console.WriteLine("The first {0:n0}{1}s:", cutOff, tn)
Dim c As Integer = 0, showEach As Boolean = True,
u As Long = 0, v As Long = 1,
st As DateTime = DateTime.Now
For i As Long = 1 To Long.MaxValue
u += 6 : v += u
Dim found As Boolean = False, mx As Integer = Math.Ceiling(Math.Sqrt(v))
For Each item In primes
If item > mx Then Exit For
If v Mod item = 0 Then found = True : Exit For
Next : If Not found Then
c += 1 : If showEach Then
For z = primes.Last + 2 To v - 2 Step 2
Dim fnd As Boolean = False
For Each item In primes
If item > mx Then Exit For
If z Mod item = 0 Then fnd = True : Exit For
Next : If Not fnd Then primes.Add(z)
Next : primes.Add(v) : Console.Write("{0,11:n0}", v)
If c Mod 10 = 0 Then Console.WriteLine()
If c = cutOff Then showEach = False : _
Console.Write("{0}Progress to the {1:n0}th{2}: ", vbLf, bigUn, tn)
End If
If c Mod little = 0 Then Console.Write(".") : If c = bigUn Then Exit For
End If
Next
Console.WriteLine("{1}The {2:n0}th{3} is {0,17:n0}", v, vbLf, c, tn)
Console.WriteLine("Computation time was {0} seconds", (DateTime.Now - st).TotalSeconds)
If System.Diagnostics.Debugger.IsAttached Then Console.ReadKey()
End Sub
End Module</syntaxhighlight>
{{out}}
<pre>The first 200 cuban primes:
7 19 37 61 127 271 331 397 547 631
919 1,657 1,801 1,951 2,269 2,437 2,791 3,169 3,571 4,219
4,447 5,167 5,419 6,211 7,057 7,351 8,269 9,241 10,267 11,719
12,097 13,267 13,669 16,651 19,441 19,927 22,447 23,497 24,571 25,117
26,227 27,361 33,391 35,317 42,841 45,757 47,251 49,537 50,311 55,897
59,221 60,919 65,269 70,687 73,477 74,419 75,367 81,181 82,171 87,211
88,237 89,269 92,401 96,661 102,121 103,231 104,347 110,017 112,327 114,661
115,837 126,691 129,169 131,671 135,469 140,617 144,541 145,861 151,201 155,269
163,567 169,219 170,647 176,419 180,811 189,757 200,467 202,021 213,067 231,019
234,361 241,117 246,247 251,431 260,191 263,737 267,307 276,337 279,991 283,669
285,517 292,969 296,731 298,621 310,087 329,677 333,667 337,681 347,821 351,919
360,187 368,551 372,769 374,887 377,011 383,419 387,721 398,581 407,377 423,001
436,627 452,797 459,817 476,407 478,801 493,291 522,919 527,941 553,411 574,219
584,767 590,077 592,741 595,411 603,457 608,851 611,557 619,711 627,919 650,071
658,477 666,937 689,761 692,641 698,419 707,131 733,591 742,519 760,537 769,627
772,669 784,897 791,047 812,761 825,301 837,937 847,477 863,497 879,667 886,177
895,987 909,151 915,769 925,741 929,077 932,419 939,121 952,597 972,991 976,411
986,707 990,151 997,057 1,021,417 1,024,921 1,035,469 1,074,607 1,085,407 1,110,817 1,114,471
1,125,469 1,155,061 1,177,507 1,181,269 1,215,397 1,253,887 1,281,187 1,285,111 1,324,681 1,328,671
1,372,957 1,409,731 1,422,097 1,426,231 1,442,827 1,451,161 1,480,519 1,484,737 1,527,247 1,570,357
 
Progress to the 100,000th cuban prime: ..................................................
The 100,000th cuban prime is 1,792,617,147,127
Computation time was 49.5868152 seconds</pre>
====k > 1 Version====
A VB.NET version of the [http://www.rosettacode.org/wiki/Cuban_primes#Raku Raku] version where k > 1, linked at [https://tio.run/##fVVtb9owEP7OrzjlU9KmGbSaJiExqSuthFboNND2cTKJAxaJzWIHqFB/O71zQqghW6SQ3HHP43t5Djbzm1gV/HAYq6TMOFSPXgfwGooc1oXIuYZ7DRO@hWehjf@SwkgavuBF0LFx03KOHmF@2Fg/sM4jQZYbQtcIGMDt524IacYW2sfvAvrym1IZZ7LBPakC5BkKZspy9WGUwkSZmkIGMFtyCX8a8JFg5RJIuMK7JpkavkarX5OsAgyYFSVHz4TvTMNFBvqITrTn4xzrZCbqzKoORixJyAUOtzUeZUIt7EDTzDET0mfFwvZ9agohF35wauuDktpAXJqXND3LCltr5AmFLg8D56xOw3NGE7tgxGZ3wDSIyhXC2jGdUjcfsCFoO@MhM3yGpyDX8TWaqG2Da9VIy6huwSjodatRryBXCdxRflU/sXojJM4KkU5K1BbUUfS7EIY/C8l970kUmNq@@7bvvWnYLnnBkXAA@9u3vhfWLaSWhbAKHLLYHtg6@h6NvjajMdv9YlnJHTBdGaUsUHTV3admkuMaE7DG1cB@0kcf2zkAH99uEBfAJ1hd8NHAUlWiVk4Lg6AnlmkeQr5zcxwzs4weuMhIOtaY/i2MvwmCC2Kq8JHFS8Cu5UhRC/Yirha4jfpKB9ppPO6EuZjEh/AN/aJUoGaCVRnNxv2Tot6@41ZZFBG0nhXDNY0G4x0d@N6@G37pSysBHPkmRD4/tlmhxKzqN/NnFIHntTSnroLUUO/bUYNnUgv@Vwht@CjtnNfWaTVaZPyg8nVpmBFKgqEF2@JaoqpB81jJRGNd/seNQxlpE0QzZVg2rUJOpWE501eNA4mGgi2k0kbEOhryebkgQY/0vTEoB564pf7kLPnOX@vNPf5m0bP6yzgc3gE Try It Online!]
 
=={{header|Bracmat}}==
Line 1,099 ⟶ 1,301:
 
The 100,000th cuban prime is 1,792,617,147,127
</pre>
=={{header|FreeBASIC}}==
<syntaxhighlight lang="freebasic">function isprime( n as ulongint ) as boolean
if n mod 2 = 0 then return false
for i as uinteger = 3 to int(sqr(n))+1 step 2
if n mod i = 0 then return false
next i
return true
end function
 
function diff_cubes( n as uinteger ) as ulongint
return 3*n*(n+1) + 1
end function
 
function padto( n as uinteger, s as integer ) as string
dim as string outstr=""
dim as integer k = len(str(n))
for i as integer = 1 to s-k
outstr = " " + outstr
next i
return outstr + str(n)
end function
 
dim as integer nc = 0, i = 1, di
while nc < 100000
di = diff_cubes(i)
if isprime(di) then
nc += 1
if nc <= 200 then
print padto(di,8);" ";
if nc mod 10 = 0 then print
end if
if nc = 100000 then
print : print : print di
exit while
end if
end if
i += 1
wend</syntaxhighlight>
{{out}}
<pre>
7 19 37 61 127 271 331 397 547 631
919 1657 1801 1951 2269 2437 2791 3169 3571 4219
4447 5167 5419 6211 7057 7351 8269 9241 10267 11719
12097 13267 13669 16651 19441 19927 22447 23497 24571 25117
26227 27361 33391 35317 42841 45757 47251 49537 50311 55897
59221 60919 65269 70687 73477 74419 75367 81181 82171 87211
88237 89269 92401 96661 102121 103231 104347 110017 112327 114661
115837 126691 129169 131671 135469 140617 144541 145861 151201 155269
163567 169219 170647 176419 180811 189757 200467 202021 213067 231019
234361 241117 246247 251431 260191 263737 267307 276337 279991 283669
285517 292969 296731 298621 310087 329677 333667 337681 347821 351919
360187 368551 372769 374887 377011 383419 387721 398581 407377 423001
436627 452797 459817 476407 478801 493291 522919 527941 553411 574219
584767 590077 592741 595411 603457 608851 611557 619711 627919 650071
658477 666937 689761 692641 698419 707131 733591 742519 760537 769627
772669 784897 791047 812761 825301 837937 847477 863497 879667 886177
895987 909151 915769 925741 929077 932419 939121 952597 972991 976411
986707 990151 997057 1021417 1024921 1035469 1074607 1085407 1110817 1114471
1125469 1155061 1177507 1181269 1215397 1253887 1281187 1285111 1324681 1328671
1372957 1409731 1422097 1426231 1442827 1451161 1480519 1484737 1527247 1570357
 
 
1792617147127
</pre>
 
Line 2,982 ⟶ 3,120:
The 100,000th cuban prime is 1,792,617,147,127
</pre>
 
=={{header|Visual Basic .NET}}==
===Corner Cutting Version===
This language doesn't have a built-in for a ''IsPrime()'' function, so I was surprised to find that this runs so quickly. It builds a list of primes while it is creating the output table. Since the last item on the table is larger than the square root of the 100,000<sup>th</sup> cuban prime, there is no need to continue adding to the prime list while checking up to the 100,000<sup>th</sup> cuban prime. I found a bit of a shortcut, if you skip the iterator by just the right amount, only one value is tested for the final result. It's hard-coded in the program, so if another final cuban prime were to be selected for output, the program would need a re-write. If not skipping ahead to the answer, it takes a few seconds over a minute to eventually get to it (see Snail Version below).
<syntaxhighlight lang="vbnet">Module Module1
Dim primes As List(Of Long) = {3L, 5L}.ToList()
 
Sub Main(args As String())
Const cutOff As Integer = 200, bigUn As Integer = 100000,
tn As String = " cuban prime"
Console.WriteLine("The first {0:n0}{1}s:", cutOff, tn)
Dim c As Integer = 0, showEach As Boolean = True, skip As Boolean = True,
v As Long = 0, st As DateTime = DateTime.Now
For i As Long = 1 To Long.MaxValue
v = 3 * i : v = v * i + v + 1
Dim found As Boolean = False, mx As Integer = Math.Ceiling(Math.Sqrt(v))
For Each item In primes
If item > mx Then Exit For
If v Mod item = 0 Then found = True : Exit For
Next : If Not found Then
c += 1 : If showEach Then
For z = primes.Last + 2 To v - 2 Step 2
Dim fnd As Boolean = False
For Each item In primes
If item > mx Then Exit For
If z Mod item = 0 Then fnd = True : Exit For
Next : If Not fnd Then primes.Add(z)
Next : primes.Add(v) : Console.Write("{0,11:n0}", v)
If c Mod 10 = 0 Then Console.WriteLine()
If c = cutOff Then showEach = False
Else
If skip Then skip = False : i += 772279 : c = bigUn - 1
End If
If c = bigUn Then Exit For
End If
Next
Console.WriteLine("{1}The {2:n0}th{3} is {0,17:n0}", v, vbLf, c, tn)
Console.WriteLine("Computation time was {0} seconds", (DateTime.Now - st).TotalSeconds)
If System.Diagnostics.Debugger.IsAttached Then Console.ReadKey()
End Sub
End Module</syntaxhighlight>
{{out}}
<pre>The first 200 cuban primes:
7 19 37 61 127 271 331 397 547 631
919 1,657 1,801 1,951 2,269 2,437 2,791 3,169 3,571 4,219
4,447 5,167 5,419 6,211 7,057 7,351 8,269 9,241 10,267 11,719
12,097 13,267 13,669 16,651 19,441 19,927 22,447 23,497 24,571 25,117
26,227 27,361 33,391 35,317 42,841 45,757 47,251 49,537 50,311 55,897
59,221 60,919 65,269 70,687 73,477 74,419 75,367 81,181 82,171 87,211
88,237 89,269 92,401 96,661 102,121 103,231 104,347 110,017 112,327 114,661
115,837 126,691 129,169 131,671 135,469 140,617 144,541 145,861 151,201 155,269
163,567 169,219 170,647 176,419 180,811 189,757 200,467 202,021 213,067 231,019
234,361 241,117 246,247 251,431 260,191 263,737 267,307 276,337 279,991 283,669
285,517 292,969 296,731 298,621 310,087 329,677 333,667 337,681 347,821 351,919
360,187 368,551 372,769 374,887 377,011 383,419 387,721 398,581 407,377 423,001
436,627 452,797 459,817 476,407 478,801 493,291 522,919 527,941 553,411 574,219
584,767 590,077 592,741 595,411 603,457 608,851 611,557 619,711 627,919 650,071
658,477 666,937 689,761 692,641 698,419 707,131 733,591 742,519 760,537 769,627
772,669 784,897 791,047 812,761 825,301 837,937 847,477 863,497 879,667 886,177
895,987 909,151 915,769 925,741 929,077 932,419 939,121 952,597 972,991 976,411
986,707 990,151 997,057 1,021,417 1,024,921 1,035,469 1,074,607 1,085,407 1,110,817 1,114,471
1,125,469 1,155,061 1,177,507 1,181,269 1,215,397 1,253,887 1,281,187 1,285,111 1,324,681 1,328,671
1,372,957 1,409,731 1,422,097 1,426,231 1,442,827 1,451,161 1,480,519 1,484,737 1,527,247 1,570,357
 
The 100,000th cuban prime is 1,792,617,147,127
Computation time was 0.2989494 seconds</pre>
===Snail Version===
This one doesn't take any shortcuts. It could be sped up (Execution time about 15 seconds) by threading chunks of the search for the 100,000<sup>th</sup> cuban prime, but you would have to take a guess about how far to go, which would be hard-coded, so one might as well use the short-cut version if you are willing to overlook that difficulty.
<syntaxhighlight lang="vbnet">Module Program
Dim primes As List(Of Long) = {3L, 5L}.ToList()
 
Sub Main(args As String())
Dim taskList As New List(Of Task(Of Integer))
Const cutOff As Integer = 200, bigUn As Integer = 100000,
chunks As Integer = 50, little As Integer = bigUn / chunks,
tn As String = " cuban prime"
Console.WriteLine("The first {0:n0}{1}s:", cutOff, tn)
Dim c As Integer = 0, showEach As Boolean = True,
u As Long = 0, v As Long = 1,
st As DateTime = DateTime.Now
For i As Long = 1 To Long.MaxValue
u += 6 : v += u
Dim found As Boolean = False, mx As Integer = Math.Ceiling(Math.Sqrt(v))
For Each item In primes
If item > mx Then Exit For
If v Mod item = 0 Then found = True : Exit For
Next : If Not found Then
c += 1 : If showEach Then
For z = primes.Last + 2 To v - 2 Step 2
Dim fnd As Boolean = False
For Each item In primes
If item > mx Then Exit For
If z Mod item = 0 Then fnd = True : Exit For
Next : If Not fnd Then primes.Add(z)
Next : primes.Add(v) : Console.Write("{0,11:n0}", v)
If c Mod 10 = 0 Then Console.WriteLine()
If c = cutOff Then showEach = False : _
Console.Write("{0}Progress to the {1:n0}th{2}: ", vbLf, bigUn, tn)
End If
If c Mod little = 0 Then Console.Write(".") : If c = bigUn Then Exit For
End If
Next
Console.WriteLine("{1}The {2:n0}th{3} is {0,17:n0}", v, vbLf, c, tn)
Console.WriteLine("Computation time was {0} seconds", (DateTime.Now - st).TotalSeconds)
If System.Diagnostics.Debugger.IsAttached Then Console.ReadKey()
End Sub
End Module</syntaxhighlight>
{{out}}
<pre>The first 200 cuban primes:
7 19 37 61 127 271 331 397 547 631
919 1,657 1,801 1,951 2,269 2,437 2,791 3,169 3,571 4,219
4,447 5,167 5,419 6,211 7,057 7,351 8,269 9,241 10,267 11,719
12,097 13,267 13,669 16,651 19,441 19,927 22,447 23,497 24,571 25,117
26,227 27,361 33,391 35,317 42,841 45,757 47,251 49,537 50,311 55,897
59,221 60,919 65,269 70,687 73,477 74,419 75,367 81,181 82,171 87,211
88,237 89,269 92,401 96,661 102,121 103,231 104,347 110,017 112,327 114,661
115,837 126,691 129,169 131,671 135,469 140,617 144,541 145,861 151,201 155,269
163,567 169,219 170,647 176,419 180,811 189,757 200,467 202,021 213,067 231,019
234,361 241,117 246,247 251,431 260,191 263,737 267,307 276,337 279,991 283,669
285,517 292,969 296,731 298,621 310,087 329,677 333,667 337,681 347,821 351,919
360,187 368,551 372,769 374,887 377,011 383,419 387,721 398,581 407,377 423,001
436,627 452,797 459,817 476,407 478,801 493,291 522,919 527,941 553,411 574,219
584,767 590,077 592,741 595,411 603,457 608,851 611,557 619,711 627,919 650,071
658,477 666,937 689,761 692,641 698,419 707,131 733,591 742,519 760,537 769,627
772,669 784,897 791,047 812,761 825,301 837,937 847,477 863,497 879,667 886,177
895,987 909,151 915,769 925,741 929,077 932,419 939,121 952,597 972,991 976,411
986,707 990,151 997,057 1,021,417 1,024,921 1,035,469 1,074,607 1,085,407 1,110,817 1,114,471
1,125,469 1,155,061 1,177,507 1,181,269 1,215,397 1,253,887 1,281,187 1,285,111 1,324,681 1,328,671
1,372,957 1,409,731 1,422,097 1,426,231 1,442,827 1,451,161 1,480,519 1,484,737 1,527,247 1,570,357
 
Progress to the 100,000th cuban prime: ..................................................
The 100,000th cuban prime is 1,792,617,147,127
Computation time was 49.5868152 seconds</pre>
===k > 1 Version===
A VB.NET version of the [http://www.rosettacode.org/wiki/Cuban_primes#Raku Raku] version where k > 1, linked at [https://tio.run/##fVVtb9owEP7OrzjlU9KmGbSaJiExqSuthFboNND2cTKJAxaJzWIHqFB/O71zQqghW6SQ3HHP43t5Djbzm1gV/HAYq6TMOFSPXgfwGooc1oXIuYZ7DRO@hWehjf@SwkgavuBF0LFx03KOHmF@2Fg/sM4jQZYbQtcIGMDt524IacYW2sfvAvrym1IZZ7LBPakC5BkKZspy9WGUwkSZmkIGMFtyCX8a8JFg5RJIuMK7JpkavkarX5OsAgyYFSVHz4TvTMNFBvqITrTn4xzrZCbqzKoORixJyAUOtzUeZUIt7EDTzDET0mfFwvZ9agohF35wauuDktpAXJqXND3LCltr5AmFLg8D56xOw3NGE7tgxGZ3wDSIyhXC2jGdUjcfsCFoO@MhM3yGpyDX8TWaqG2Da9VIy6huwSjodatRryBXCdxRflU/sXojJM4KkU5K1BbUUfS7EIY/C8l970kUmNq@@7bvvWnYLnnBkXAA@9u3vhfWLaSWhbAKHLLYHtg6@h6NvjajMdv9YlnJHTBdGaUsUHTV3admkuMaE7DG1cB@0kcf2zkAH99uEBfAJ1hd8NHAUlWiVk4Lg6AnlmkeQr5zcxwzs4weuMhIOtaY/i2MvwmCC2Kq8JHFS8Cu5UhRC/Yirha4jfpKB9ppPO6EuZjEh/AN/aJUoGaCVRnNxv2Tot6@41ZZFBG0nhXDNY0G4x0d@N6@G37pSysBHPkmRD4/tlmhxKzqN/NnFIHntTSnroLUUO/bUYNnUgv@Vwht@CjtnNfWaTVaZPyg8nVpmBFKgqEF2@JaoqpB81jJRGNd/seNQxlpE0QzZVg2rUJOpWE501eNA4mGgi2k0kbEOhryebkgQY/0vTEoB564pf7kLPnOX@vNPf5m0bP6yzgc3gE Try It Online!]
 
=={{header|Wren}}==
512

edits