Questions tagged [integer-sequence]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4 votes
0 answers
63 views

Calculate an n-order determinant by FindSequenceFunction

Calculate an n-order determinant: $\left|\begin{array}{cccccc}1 & 2 & 3 & \cdots & n-1 & n \\ n & 1 & 2 & \cdots & n-2 & n-1 \\ n-1 & n & 1 & \cdots ...
  • 1,513
3 votes
1 answer
53 views

How can I convert sequences to sharings and vice versa?

Given positive integers $k,n$, a $k$-sequence of $I_n$ is a list of $k$ not necessarily distinct elements of $\{1,\dots, n\}$. And an $n$-sharing of $I_k$ is a list of $n$ possibly empty, disjoint ...
2 votes
1 answer
203 views

Is there a Mathematica function that generates all ordered partitions?

My book defines a length $k$ ordered partition of $I_n$ as a sequence of $k$ disjoint, possibly empty subsets of $\{1,\dots, n\}$ that union up to $\{1,\dots, n\}$. Is there a mathematica function ...
3 votes
2 answers
115 views

Generate a sequence of all cases

There is a sequence of numbers that satisfies $a_1=2$, $a_n-a_{n-1}\in \{1,3,5\}$ I tried to enumerate all possibilities using the code below ...
  • 4,984
1 vote
0 answers
66 views

“Largest” symbolic common factor of an integer sequence (not simply GCD)

Suppose, I have a finite fragment of a quickly increasing sequence of integers $\{a_n\}$ that is too complex, unusual, or irregular for FindSequenceFunction to find ...
2 votes
0 answers
53 views

Is there a feasible way to passively crosscheck sequences against the OEIS database?

What this questions is not: Can I access OEIS from Mathematica? This topic has been raised more than once and has been well addressed. Here's the situation as it seems to me: OEIS is a tremendously ...
  • 626
2 votes
1 answer
116 views

Faster way to generate a sequence of numbers

There is a sequence of Numbers that satisfies (1) $a_1+p\geq 0, a_2+p=0, p\in R$ (2) $a_{4n}>a_{4 n-1}, (n=1,2,...)$ (3) $a_{m+n}\in\{a_m+a_n+p, a_m+a_n+p+1\}, (m,n=1,2...)$ I tried to list the ...
  • 4,984
1 vote
1 answer
126 views

Exponential Decay fit and printed parameters with integer data [closed]

Problem: I'm trying to plot an exponential decay curve on a set of integer data, and print the various parameters and their uncertainties on the plot itself. Having adapted code from another question, ...
  • 481
3 votes
1 answer
202 views

Using dynamic programming to compute an integer sequence

Let a[n] = n + 1 - a[EulerPhi[n]], n integer > 0. I have Python code that generates the sequence using dynamic programming. How can I achieve the same thing elegantly/idiomatically in Mathematica? ...
11 votes
3 answers
1k views

How can I program the last digits of Fibonacci numbers?

Is there a way to compute the last digits of an arbitrarily large Fibonacci number? For the $10^n$th Fibonacci number, we can just find the $2^n$-th Fibonacci number (if that isn't too large) $\bmod n$...
  • 333
0 votes
1 answer
75 views

Estimate limit of sequence

The following sequence may have two limits, depending on the parity of $n$ as shown here: $$a_n=(1-\frac{1}{2!})^{(\frac{1}{2!}-\frac{1}{3!})^{\ldots^{(\frac{1}{n!}-\frac{1}{(n+1)!})}}}$$ I have tried ...
3 votes
2 answers
140 views

I cannot get the convolution of Jacobsthal(n) and 3^n using Convolve[], DiscreteConvolve[] or ListConvolve[]

I am working on a problem where I found that the system I am working with follows OEIS A094705 which is the: "Convolution of Jacobsthal(n) and 3^n". So I have tried using the recursive formula ...
  • 309
3 votes
2 answers
178 views

Finding 36 integer solutions to a set of 14 equations using various boundary conditions

What is good way to solve this system of equations? I have it run now for quite some time and it does not spit out a solution. ...
  • 1,765
1 vote
2 answers
109 views

Solving a big system of equations using certain conditions

I have the following problem: I want to solve a big system of equations for a certain number of variables which I call $a_k$, the variables need to satisfy the following conditions: all $a_k\in\mathbb{...
  • 1,765
4 votes
4 answers
555 views

Fibonacci sequence questions

I want to show that "Out of the first 450 Fibonacci numbers, the odd number is twice as many as even number." with Mathematica. Can you solve it please?
1 vote
2 answers
115 views

Generate a sequence of primes giving position and value of a digit in its digit-decomposed version

The prime sequence starts: ...
3 votes
2 answers
75 views

How to sort Dataset where each row include a sequence of strings and integers

I got this type of data : ...
  • 33
3 votes
1 answer
245 views

Solve transcendental equation involving a built-in function [closed]

How can I solve an equation of the following form? $$x = 10+\mathrm{\mathbf{PrimePi}[x]}$$ where $x$ is an integer. I am using Solve but am getting the following ...
  • 483
2 votes
0 answers
76 views

Finding sequence limits from matrix determinants

I have a problem whereby I want to calculate the limit of a sequence of determinants of matrices of increasing dimensions using the DiscreteLimit command. To illustrate this, I use an example with a ...
  • 889
1 vote
1 answer
95 views

Solving an equation in integers giving an error message

I've the following code: ...
  • 1,765
7 votes
3 answers
206 views

Generating a certain sequence

I have indexed the unit cells of the Kagome lattice. Each unit cells consists of atoms $(A,B,C)$. In this cell there are $21 \times 3$ sites. From this picture above I see a pattern is emerging when ...
  • 519
2 votes
1 answer
124 views

Generating number sequence

I am very new to mathematica. I am trying to generate list of number sequence. I want to make 6 sequences. 1 - 10, 10 - 100, 100 - 1 000, 1 000 - 10 000, 10 000 - 100 000. All reversed. Is there any ...
  • 23
0 votes
0 answers
102 views

Accessing internal calculations of Mathematica code

For a given Mathematica program that generates a sequence x of integers, is it possible to also generate equal length sequences of integers that were used internally by the Mathematica kernel to ...
  • 445
3 votes
2 answers
260 views

solve for two variables for each n related to Collatz conjecture

For this code, for each x I would like to solve for all value ranges for c1 and c2 in a bounded range ie c1 and c2 in the range of real numbers +-100 for c1 and c2 for each x, which combined give "...
  • 445
1 vote
1 answer
224 views

Finding recurrence formulas from procedural code and output lists associated with integer sequences

This code outputs 37 sequences and takes about 15-minutes to run. I would like to be able to see how many and which variables { i, j, k, m, n } each of the 37 ...
  • 445
8 votes
5 answers
336 views

Return last number in sub-sequences in a list of integers

Given a list of integers like this: z = {113, 117, 118, 119, 120, 121, 475, 476, 529, 538, 542, 543, 544} I want a function that returns: ...
1 vote
0 answers
117 views

Integer sequence and RAM limits [closed]

I am trying to calculate the set of unique differences in a sequence, however the sequence grows fast and I hit the RAM limit of my PC for nthPrimeToUse = 11. For nthPrimeToUse 1 to 10 the output of ...
  • 445
22 votes
4 answers
1k views

Generate and graph the Recamán Sequence

I was surprised to see that we don't have any posts that mention the Recamán Sequence, so I figured I should post it as a challenge. By definition, $a_0=0$ and $a_n=a_{n-1}-n$ if the r.h.s. is ...
6 votes
4 answers
914 views

RandomInteger with equal number of 1 and -1

I want to generate a list of random integers with only three values 1,0,-1. I know it can be done through RandomInteger[{-1, 1}, n]. How can I impose constraint on this list so that every integers in ...
  • 657
2 votes
2 answers
125 views

Mathematica analog to Wolfram|Alpha dataset analysis [closed]

I have a set of sequences with length 8,48,480,5760,.. and would like to do sequence analysis on them. I plugged the length 8 sequence into wolframalpha: https://www.wolframalpha.com/input/?i=11,+2,+...
  • 445
4 votes
1 answer
113 views

Something is wrong with the implementation of the ThueMorse function

While trying to answer this Math.SE question, I believe I found several bugs in Mathematica and Alpha relating to the Thue-Morse sequence. As a quick reminder, the $n^{\rm th}$ element of the Thue-...
  • 795
1 vote
0 answers
47 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 ...
  • 111
3 votes
1 answer
73 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: ...
  • 341
2 votes
1 answer
173 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 ...
user avatar
12 votes
3 answers
1k views

How to construct rectangular figures from the Fibonacci numbers?

How do you construct rectangular figures ("golden rectangles") using the Fibonacci numbers in Mathematica using graphics? I know that the basis of the construction of these figures are the formulae ...
user avatar
0 votes
1 answer
78 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
1 answer
92 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 ...
  • 255
3 votes
1 answer
105 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
1 answer
346 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,......
  • 11
5 votes
1 answer
193 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, ...
  • 1,091
5 votes
3 answers
222 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
1 answer
58 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?
user avatar
1 vote
1 answer
89 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) ...
  • 125
2 votes
2 answers
446 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 ?)...
  • 101
6 votes
2 answers
110 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
5 answers
786 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\}$ (...
user avatar
1 vote
1 answer
116 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
2 answers
2k views

How do I graph only integers using the list function?

I have plotted the following function using the following code: ...
  • 135
2 votes
1 answer
122 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 ...
  • 6,675
3 votes
1 answer
595 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.
  • 727