Is there a generalisation possible for arithmetic progression with dynamic cyclic difference?

47 Views Asked by At

Arithmetic progression with dynamic cyclic difference

Eg: $1, 3, 6, 11, 18, 20, 23, 28, 35...$

Here the difference cycle through $[2, 3, 5, 7]$

Is it possible through generalize it?

Like we generalize regular arithmetic progression as $a + nd$.

1

There are 1 best solutions below

0
On

You may write it as $\lbrace a_i : a_1 = 1, a_i = a_{i-1} + S(i-1 \bmod{4}), S = \lbrace (0,7),(1,2),(2,3),(3,5) \rbrace \rbrace \rbrace $

This is the easiest in my view as primes have a really fuzzy and slightly confusing distribution and hence a general formula can't be made for primes (but when 2 and 3 are excluded, we have $6k + 1$ and $6k + 5$ as some generic forms of primes, but those to hold exceptions). Here, the advantage is that the function the set $S$ returns the required primes in cycles of $4$ (as how you've made the A.P.) so you only need to get the image for $i-1 \bmod{4}$ from the set $S$ and add it to the preceding term.