I am trying to generate a sequence
for Example as shown below ::
> s
[1] 1 5 7 10
>s.Generated_Seq
[1] 1 2 9 10 13 14 19 20
> s
[1] 2 5 7 10
>s.Generated_Seq
[1] 3 4 9 10 13 14 19 20
Note : when sequence is started from 1 its generated sequence should start from 1 only and if sequence is started from 2 or 6 or 15 or any number generated sequence should be multiple of that number.
We can create a function that takes a
vector
as input argument and returns the transformed output based on the logic describeddata