Jump to content

Search the Community

Showing results for tags 'prime'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • forums_forum_3
    • forums_forum_4
    • forums_forum_9
  • forums_forum_5
    • forums_forum_6
    • forums_forum_10
    • forums_forum_36
    • forums_forum_18
    • forums_forum_16
    • forums_forum_37
    • forums_forum_11
    • forums_forum_12
    • forums_forum_17
  • A Test Forum
    • forums_forum_7
    • forums_forum_8
  • forums_forum_13
    • forums_forum_14

Blogs

  • blogs_blog_1
  • blogs_blog_3

Categories

  • Tutorial Guide
  • content_cat_name_15

Categories

  • Getting Started
  • Howto
  • Live Coding
  • Music Theory and Analysis

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


core_pfield_1


core_pfield_2


core_pfield_3


core_pfield_4


core_pfield_8


core_pfield_9


core_pfield_10


Gender


Location


core_pfield_7

Found 1 result

  1. AM

    primes*

    a little prime-function-extension (defun primes* (n &key (offset 0) (every-x 1) (reverse nil)) (let ((n (* n every-x)) (seq)) (progn (setf seq (find-everyother every-x (subseq (primes (+ n offset)) offset (+ n offset)))) (if (equal reverse nil) seq (reverse seq))))) (primes* 4 :offset 0) => (2 3 5 7) (primes* 4 :offset 1) => (3 5 7 11) (primes* 6 :offset 8) => (23 29 31 37 41 43) (primes* 5 :offset 5 :every-x 2) => (13 19 29 37 43) (primes* 5 :offset 3 :every-x 4) => (7 19 37 53 71) (primes* 5 :offset 5 :every-x 3 :reverse t) => (61 47 37 23 13) ;;;; in combination with "reading-list-by-steps" (defun reading-list-by-steps (&key steps values (start (car values))) (let ((pos (car (position-item start values)))) (append (list (nth pos values)) (loop for i in steps do (setf pos (+ pos i)) when (> pos (length values)) do (setf pos (+ 0 i)) collect (nth pos values))))) (list-plot (reading-list-by-steps :steps '(1 2 -1 3 4 -1) :values (primes* 10 :offset 4 :reverse t)) :join-points t)
×