The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
(49G) OEIS A018800: Smallest prime that begins with n
10-03-2017, 09:39 AM
Post: #1
(49G) OEIS A018800: Smallest prime that begins with n
For natural number input N the programme returns the Nth element of the series

https://oeis.org/A018800

NB The sequence exhibits no gaps.

Size: 135.

CkSum: # 20661d

Code:
::
  CK1&Dispatch
  # FF
  ::
    DUP
    FPTR2 ^ISPRIME
    %0<>
    ?SEMI
    BINT7
    ONE_DO
    ZINT 10
    FPTR2 ^RMULText
    BINT10
    INDEX@
    FPTR2 ^RP#
    ONE_DO
    DUPINDEX@
    FPTR2 ^#>Z
    FPTR2 ^RADDext
    DUP
    FPTR2 ^ZPrime?
    ITE
    ::
      SWAPDROP
      ZEROZERO
      JSTOPSTO
      ExitAtLOOP
    ;
    ::
      DROP
      INDEX@
      BINT10
      #/
      DROP
      #3=
      case
      BINT4
      BINT2
    ;
    +LOOP
    LOOP
  ;
;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(49G) OEIS A018800: Smallest prime that begins with n - Gerald H - 10-03-2017 09:39 AM



User(s) browsing this thread: 1 Guest(s)