Purchase Solution

Algorithm to generate an increasing sequence of integers

Not what you're looking for?

Ask Custom Question

Design an algorithm to generate the sequence of positive integers (in increasing order) whose only prime divisors are 2 and 3; that is, your program should produce the sequence 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, ... . Does your program represent an algorithm in the strict sense?

Purchase this Solution

Solution Summary

A SQL algorithm to generate the increasing sequence of positive integers whose only prime divisors are 2 and 3. The version will run in SQL 2008 or any edition that supports the += operator. The algorithm can serve as a basis to other SQL languages and implementations or work as pseudo-coded in other contexts.

Comment is made on whether this solution can be considered an algorithm in the strict sense.

Solution Preview

A strict algorithm must stop in a finite time. Since "the sequence of positive integers..." has no end (it is infinite), no algorithm in the strict sense can produce it. We could head in the direction of something producible by a strict algorithm by changing the requirement to something like "the sequence of positive integers less than or equal to 200..."

How do we know that the given sequence is infinite? Let us assume, it is not. Then, there is a greatest number ...

Purchase this Solution


Free BrainMass Quizzes
Javscript Basics

Quiz on basics of javascript programming language.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

C# variables and classes

This quiz contains questions about C# classes and variables.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.