Top
Back: D.2.2.11 number_pi
Forward: D.2.2.13 product
FastBack: Appendix D SINGULAR libraries
FastForward: E Release Notes
Up: D.2.2 general_lib
Top: 1 Preface
Contents: Table of Contents
Index: F Index
About: About This Document

D.2.2.12 primes

Procedure from library general.lib (see general_lib).

Usage:

primes(n,m); n,m integers

Return:

intvec, consisting of all primes p, prime(n)<=p<=m, in increasing order if n<=m, resp. prime(m)<=p<=n, in decreasing order if m<n.

Note:

prime(n); returns the biggest prime number <= min(n,32003) if n>=2, else 2

Example:

LIB "general.lib";
primes(50,100);"";
→ 47,53,59,61,67,71,73,79,83,89,97
→ 
intvec v = primes(37,1); v;
→ 37,31,29,23,19,17,13,11,7,5,3,2

Top Back: D.2.2.11 number_pi Forward: D.2.2.13 product FastBack: Appendix D SINGULAR libraries FastForward: E Release Notes Up: D.2.2 general_lib Top: 1 Preface Contents: Table of Contents Index: F Index About: About This Document
            User manual for Singular version 2-0-4, October 2002, generated by texi2html.