Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ programming please Problem A: Maths (20 points) First some definitions of three integer properties. Prime numbers A prime number is any integer that is
C++ programming please
Problem A: Maths (20 points) First some definitions of three integer properties. Prime numbers A prime number is any integer that is only divisible by 1 and itself. The first few prime numbers are : 2, 3, 5, 7, 11, 13, 17, 19 .... Fibonacci numbers The series of Fibonacci numbers are given by this relationship: Fo = 0, F1 = 1, Fn = Fn-1 + Fn-2 (for n > 1). We say that a number x is "Fibonacci" if, and only if, r = Fn for some n > 0. The first few Fibonacci numbers are: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... Modified Cullen The series of Modified Cullen numbers are given by the equation Cn = n x 21n/2] + 1 for any integer n > 0. (Note the "floor function [n/2] - this stands for "round down") We say that a number r is "Cullen" if x = Cn for some value of n. The first few Modified Cullen numbers are 2, 5, 7, 17, 21, 49, 57 .... Your Task Write a program that reads a single number from the keyboard. The program should then display whether the number is any two of the listed types of numbers above. Please see the below examples for the order you should cout when more than one property applies: Example 1 (user input is underlined for clarity, underlined text in your program is not needed). Further note that PDFs will sometimes use 2 spaces where our code only uses 1. (In general I do not recommend copy/pasting from PDFS) Give me a number, HUMAN: 2 that is prime and fibonacci that is prime and cullen that is cullen and fibonacci Example 2 (user input is underlined for clarity, underlined text in your program is not needed). Further note that PDFs will sometimes use 2 spaces where our code only uses 1. (In general I do not recommend copy/pasting from PDFS) Give me a number, HUMAN : 3 that is prime and fibonacci Example 3 (user input is underlined for clarity, underlined text in your program is not needed). Further note that PDFs will sometimes use 2 spaces where our code only uses 1. (In general I do not recommend copy/pasting from PDFS) Give me a number, HUMAN : 7 that is prime and cullen Example 4 (user input is underlined for clarity, underlined text in your program is not needed). Further note that PDFs will sometimes use 2 spaces where our code only uses 1. (In general I do not recommend copy/pasting from PDFS) Give me a number, HUMAN : 21 that is cullen and fibonacci Example 5 (user input is underlined for clarity, underlined text in your program is not needed). Further note that PDFs will sometimes use 2 spaces where our code only uses 1. (In general I do not recommend copy/pasting from PDFS) Give me a number, HUMAN : 4 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started