displaying sequence of numbers [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am trying to understand the pattern of these sequence of numbers and write c++ code using one of loop structures.the numbers are:
1, 2, 5, 14, 41, ...
I want the code to display these numbers.Can somebody help me with this?Thank you in advance.

You can search for such sequences on your favorite web search engine and you'll usually end up on OEIS.org. In this case, here: https://oeis.org/A007051
Your equation is (3^n + 1)/2.

Related

Regex expression to replace string with * [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I need to convert string like this to
ABC_464_aDE.hmi_2df
to ABC464aDE.* that is want to remove all _ and add * at the end after dot. And my project requirement is to do this using regex. Please help to sort this out.
Thanks
If you are using C# the you can use this code
txt=Regex.Replace(txt.Replace("_",""), #"\.\w+", "");

I need a regex for the following combination [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
mission_id: a498094578a
mission_id: a493453456
mission_id: 498343454a
mission_id: 34534535345
From the above 4 mission_id's I need your help in writing a regex pattern which covers all the four mission_id but need to select only the numbers.
So one the first one - need to exempt 'a' and only the numbers.
mission_id:\s*\w?(\d*)\w?
That should work; maybe add any flags you need for parsing multiline text or whatever.
www.regexr.com is a great resource for trying out RegExps

C++ input value process as math function [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I’m very new in C++ and I need your help. I want to use the input value as a mathematical function then print the result.
What i need is:
When user input: 2 +1 and hit Enter then output (cout>>)
should be your result is: 3 (the sum of 2 + 1)
The mathematical symbol could be + or * or / or -.
Could you please help me with some example?
Thanks in advance!
Search for "Reverse Polish notation" and implementation in C++

Turning a string that contains a equation into an integer [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I would like to be able to convert a string such as "(5+6)*6" and get the resulting integer from that equation. It is important that it starts out as a string.
You can use library fastmathparser for c++.
In link is example how use this library.
If you really want write alone this parser, I recomended use Shunting-yard algorithm

How to make a MATLAB function to be run in html? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I've developed a MATLAB code that I think it is useful to be used by researchers. How can I embed it in a website to be used free?
It gets two integers and return a set of integers
Also it is possible to convert it to c++, If it helps.
Thanks
Submit your m-file(s) to Matlab Central File Exchange, this is the perfect place for it.