Questions tagged [integer-sequence]
The integer-sequence tag has no summary.
115 questions
4
votes
1
answer
125
views
Turning integer sequences into an elastic gold bracelet
I want to turn finite integer sequences, or a finite subset, into an elastic bracelet. Below I have answer for how to do this that took me a while to think of how to do. It still isn't perfect as the ...
4
votes
2
answers
162
views
Partitions of an integer into sums of nonnegative integer powers of its decimal digits
Problem statement: I am trying to write a function that calculates the number of distinct ways an integer can be expressed as a sum of nonnegative integer powers of its decimal digits and return this ...
3
votes
2
answers
297
views
Count the longest streak output
Given a number, I am trying to find the longest streak of positive divisibility into sequential smaller numbers. Here's an example:
We have this 2D list:
...
1
vote
2
answers
227
views
Table takes too long to generate a recursive sequence
Here is, I think, a relatively simple code to generate a recursive sequence, but it takes Mathematica forever to generate those tables. I can understand maybe why it takes so long to generate the ...
9
votes
7
answers
499
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:
...
2
votes
1
answer
147
views
How to find a closed form for this pattern (if it exists)?
Suppose we have the following code:
...
0
votes
1
answer
156
views
10
votes
8
answers
1k
views
How can I define a sequence of Integers which only contains the first k integers, then doesn't 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 ...
7
votes
4
answers
211
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 ...
5
votes
6
answers
716
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?
3
votes
6
answers
483
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 ...
6
votes
3
answers
146
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
278
views
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
...
2
votes
2
answers
166
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 ...
20
votes
6
answers
1k
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
...