0
votes
0answers
42 views

Number of Anti-Arithmetic sequences.

Original Problem Link. A permutation $p$ is called antiarithmetic if there is no subsequence of it forming an arithmetic progression of length bigger than $2$, i.e. there are no three indices ...
1
vote
4answers
113 views

How is “n+n/2+n/4…1” equal to “2n-1” using the formula for geometric series?

I never knew not having good knowledge of basic maths will be so crippling!! So please help me out this time. I'll be working on my maths from today on. I was discussing about complexity of an ...
1
vote
1answer
51 views

what if geometric sequence + geometric sequence

I wrote a program that basicly can find the formula of the sequence that created with any-degree equation. For example if you give my program that sequence: [1926, 2811, 833240, 28778265, 398155842, ...
0
votes
1answer
49 views

General term of this sequence

I wanted to know the General term or the function to generate this sequence I found on OEIS. It is the number of ways to express $2n+1$ as $p+2q$; where $p$ and $q$ can be odd prime number and even ...
2
votes
2answers
58 views

Convergence of a Recursive Sequence - An Example

Consider the sequence $\displaystyle x(k+1) = \frac{1}{2}\left(x(k) + \frac{a}{x(k)}\right)$ where $x(k)$ stands for the $k$th term of the sequence. What does this process converge to, and what is ...
7
votes
4answers
176 views

General McNugget problem

The classic McNugget problem states: Chicken McNuggets can be purchased in quantities of 6, 9, and 20 pieces. You can buy exactly 15 pieces by purchasing a 6 and a 9, but you can't buy exactly 10 ...
0
votes
0answers
23 views

Given an X and a Y, how to find the equation

I've just been curious lately. If you have an X for lets say 0-50 and corresponding Y values, is there a way to determine the equation without just guessing and checking and trying to find a pattern?
2
votes
1answer
95 views

How to calculate $ 1^k+2^k+3^k+\cdots+N^k $ with given values of $N$ and $k$? [duplicate]

Here $ 1<N<10^9$ and $0<k<50$ So we have to calculate it in order of $O(\log N)$.
4
votes
2answers
182 views

Sum of the series formula

I need to figure out the sum of the series as quickly as possible in a program given n and k: $$f(n,k)= ...
0
votes
0answers
57 views

Berlekamp - Massey Algorithm

It is well known that the Berlekamp-Massey Algorithm can find the initial seed of any m-sequence linear feedback shift register of length N using only 2N consecutive bits of the output sequence. What ...
4
votes
6answers
616 views

Fastest Square Root Algorithm

What is the fastest algorithm for finding the square root of a number? I created one that can find the square root of "987654321" to 16 decimal places in just 20 iterations (I'm not ready to release ...
0
votes
0answers
67 views

Is it possible to find a formula for a set of number from the result?

I have these two sets of number, I also have a result. Is it possible to compute the relation between them so that I can figure out how the result is generated ? for example I have : Set A=4 6 12 25 ...
1
vote
1answer
50 views

How to convert a sequence of numbers in the formula?

I'm trying to understand different sorting algorithms and their BigO notation. Suppose, I'm using insertion sort and I have the worst case: 6 | 5 | 4 | 3 | 2 | 1 ...
1
vote
1answer
73 views

What kind of series / recursion is this?

I'm trying to find the explicit solution / sum of first n elements for the following sequence: d(2) = 2 d(n) = d(n/2) + n*log2(n) Can you help me to find out ...
2
votes
1answer
125 views

Finding common terms of two arithmetic sequences using Extended Euclidean algorithm

I have a problem which could be simplified as: there are two arithmetic sequences, a and b. Those can be written as a=a1+m*d1 b=b1+n*d2 I need to find the ...
12
votes
2answers
220 views

Prime one heap Nim

I have been working on an interesting problem my lecturer mentioned recently. Prime Nim is a variant of the Nim game where you have a single pile with an arbitrary number $n\in \Bbb N+\{0\}$ of ...
4
votes
1answer
150 views

Permute the values in each row in a matrix such that the columns sum to the same amount.

The general problem Given a matrix, I would like to permute the order of values in each row, so that all the columns of the matrix sums to the same value. A simple example For example, given: ...
0
votes
2answers
164 views

Formalizing the idea of “algorithm”

I have encountered several times, while doing mathematics, the following situation: We have a finite "sequence" $\left(a_{n}\right)_{n\in\left\{ 1,\ldots,p\right\} }$ of some objects that has the ...
2
votes
1answer
78 views

What is the value of this summation in Big O terms?

I am trying to do an analysis for the cost of n inserts into a hashtable datastructure and I have a factor like the one below: $$\sum_{i=0}^{\lfloor\lg {(n-1)}\rfloor} 2^i$$ What will be the Big O ...
2
votes
1answer
501 views

Induction proof of lower bound for $\sum \sqrt n$

I'm having some trouble proving the following statement using mathematical induction: $$\frac{1}{2}n^{\frac{3}{2}} \leq \sqrt{1} + \sqrt{2} + \sqrt{3} + \sqrt{4} + ... + \sqrt{n} ,\text{ (for ...
0
votes
2answers
63 views

Ordered subsets summation

Let $A$ and $B$ two finite ordered sets where $A\subseteq B$. How do I count the number of consecutive and non-consecutive ocurrences of $A$ in $B$? For instance, I have nine ocurrences of set ...
0
votes
0answers
40 views

Zoom progression not linear

I have an algorithm for the editing of an image. There is an image and a rectangle that is smaller than the image (e.g. 3/4 of it) and that represents a section of the image. This section has to be ...
5
votes
3answers
111 views

Understanding this summation identity

I'm currently reading a book in which part of the solution to the problem involve this identity: $$\sum_{j=i+1}^{n}j = \sum_{j=1}^{n}j-\sum_{j=1}^{i}j$$ Which I cannot derive myself. The only thing ...
4
votes
4answers
326 views

Calculation of Bessel Functions

I want to calculate the Bessel function, given by $$J_\alpha (\beta) = \sum_{m=0}^{\infty}\frac{(-1)^m}{m!\Gamma(m+\alpha +1)} \left(\frac{\beta}{2}\right)^{2m}$$ I know there are some tables that ...
1
vote
1answer
38 views

Formula to scale a series that is being bent with a root / power.

I have a reference number, Rx, and a series of numbers, Sx[], to compare to it. Let's call the output Ox[]. I am using a simple square root to accelerate the apparent difference between the reference ...
-1
votes
3answers
2k views

Efficient algorithms for computing Digits Sums Numbers

Is there any efficient way to generate these numbers? The sequence OEIS A038367: Numbers $n$ with property that (product of digits of $n$) is divisible by (sum of digits of $n$). First few: ...
0
votes
1answer
187 views

Represent loop nests as multiple summations?

This may be trivial but I would appreciate if someone could point me in the right direction here.. I am trying to express the number of instances in a loop nest in a general form. As a mathematical ...
2
votes
1answer
54 views

Maximising the product of exponents, but minimising the product of the base raised to its respective exponent

Given the following sequences: let value = $(b_0^{p_0})(b_1^{p_1})\cdots(b_n^{p_n})$ let productOfExponents = $p_0 \cdot p_1 \cdots p_n$ Where $p_i\geq 0$ and $p_i$ an element of $\mathbb{N}$ for ...
2
votes
1answer
191 views

About Self Number, which is found by D. R. Kaprekar.

I'm trying to understand the algorithm to find self-number. But I don't know what does C, k, j, b is mean at this formula. What's that? How do I understand and what should I assign to solve them?
2
votes
1answer
96 views

What's the fastest way to find this sum of “like multiplications”?

Suppose that we have two sequences of $n$ naturals, which we'll call $a$ and $b$. We can denote the $k$th value in the sequence by the term $a_k$ and $b_k$ respectively. We can then define a like ...
1
vote
2answers
66 views

How can we find a new sum of multiplications based on a previous one?

Suppose wehave two sequences: $$(a_0, a_1, a_2, \dots, a_{2^n-1})$$ $$(b_0, b_1, b_2, \dots, b_{2^n-1})$$ We also have the following sum: $$\sum_{k=0}^{2^n-1}{a_k \cdot b_k}$$ I'd like to know the ...
2
votes
2answers
99 views

Formula for the number of 0's in an alternating 0-1 matrix

I was working with a piece of code when I stumbled across a matrix, which is similar to this: $$\begin{matrix} 0&1&0&1&0&1&0&\cdots\\ ...
5
votes
2answers
186 views

An algorithm for making conditionally convergent series take arbitrary values?

This thread reminded me of an old unsettled question I have. Given an arbitrary conditionally convergent series $\beta=\sum\limits_{k=1}^\infty a_k$ and a target value $\alpha$, is there an algorithm ...
1
vote
0answers
179 views

Applications of Convergence of a series in Algorithms

We were introduced to testing the convergence of a series & calculating the point of convergence in the first maths of college curriculum. I wish to explore its usage in computer algorithms. ...
6
votes
1answer
156 views

Can we evaluate the any single decimal digit of pi even we skip the digit before it?

Can we evaluate any single decimal digit of pi even we skip to evaluate the digit before it?
5
votes
2answers
307 views

Accelerating Convergence of a Sequence

Suppose I had a monotonically increasing sequence $\{d_{n}\}$ which is also bounded above. The $d_{n}$'s satisfy a given recurrence, however computationally they tend very slowly to the limit. What ...
0
votes
2answers
154 views

How can I create an equation for a Gaussian distribution based on a sum of a series?

I am trying to create an equation that will generate a Gaussian distribution such that y = the sum of f(x) in a series of integers 1->28. I have y and want to know what the value of x at each integer ...
1
vote
0answers
61 views

Heuristic for adding items to a sorted list when exact comparison is unknown

a sorting question! Background: I've got a list of ~500 scrum tasks with a coarse priority (very high, high, medum, low, very low) and of course unique ids. Using those, I can define an ordering ...
2
votes
1answer
162 views

Counting digits in an arithmetic sequence

Given $a, d, n, x$. Suggest me a suitable algorithm to compute the number of times the digit $x$ appearing in the arithmetic sequence $a, a + d, a + 2 \times d, \cdots, a + n \times d$. For ...
2
votes
1answer
1k views

Question on Solving a Double Summation

$$ \sum_{i=0}^{n-2}\left(\sum_{j=i+1}^{n-1} i\right) $$ Formulas in my book give me equations to memorize and solve simple questions like $$ \sum_{i=0}^{n} i $$ ... However, For the question on top, ...
1
vote
1answer
278 views

How to prove that this sequence converges?

I created a certain algorithm and now I try to prove it's convergence. Here is the essence of the algorithm: Given are finite sets $A_i$, positive constants $\alpha_a$, and a sequence $ ...
0
votes
5answers
489 views

How to evaluate $\displaystyle\sum_{i=1}^{n/2}1$

I am trying to measure complexity of the following code segment int sum = 0; for (int i = 1; i <= n/2; i++) { sum++; } As far as I understand it can be ...
0
votes
1answer
64 views

Minimum number of numbers to be inserted in a sequence to transform it into an A.P

Given a sequence of N numbers, how can we find the minimum number of numbers to be inserted to make this sequence to an Arithmetic progression.(we can insert at any position of this sequence) For ...
10
votes
1answer
205 views

Split up $n \in \mathbb{N}$ into sum of naturals with maximum LCM

Question: Given some natural number, we can of course split it up into various sums of other naturals (e.g. $7 = 6 + 1 = 1 + 4 + 2 = \ldots$) More precisely, for $n \in \mathbb{N}$, we can a find ...
1
vote
3answers
180 views

Calculate integer summation when lower bound is a variable

How do you calculate the following summation? $\sum_{i=k}^n i$