Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [integer-sequence]

The tag has no usage guidance.

1
vote
0answers
34 views

Find all integer tuples in a bounded region

For given rational numbers $p_1/q_1,p_2/q_2,p_3/q_3$ and a negative integer $d$, I'd like to find quadruples of integers $(w,x,y,z)$ in a rectangle(of particular sidelengths) satisfying the series of ...
3
votes
1answer
55 views

FindGeneratingFunction gives up too easily [closed]

I am trying to automatically find a generating function from the coefficients of a simple rational function using Mathematica's FindGeneratingFunction: ...
2
votes
1answer
114 views

Constructing the following figure using mathematica

How do I construct the figure in the image using the formulae in Mathematica? I defined the following functions for the 4 cases. Can you also explain the significance of these in relation to the ...
9
votes
2answers
626 views

How to construct rectangular figures from the Fibonacci numbers?

How do you construct rectangular figures using the Fibonacci numbers in Mathematica using graphics? I know that the basis of the construction of these figures are the formulae for summing the terms, ...
0
votes
1answer
62 views

How to postulate a formula for the following Mathematica function

I am using Mathematica to explore the properties of the Fibonacci Sequence. Below is the functions I have defined ...
3
votes
1answer
81 views

how to obtain these increasing integers for given n and m?

Let n and m be natural numbers. Then, how does one write a function ordint[n,m] that gives ...
3
votes
1answer
92 views

Guess Diophantine equation from its solutions

Take for example the equation $$ n^2=x^2+y^2+1 $$ where $x,y$ are integers. This equation admits solutions only for some values of $n$, to wit, $$ n=1,3,9,17,19,33,35,51,73,81,99,\dots $$ Can we ...
1
vote
1answer
75 views

Is there a way to exclude certain numbers in a sequence?

For example, the sequence of triangular numbers can be expressed as $1/2 [n (n + 1)]$ with $n=1,2,3,4,...$ but is it possible to create a summation of everything remaining $(2,4,5,7,8,9,11,12,13,14,......
5
votes
1answer
54 views

The next element can be obtained using Predict or SequencePredict?

I want to estimate the next number with the data of the sequence listed as elements 0 and 1. For example, when data = {0,0,1,1,0,0,1,0,0,1,1,0,0,1} (actually, ...
5
votes
3answers
108 views

How to find a list of values of recurrence equation?

I tried with RSolve,but it fails: RSolve[{x[n + 1] == n + Sum[j*x[j], {j, 1, n}], x[1] == 1}, x[n], n] Returns unevaluated ...
0
votes
1answer
47 views

A problem of a sequence and its sum

{a(n)} is such a sequence, satisfying, For all a(i) ∈ {a(n)}, a(i) =1 or -1 Let S(j) = Sum[a(i) , {i ,1, j}], then for all 1<=j<=n ,S(j)>=0. For a given n , how many {a(n)} are there?
1
vote
1answer
52 views

How to perform this indefinite sum?

The following indefinite sum with (CC[n]=1 for even n and CC[n]=i for odd n) ...
2
votes
2answers
383 views

splitting integer problem

I want to cut the integer into small numbers and show me all the possibilities. For example, if I choose integer 6, then I would like to know how many combination of a 5 dimensional vector (or table ?)...
6
votes
2answers
88 views

Selecting integers which are not a member in an ordered list of integers

I have an ordered list of integers, i.e.: list = {1,3,5,6,8,10,12,15}; and I want to know if there is a fast way to get a list of the integers that do not appear ...
9
votes
5answers
649 views

How to tell Mathematica to do this with decimal part of real number?

My apologies if this was asked here before. My friend and I want to do this: Suppose that we have some real number $a. a_1 a_2...a_n...$ where $a_i$ are digits in the set $\{1,2,3,4,5,6,7,8,9,0\}$ (...
1
vote
0answers
46 views

Coefficients of polynomials forming an unimodal sequence

Let $f(x)=\sum_{i=0}^{n}a_{i}x^{i}$ be a polynomial with rational coefficients. I am interested in an efficient way which allows checking whether the finite sequence $A=(a_{i})_{i\in\{0,\ldots,n\}}$ ...
0
votes
2answers
261 views

How do I graph only integers using the list function?

I have plotted the following function using the following code: ...
2
votes
1answer
111 views

efficiently method for generating a sequence

The sequence is defined as $a(1)=1,a(n)=a(n-1)+a\left(\left\lfloor \log _2(n)\right\rfloor \right)$ A natural way do this is ...
3
votes
1answer
521 views

Evaluate large Fibonacci numbers

I want to evaluate that Fibonacci[28143753246]. However the result is OverFlow[]. Is there any way to evaluate it? Thank you.
2
votes
3answers
139 views

Finding the largest palindrome which is the product of two 2-digit numbers

My goal is to find the largest palindrome which is the product of two 2-digit numbers using the following program. I want the program to add each palindrome it finds, to the list H. I also want it to ...
2
votes
2answers
84 views

Producing a particular sequence of integers recursively [closed]

I am supposed to write a function which computes the next integer in a sequence from the given one. For example: nextval[57] should give mm ...
0
votes
0answers
54 views

PARI to Mathematica conversion

I need to use the coefficients T(n,k) in my algorithm and I found a program in PARI Can anybody translate this code to mathematica? ...
3
votes
1answer
147 views

How many terms does FindSequenceFunction need to discover a simple polynomial rule?

Consider a simple sequence starting with seq1 = {429, 1014, 1935, 3264, 5073, 7434, 10419, 14100, 18549, 23838}; We are looking for a rule (of course there ...
20
votes
3answers
815 views

Partitioning a number into consecutive integers

Consider n=45; then $$1+2+3+4+5+6+7+8+9=45$$ $$5+6+7+8+9+10=45$$ $$7+8+9+10+11=45$$ $$14+15+16=45$$ $$22+23=45$$ Question: how to find all representations of a ...
1
vote
1answer
81 views

Why does the FindSequenceFunction command sometimes succeed with subsequences, while failing for the longer sequences?

I've encountered this phenomenon a number of times--and can provide specific examples if requested. For example, I have a 75-long sequence of rational numbers for which the FindSequenceFunction fails ...
6
votes
1answer
100 views

Are there different Method options that can be used with FindSequenceFunction?

The help page states that Method is an option to use with FindSequenceFunction, but I don't find any further information. (There ...
11
votes
0answers
214 views

Find sequence of sequences?

There is a function FindSequenceFunction in Mathematica, that can identify a sequence of integers based on a few first elements. But what if I have a set of finite ...
11
votes
4answers
2k views

How to implement recursive function

I'm trying to do the following (taken from an answer by Watson to my question on Math SE): Start with $x_1=2$, say. Then define $$x_{n+1} = |\{i \in \{1,\dots,n-1\} \;:\; x_i=x_n\}|$$ i.e. number ...
1
vote
1answer
214 views

How to define amazing Goodstein's sequence?

There is an amazing and counterintuitive theorem: For all $n$, there exists a $k$ such that the $k$-th term of the Goodstein sequence $G_k(n)=0$. In other words, every Goodstein sequence ...
0
votes
1answer
279 views

How to sum over half integers? [closed]

I have an expression of the form Sum[1 + x^n + x^(n^2/2), {n, 0, 10}] but I want to sum over half integers, that is, I require that $n \in \mathbb{Z}+\frac{1}{2}$ ...
1
vote
2answers
328 views

Find the Kimberling Sequence

How to find the Kimberling Sequence by using Mathematica? each row is obtained from the previous by boxing (and expelling) the main diagonal element, and then reading the first number after the box,...
3
votes
1answer
109 views

The permutation of given number sequence that has specific correlation with another

I am interested in the relationship between the Pearson correlation coefficients and the permutations of two random number sequences. An initial Mathematica study is as below: ...
6
votes
3answers
306 views

Find the number of $n$ such that $n!$ is a sum of three squares

I want to check the following theorem by using Mathematica: $\textbf{Theorem} $. $\text{The estimate}$ $\# \{n \le x:n! \text{ is a sum of three squares}\}=7x/8+O(x^{2/3})$ $\text{holds.}$...
2
votes
1answer
95 views

Unexpected behavior of FindGeneratingFunction

FindGeneratingFunction will give up to computer sometimes?Such as FindGeneratingFunction[{1, 4, 6, 4, 1}, x] But actually the ...
3
votes
0answers
55 views

Prepending a sequence with zeros gives `FindGeneratingFunction` hard time

Asking for FindGeneratingFunction[{1, 3, 11, 43, 171, 683, 2731, 10923, 43691, 174763}, t] gives the answer (namely ...
4
votes
3answers
376 views

Opposite Collatz Conjecture

I'm trying to explore what would happen if you change the collatz conjecture to flip the equations for odds and evens. So if you have an even number you multiply by 3, add 1, and divide by 2. If you ...
2
votes
1answer
95 views

FindInstance skips solutions

I have an equation to compute the bit-error rate of a binary symmetric channel: $$P_{err}(n,p) = \sum_{k = \frac{n-1}{2} + 1}^n\binom n k p^k(1-p)^{n-k}$$ I then want to find the smallest $n$-...
2
votes
2answers
174 views

Engel expansion

How do I do an Engel expansion in Mathematica? And find the unique non-decreasing sequence of positive integers $ \{ a_1 ,a_2,a_3,\dots \}$ , such $$\frac{e}{\pi}=\frac{1}{a_1}+\frac{1}{a_1 a_2}+\...
0
votes
1answer
80 views

How to calculate digits of Trott Constants?

How to calculate digits of numbers (Trott Constant) whose continued fraction representation is the same as the digits of its radix representation with Mathematica?
11
votes
2answers
281 views

Animating a growing ListPlot

I stumbled upon this (rather contrived but interesting) integer sequence. As it exhibits quite different behaviour at different scales, I would like to generate an animated ...
4
votes
2answers
913 views

How to plot the Fibonacci convergence to the golden ratio?

I am interested to plot a convergence result of the Fibonacci sequence, namely $\frac{F(n+1)}{F(n)}\rightarrow\phi$ as $n\rightarrow\infty$. So far I have created the following plot: So, I am ...
3
votes
2answers
99 views

How do I determine the 15th Lucas term in the 3rd order?

I want to implement the Lucas n-Step Number. This command taken from here doesn't seem to work, am I using the right command? ...
10
votes
9answers
3k views

How can I make a Tribonacci sequence in the form of a list?

How can I make a Tribonacci sequence that is in listing form? it suppose to look like the Fibonacci sequence but I couldn't get ...
6
votes
1answer
145 views

Find subsequence A in sequence B A007908 - OEIS

I have sequence A as A007908 - OEIS and pattern B which is a sub-sequence of that sequence A. I need to find index of first occurrence of the given pattern. For example pattern ..1010... I've looked ...
2
votes
2answers
188 views

Building a sequence of the digits of π

Just for fun, I'm trying to write up some code that will list a finite number of the digits of pi, i.e. {3,1,4,1,5,...,#}. I have the general pattern, but for some ...
1
vote
2answers
370 views

Generate the Fibonacci sequence with Accumulate

Is there a way to generate the Fibonacci sequence with the Accumulate function?
24
votes
3answers
551 views

Speeding up the built-in Rudin-Shapiro and Thue-Morse sequence functions

Version 10.2 introduced two well-studied sequences as functions: the (Golay-)Rudin-Shapiro sequence (RudinShapiro[]) and the (Prouhet-)Thue-Morse sequence (...
3
votes
4answers
464 views

Print all numbers from a sequence which don't contain the digit 7

so i have this: Cases[RecurrenceTable[{a[n + 1] == 7 a[n] + n, a[1] == 1}, a, {n, 7}], Except[7]] But i noticed that it will only exclude numbers that are 7, and ...
0
votes
2answers
86 views

What would be the most efficient way of finding the first repeated term in Sylvester's sequence modulo the $n$th prime?

If a multiple of a prime, say 13, occurs in Sylvester's sequence, then Sylvester's sequence modulo that prime eventually gets stuck on a bunch of 1's, and FixedPoint...
7
votes
2answers
620 views

Finding large Collatz Sequences, trying to improve speed

Background: I am already very much in love with Mathematica but I am also a novice. So far I have only gathered experience in procedural programming in Python. Generally speaking I am trying to ...