# Questions tagged [integer-sequence]

The tag has no usage guidance.

110 questions
Filter by
Sorted by
Tagged with
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 ...
• 8,135
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 ...
• 49.2k
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 ...
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 ...
• 427
104 views

1 vote
54 views

### Nested sequence evaluation seems to fail [closed]

I tried do define two OIES Sequences like that: ...
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 ...
• 5,187
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 ...
• 145
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 ...
• 493
75 views

• 1,941
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?
• 67
1 vote
125 views

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

The prime sequence starts: ...
78 views

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

I got this type of data : ...
• 33
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 ...
• 483
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 ...
• 983
1 vote
96 views

### Solving an equation in integers giving an error message

I've the following code: ...
• 1,941
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 ...
• 549
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 ...
• 23
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 ...
• 493
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 "...
• 493
1 vote
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 ...
• 493
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: ...
• 1,294
1 vote
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 ...
• 493
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 ...
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 ...
• 677
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,+...
• 493
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-...
• 989
1 vote
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 ...
• 111
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: ...
• 341
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 ...
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 ...
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 ...
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 ...