Recamánlike sequence

37 views
Skip to first unread message

Kelvin Voskuijl

unread,
Sep 1, 2025, 7:00:38 AM (7 days ago) Sep 1
to SeqFan
Hello fellow seqfanners.
once made a new kind of Recamánlike sequence 
First terms

1,3,7,2,8,17,27,16,4,17,31,46,28,9,29,40,18,41,65,40,14,44,12,45,11,46,10,47,85,124,82,39,87,38,88,37,89,,36,90,35,91,34,92,,33,83

The rules are
- adding or subtracting numbers that are in the sequence earlier is skipped
- for each index, the number added or subtracted is index+ number of skipped numbers (for instance, at index 4 we use 5, because we skipped one number (3), and at 7. we use 10.because we skipped three numbers (3,6,8)

Otherwise the rules are as in normal Recamán
I am however struggling to give a good description for the NAME field of OEIS.

Kelvin Voskuijl

Geoffrey Caveney

unread,
Sep 1, 2025, 10:57:56 AM (7 days ago) Sep 1
to seq...@googlegroups.com
I think I understand the process for Kelvin Voskuijl's Recamánlike sequence. The description was a bit confusing because there was a number typo in it: "...we skipped three numbers (3,6,8)" should read "...we skipped three numbers (3,7,8)".

I will attempt to describe the process more clearly in words, and then attempt to provide a mathematical definition for the sequence as concisely as possible (which is somewhat difficult in this case).

In Recamán's sequence, the absolute value of the difference between consecutive terms is always n, so the sequence of absolute values of differences between terms is simply the positive integers in order 1,2,3,4,5,.... But in the sequence here, if a number has already occurred as any previous term in the sequence itself, it cannot occur thereafter as such a difference between terms in the sequence. For example, for a(3), we cannot use +/- 3 because 3 itself already occurred in the sequence. Thus, a(3) = a(2) + 4. Further, each difference between terms can only occur once in the sequence, and each difference must be greater than any previous difference, as in Recamán's sequence. So a(4) = a(3) - 5 and a(5) = a(4) + 6. But to determine a(6), we cannot use 7 or 8 as the difference, because 7 and 8 themselves already occurred in the sequence, so here the difference jumps ahead to 9: a(6) = a(5) + 9. The next such "jump" in the absolute value of the difference between consecutive terms occurs at a(13) = a(12) - 18, because 16 and 17 cannot be used since they already occurred in the sequence.

The distinctive feature of the new sequence is that the absolute value of each difference between terms |a(n) - a(n-1)| is the smallest positive integer that has not already occurred either as a *term* in the sequence or as the absolute value of a *difference* between consecutive terms in the sequence up to a(n-1).

To define this sequence mathematically, define x_n as the smallest positive integer that has not already occurred either as a term in the sequence or as the absolute value of a difference between consecutive terms in the sequence up to a(n-1). Then we may define a(n) as a(n-1) - x_n if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + x_n.


--
You received this message because you are subscribed to the Google Groups "SeqFan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seqfan+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/seqfan/51f75a23-6251-444a-9fb1-ca8a31bb24e3n%40googlegroups.com.

Geoffrey Caveney

unread,
Sep 1, 2025, 1:01:17 PM (7 days ago) Sep 1
to seq...@googlegroups.com
I further observe that Kelvin Voskuijl's sequence prohibits a value of |a(n) - a(n-1)| from occurring if that value has already appeared as a term in the sequence, but it does not prohibit a term from occurring if the value has already appeared as the absolute value of a difference of terms in the sequence. For example, a(2) - a(1) = 3 - 1 = 2 does not prohibit 2 from occurring as the value of a(4).

If one restricts each positive integer to occurring only once, *either* as a *term* in the sequence, *or* as the absolute value of a *difference* of consecutive terms in the sequence, but not as both, this produces the following interesting sequence:

1,3,7,12,18,10,19,30,17,31,16,36,57,35,58,34,59,33,60,32,61,98,136,97,137,96,138,95,...

It appears that both this sequence and Kelvin Voskuijl's sequence produce long "zigzag" strings in which a(n) = a(n-2) + 1 and a(n+1) = a(n-1) - 1.

Note that 6 is the absolute value of the difference |a(5) - a(4)|, so it is disallowed as the value of a(5) itself, which thus must be 12 + 6 = 18.

Each positive integer is guaranteed to appear exactly once in this sequence, *either* as a term, *or* as the absolute value of a difference between consecutive terms.

Mathematical definition:

a(1) = 1 ;
Define x_n as the smallest positive integer that has not already occurred either as a term in the sequence or as the absolute value of a difference between consecutive terms in the sequence up to a(n-1).
a(n) = a(n-1) - x_n if nonnegative and not already in the sequence either as a term or as the absolute value of a difference between consecutive terms, including x_n itself.
a(n) = a(n-1) + x_n otherwise.

K. Voskuyl

unread,
Sep 5, 2025, 7:31:03 AM (3 days ago) Sep 5
to seq...@googlegroups.com
This inspired me to submit the following sequence 


a(0) = 0; for n > 0, a(n) = a(n-1) - n if nonnegative and not already in the sequence, not equal to a number used earlier as difference and not equal to n, otherwise a(n) = a(n-1) + n.

  0, 1, 3, 6, 10, 15, 9, 16, 24, 33, 23, 12, 24, 37, 51, 36, 20, 37, 19, 38, 58, 79, 57, 34, 58, 83, 109, 82, 54, 83, 53, 84, 52, 85, 119, 154, 118, 81, 43, 82, 42, 83, 125, 82, 126, 171, 217, 170, 122, 73, 123, 72, 124, 71, 125, 70

Op ma 1 sep 2025 om 19:01 schreef Geoffrey Caveney <geoffre...@gmail.com>:

Nahar Alanazi

unread,
Sep 5, 2025, 7:32:46 AM (3 days ago) Sep 5
to seq...@googlegroups.com


في جمعة، ٥ سبتمبر، ٧ ريوا في ٢:٣١ م، كتب K. Voskuyl <kelvin....@gmail.com>:
https://groups.google.com/d/msgid/seqfan/CANrFLRk3gym4dnW0KGjvQ3RXwLrFxNhdDAzH6-qH4GA6aWFToA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages