Questions tagged [integer-sequence]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
2 answers
117 views

Recovering formulas for sequences with integer coefficients

Suppose I know the sequence is of the $a n^4 + b n^3 + c n^2 + d n$, with positive integers $a,b,c,d$, what is the easiest way to get them from the first few coefficients? Here are the sequences I'm ...
Yaroslav Bulatov's user avatar
20 votes
6 answers
826 views

Peaks, plateaus and ledges

I want to find the peaks, plateaus and ledges of an integer sequence, but all my attempts failed. 1. Example list ...
eldo's user avatar
  • 49.2k
5 votes
4 answers
181 views

Joining constant arrays determined by a subsequence of contiguous block of ones

I have the following: data = {15, 25, 35, 45, 55, 65, 75, 85, 95, 105}; selector = {0, 1, 1, 0, 1, 1, 1, 0, 0, 0}; I want to create the following list from ...
IntroductionToProbability's user avatar
9 votes
6 answers
1k views

How can I define a sequence of Integers which only contains the first k integers, then doesnt contain the next j integers, and so on

I need a list of integers to check if a variable has one of the values of the list. If[ MemberQ[List,x], Green, Red] The list contains integers and is characterized ...
100xln2's user avatar
  • 427
3 votes
1 answer
104 views

Enumeration of a certain sequence IV

Let $F_n$ denote the $n$-th Fibonacci number. I am interested in the sequence $$a(k, n)=\left | \left \{0 \leq m \leq n: \frac{F_m}{k} \; \text{is a perfect square} \right \} \right |,$$ where $|\...
user227351's user avatar
0 votes
1 answer
41 views

Derivative with respect to a sequence

I want D[Subscript[a, k],Subscript[a,j]] to return something like the Kronecker delta. Is this possible?
Aakash Lakshmanan's user avatar
-1 votes
4 answers
83 views

How to prove that 3(x) + y always results in a triangular number? [closed]

Assume that : x = (n^2-n)/2 y = ((n+1)^2)-(n+1))/2 n is an integer and n ≥ 0 Examples = 3(0) + 1 = 1 3(1) + 3 = 6 3(3) + 6 = 15 and so on.
user1221's user avatar
7 votes
1 answer
266 views

Recurrences related to Ramanujan's 1/pi formulas for level 10?

In the course of my research years ago, I came across three integer sequences related to Ramanujan's pi formulas but for level $10$. Their recurrence relations may be important. (Just like the level $...
Tito Piezas III's user avatar
1 vote
1 answer
54 views

Nested sequence evaluation seems to fail [closed]

I tried do define two OIES Sequences like that: ...
Raphael J.F. Berger's user avatar
0 votes
0 answers
36 views

Coloring cells created by a graph [duplicate]

A few days ago, an article by N. J. A. Sloane appeared on arxiv.org: https://arxiv.org/pdf/2301.03149.pdf, about the history of the On-line Encyclopedia of Integer Sequences. One of the problems ...
Jean-Pierre's user avatar
  • 5,187
5 votes
1 answer
303 views

Writing a number 'm' as a sum of 'n' prime numbers

We can write {2 = 2}, {3 = 2+1, 3 = 3}, {4 = 2+2, 4 = 3+1}, {5 = 3+2, 5 = 2+2+1}, {6 = 3+3, 6 = 5+1, 6 = 3+2+1} and so on. I am trying to write every positive integer as a sum of Prime numbers. In ...
Littlewood's user avatar
2 votes
5 answers
273 views

Subsequences with distinct values

(this question was modified after initial answers) For a sequence x = {6,4,2,4,2,4,6} y = Subsequences[x] gives the list of ...
Jamie M's user avatar
  • 493
4 votes
0 answers
75 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 ...
lotus2019's user avatar
  • 1,943
3 votes
1 answer
62 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 ...
user236343's user avatar
2 votes
1 answer
263 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 ...
user236343's user avatar
3 votes
2 answers
131 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 ...
expression's user avatar
  • 5,562
1 vote
0 answers
76 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 ...
Vladimir Reshetnikov's user avatar
3 votes
0 answers
58 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 ...
Trev's user avatar
  • 763
2 votes
1 answer
162 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 ...
expression's user avatar
  • 5,562
1 vote
1 answer
168 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, ...
Epideme's user avatar
  • 505
3 votes
1 answer
230 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? ...
Emanuel Landeholm's user avatar
11 votes
3 answers
2k 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$...
Allam A.'s user avatar
  • 333
0 votes
1 answer
81 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 ...
zeraoulia rafik's user avatar
3 votes
2 answers
149 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 ...
Robjobbob's user avatar
  • 321
3 votes
2 answers
190 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. ...
Jan Eerland's user avatar
  • 1,941
1 vote
2 answers
148 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{...
Jan Eerland's user avatar
  • 1,941
5 votes
4 answers
586 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?
김태진's user avatar
1 vote
2 answers
125 views

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

The prime sequence starts: ...
Hans Havermann's user avatar
3 votes
2 answers
78 views

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

I got this type of data : ...
MedAB's user avatar
  • 33
3 votes
1 answer
251 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 ...
abcd's user avatar
  • 483
2 votes
0 answers
82 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 ...
Chris's user avatar
  • 983
1 vote
1 answer
96 views

Solving an equation in integers giving an error message

I've the following code: ...
Jan Eerland's user avatar
  • 1,941
7 votes
3 answers
220 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 ...
Galilean's user avatar
  • 549
2 votes
1 answer
407 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 ...
Fyris's user avatar
  • 23
0 votes
0 answers
104 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 ...
Jamie M's user avatar
  • 493
3 votes
2 answers
272 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 "...
Jamie M's user avatar
  • 493
1 vote
1 answer
234 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 ...
Jamie M's user avatar
  • 493
8 votes
5 answers
346 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: ...
Jonathan Kinlay's user avatar
1 vote
0 answers
119 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 ...
Jamie M's user avatar
  • 493
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 ...
AccidentalFourierTransform's user avatar
6 votes
4 answers
952 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 ...
lol's user avatar
  • 677
2 votes
2 answers
128 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,+...
Jamie M's user avatar
  • 493
4 votes
1 answer
117 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-...
Klangen's user avatar
  • 989
1 vote
0 answers
52 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 ...
cjackal's user avatar
  • 111
3 votes
1 answer
83 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: ...
user76284's user avatar
  • 341
2 votes
1 answer
203 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
82 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 ...
user60668's user avatar
3 votes
1 answer
94 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 ...
veo's user avatar
  • 255
3 votes
1 answer
110 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 ...
AccidentalFourierTransform's user avatar