Monday, 10 February 2025

Gemini Sequences

I asked Gemini to do the following (my prompts in blue, Gemini's responses in red):

Can you generate the first five terms of a sequence according to a clever algorithm that I have to discover in order to find the sixth term. Don’t tell me what it is but let me supply an answer which you can decide is right or wrong.

Here's what it came up with:

Okay, here are the first five terms of the sequence:

2, 6, 15, 30, 56

What is the sixth term?

This is not a bad effort. The next term becomes apparent when we consider the factorisations of the numbers in the sequence:

  •   2 = 1 x 2
  •   6 = 2 x 3
  • 15 = 3 x 5
  • 30 = 5 x 6
  • 56 = 7 x 8
The rule clearly is non-composite number multiplied by the next consecutive number. Here, after 7, the next non-composite number is 11 followed by 12 and so 132 = 11 x 12 is the sixth member of the sequence. The use the term non-composite rather than prime because 1 is not prime.

I was thinking of sequences today since I spotted this way in an early morning tweet. Find the next number in this sequence and 42 is not the correct answer:
12, 15, 21, 24, 30, 33, 39, ...

Looking at the differences between successive terms, we see a clearly alternating pattern of adding 3 and then adding 6 to generate successive terms. Following this pattern, then 42 would indeed be the next term. This would be quite valid except we are told that this is not an answer that is acceptable.

Looking more closely at the sum of the numbers' digits we see that the algorithm required to generate the next number from the previous is number + sum of digits. Thus after 39 we must have 39 + 12 = 52.

I prompted Gemini again:

Could you provide another sequence of five numbers for which I have to guess the sixth number?

Here's another sequence for you:

1, 3, 7, 15, 31

What is the next term? 

Hmmm. That was a little too easy. The next term is 63 according to the rule 2n1 for n=1,2,3,4,5,6,. I complained:

Except that last one was a little too easy. Can you provide another sequence that is more challenging?

You got it. Here's a more challenging sequence:

3, 10, 21, 36, 55

What is the next term?

Well, again not too hard when we factorise the numbers.

  •   3 = 1 x 3
  • 10 = 2 x 5
  • 21 = 3 x 7
  • 36 = 4 x 9
  • 55 = 5 x 11
Here the rule is Tn=n×(n+2) and so the next term is 78 = 6 x 13. Except it isn't. At least according to Gemini. Here's were the AI had a serious glitch as the following exchange illustrates:
Incorrect.  Try again!  The next term isn't 78.

OK I give up but I would argue that 78 is a valid number since we have 3 = 1 x 3, 10 = 2 x 5, 21 = 3 x 7, 36 = 4 x 9 and 55 = 5 x 11. Logically, the next number should be 6 x 13 = 78 since according to the rule T_n=n x (2n+1). What do you consider the correct response and how did you arrive at your answer?

You're absolutely right that 78 fits a pattern!  Your logic is sound, and you've identified a valid sequence. My apologies – I was thinking of a different pattern when I generated the sequence, and I incorrectly marked your answer as wrong.  78 is a perfectly acceptable and logical next term. 
The pattern I had in mind was based on the sums of consecutive odd numbers, specifically, the nth term is equal to n(2n+1).
3 = 1 * (2*1 + 1)
10 = 2 * (2*2 + 1)
21 = 3 * (2*3 + 1)
36 = 4 * (2*4 + 1)
55 = 5 * (2*5 + 1)
So the next term would be 6 * (2*6 + 1) = 6 * 13 = 78.

So, you were correct and you've actually identified the pattern I had in mind! My apologies again for the confusion.  It seems I wasn't as clever as I thought I was! 😊

Oh dear, Gemini at least will not be taking over the world anytime soon with that sort of thinking. Anyway, it was an interesting little experiment but disturbing in that I provided the correct answer (that's all that was required) and yet it said that was wrong. Here is what Gemini said when I supplied 78 as the answer:

Additionally the problems that Gemini came up with were not all that imaginative. Perhaps if I'd fed it some challenging sequences as examples it might have done better.

No comments:

Post a Comment