Sequence and first differences together list all positive numbers exactly once
18 comments
·June 25, 2025vishnugupta
Horffupolde
The sequence union the differences span all integer values.
8organicbits
OEIS is such a wonderful reference. I've had occasions where software I was building needed to compute certain sequences, but I hadn't yet figured out the underlying math. I popped the sequence into OEIS and found the closed form solution. It was a huge productivity boost.
nurettin
For me it was a favorite place to visit every so often. I also really enjoyed mathworld.wolfram.com a few decades ago. (A true shame that he went insane)
foodevl
I don't know (and don't need you to elaborate on) exactly what you're referring to in that last sentence, but I suspect you are confusing Eric W. Weisstein with Eric Weisstein.
quietbritishjim
More likely he's confusing the mathworld author with Stephen Wolfram
volemo
> A true shame that he went insane
Could you elaborate on your reasons for calling Eric Weisstein insane?
OscarCunningham
Is there a sequence where the sequence and all its differences contain each positive integer once?
Something like
1 3 9 26 66
2 6 17 40
4 11 23
7 12
5
Oh, here it is: https://oeis.org/A035313null
cluckindan
Recursive (n choose 2) is my favorite.
If you think about it, it quantifies emergence of harmonic interference in the superposition of 4 distinct waveforms. If those waveforms happen to have irrational wavelengths (wrt. each other), their combination will never be in the same state twice.
This obviously has implications for pseudorandomness, etc.
kleiba
Coding exercise: write a function
boolean isInSequence(n):
that decides whether the given integer is part of that sequence or not. However, pre-storing the sequence and only performing a lookup is not allowed.asboans
I don’t know but I think I could probably implement IsInSequenceOrFirstDifferences(n)
haskellshill
How about the following Haskell program?
rec ((x:xs),p) = (filter (/= p+x) xs,p+x)
sequ = map snd $ iterate rec ([2..],1)
sequ is an infinite list of terms of the sequence A005228.vbezhenar
Compute the sequence until you get n or m > n?
HocusLocus
Like 'even and odd' on steroids.
Can someone please explain this to me? I tried to make sense but couldn’t.