Questions tagged [integer-sequence]

109 questions
14
votes
10 answers

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 have this written fibonacciSequence[n_] := Module[{fPrev = 0, fNext = 1, i = 0}, While[i++ < n, {fPrev, fNext} = {fNext,…
Adrian
  • 141
  • 1
  • 3
14
votes
2 answers

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 sequences sec[n] that grows with n? For example: sec[0]={1} sec[1]={1, 1} sec[2]={1,…
Kagaratsch
  • 11,955
  • 4
  • 25
  • 72
7
votes
3 answers

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 I look at the indices of the unit cells that are…
Galilean
  • 569
  • 2
  • 9
5
votes
1 answer

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, the data length is about 800) Can the next element be obtained as a probability value…
Milk
  • 1,688
  • 10
  • 9
3
votes
1 answer

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.
MATIRMAK
  • 739
  • 3
  • 16
3
votes
1 answer

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 are infinitely many) that would be compatible with the above terms. Mathematica finds a…
2
votes
2 answers

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 reason it's not being implemented properly in my For loop. For[n = 2, n <= 10, n++, …
user170231
  • 1,611
  • 1
  • 11
  • 17
2
votes
1 answer

Strange behaviour if FindSequenceFunction

Consider a sequence starting with 2, subtract 2 to get the next term, now add 3 to get the next term and so on according to the rule (-2,+3) consecutively which starts like s = {2, 0, 3, 1, 4, 2, 5, 3, 6, 4}; and ask for the sequence…
Dr. Wolfgang Hintze
  • 13,039
  • 17
  • 47
2
votes
2 answers

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 looking at. Mathematica's FindSequenceFunction…
Yaroslav Bulatov
  • 7,793
  • 1
  • 19
  • 44
2
votes
1 answer

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 elegant to way how to approach that? I am trying…
Fyris
  • 23
  • 2
2
votes
2 answers

Mathematica analog to Wolfram|Alpha dataset analysis

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,+1,+8,+7,+14,+13,+4 This gives the…
Jamie M
  • 503
  • 2
  • 7
2
votes
2 answers

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 ?) can show the cutting. That is the column label…
Ivy Gao
  • 101
  • 3
1
vote
1 answer

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\}}$ is unimodal. Let us recall that the sequence is…
Maciej Ulas
  • 195
  • 5
1
vote
2 answers

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, the first before the box, the second after the…
vito
  • 8,958
  • 1
  • 25
  • 67
0
votes
1 answer

How to condense many FindSequenceFunctions into a single one?

I have a function $f(n,k)$ that is rather large and complex, but if I hold $k$ constant and feed values into Mathematica over many $n$, I can get a closed-form expression for that $k$. However, I can't seem to find a good way to feed the whole…
MrTrax
  • 3
  • 2
1
2