# Questions tagged [integer-sequence]

The tag has no usage guidance.

71 questions
Filter by
Sorted by
Tagged with
285 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: ...
925 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 ...
101 views

### Integer sequence and RAM limits

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 ...
834 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 ...
92 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,+...
565 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 (...
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 ...
59 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: ...
57 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, ...
83 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 ...
664 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, ...
117 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 ...
63 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 ...
97 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 ...
82 views

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,...... 8answers 2k views ### Is it possible to invoke the OEIS from Mathematica? I had always wondered if there might be a way to write a function, which I'll call OEISData[], that more or less works as a curated data function for The On-Line ... 3answers 111 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 ... 3answers 4k views ### Easier program for period of Fibonacci sequence modulo p For a little project I need to calculate the period of a Fibonacci sequence modulo p, for which p is a prime number. For example, the Fibonacci sequence modulo 19 would be: $$0, 1, 1, 2, 3, 5, 8, 13, ... 3answers 143 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 ... 1answer 49 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? 1answer 57 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) ... 2answers 387 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 ?)... 2answers 92 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 ... 5answers 655 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\} (... 0answers 52 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\}} ... 2answers 328 views ### How do I graph only integers using the list function? I have plotted the following function using the following code: ... 1answer 113 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 ... 1answer 531 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. 0answers 60 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? ... 1answer 223 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 ... 2answers 87 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 ... 5answers 15k views ### How to detect if a sequence of integers is consecutive I'm not a math-guy really (a programmer actually) and this is my first question. And excuse me if I can not explain my problem good. The problem is I have a sequence of integers and I want to detect ... 1answer 149 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 ... 3answers 829 views ### Partitioning a number into consecutive integers Consider n=45; then$$1+2+3+4+5+6+7+8+9=455+6+7+8+9+10=457+8+9+10+11=4514+15+16=4522+23=45$$Question: how to find all representations of a ... 4answers 3k 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 ... 2answers 376 views ### Generate the Fibonacci sequence with Accumulate Is there a way to generate the Fibonacci sequence with the Accumulate function? 1answer 83 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 ... 1answer 103 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 ... 0answers 224 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 ... 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 ... 2answers 176 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}+\... 1answer 113 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: ... 1answer 308 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}$... 2answers 368 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,... 10answers 5k views ### Fibonacci Sequence Generator I'm trying to write a function in Workbench which will generate a Fibonacci sequence starting with F0 = 0 and F1 = 1. So far I ... 3answers 310 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.}$... 2answers 87 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...
98 views

### Unexpected behavior of FindGeneratingFunction

FindGeneratingFunction will give up to computer sometimes?Such as FindGeneratingFunction[{1, 4, 6, 4, 1}, x] But actually the ...