# Formula for the sequence 1, 1, 1, 21, 3, 1, 4, 1, 5, 1, 6, ... if the 21 isn't a mistake

The sequence 1, 1, 1, 21, 3, 1, 4, 1, 5, 1, 6, ... appeared in one of my tutorial sheets in 2019. I assumed that the fourth term, 21, was a mistake (was supposed to be ..., 2, 1, ...) then it made perfect sense to say this must have a formula f(n)=1 when n is odd and f(n)=n/2 when n is even. However, I was told the sequence had no mistake.

• Maybe they didn't want to admit to their mistake :) Commented Aug 30, 2020 at 20:57
• Yeah, I think it's pretty obvious that it's supposed to be 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6... Commented Aug 30, 2020 at 21:20
• The OEIS (On-line encyclopedia of integer sequences) is the go to source for questions like this and also lends support to the 21 being a 2, 1. Commented Aug 31, 2020 at 4:22
• What was the level of the other exercices in the course you were following ? Were they tricky and sophisticated, or simple ? Would 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6... be oddly trivial compared to the other assignments ? Commented Nov 19, 2021 at 14:05
• Please read this post to get an idea of why such pattern-finding puzzles are bad. Which is of course not your fault. If there really was no mistake in that tutorial sheet then it is just junk. Commented Nov 19, 2021 at 15:05

maybe 21 wasn't a mistake.

21,91,171,231,351,561,741 etcc are triangular numbers with cadence 1, obtained from the progressive arithmetic sum 1 + 2 + 3 + 4 + 5 + 6 ..... from the sequence it is clear that 21 is obtained from (6 + 1) * (6/2) and that the other numbers are obtained by the formula (x + 1 + k) * (x + k) /2

where x = 6

k=(+7,+5,+3,+5 ) repeted n times

(6+1+7)*(6+7)/ 2 = 91,

(6+1+7+5)*(6+7+5)/2=171

(6+1+7+5+3)*(6+7+5+3)/2 =231

(6+1+7+5+3+5)*(6+7+5+3+5)/2=351

(6+1+7+5+3+5+7)*(6+7+5+3+5+7)/2=561

so the sequency became: ...1,6,1,7,1,8,1,91,10,1,11......1,16,1,171,18 etc

• It looks very arbitrary to me. If I understand well, you are saying that 2,1 becomes 21 because it is a triangular number. OK, but then I would expect 1,5 to merge into 15. And it doesn't. Commented Nov 19, 2021 at 21:57
• not exactly. I tried to solve the sequence thinking 21 wasn't a mistake, and that the sequence is really 1,1,1,21,3 etc and not 1,1,1,2,1,3 so I don't have to merge 1,5 into 15. furthemore 15 doesn't end with 1, and for the resolution I took the triangolar numbers that end with 1 Commented Nov 20, 2021 at 12:01