Infinite String and Letter Puzzle

  • Context: High School 
  • Thread starter Thread starter K Sengupta
  • Start date Start date
  • Tags Tags
    Infinite Puzzle String
Click For Summary

Discussion Overview

The discussion revolves around a puzzle involving an infinite string pattern formed by repeating letters where each letter's frequency increases sequentially. Participants are tasked with determining the 3000th letter in this pattern and exploring variations of the puzzle.

Discussion Character

  • Exploratory, Mathematical reasoning, Debate/contested

Main Points Raised

  • One participant describes the string pattern as "abbcccddddeeeee…" and asks for the 3000th letter.
  • Another participant expresses uncertainty with "I think" but does not provide a clear answer.
  • A participant shares a JavaScript code snippet intended to calculate the 3000th letter, indicating a methodical approach.
  • Another participant provides a Perl code snippet to achieve the same goal, suggesting a different programming perspective.
  • A follow-up question is posed regarding a variation of the puzzle where after Z, A would repeat 27 times, B 28 times, and so forth.
  • One participant mentions using basic math for their approach, while another challenges the correctness of that math.

Areas of Agreement / Disagreement

Participants do not appear to reach a consensus on the correct answer to the original question or the validity of the mathematical approaches presented. Multiple competing views and methods are discussed.

Contextual Notes

Some participants' approaches rely on programming logic, while others reference basic mathematical reasoning. The discussion does not resolve the correctness of the calculations or assumptions made in the proposed methods.

Who May Find This Useful

Individuals interested in mathematical puzzles, programming solutions, or those exploring patterns in sequences may find this discussion relevant.

K Sengupta
Messages
113
Reaction score
0
The string abbcccddddeeeee… continuously repeats such that after the final z, the letters abbcccddddeeeee… begin again.

What will be the 3000th letter in the pattern?
 
Last edited:
Mathematics news on Phys.org
T
I think
 
I Think it´s:
R
 
Here's my guess:

Code:
var alpha = "abcdefghijklmnopqrstuvwxyz".split("");
var a = [];
var i=0;
var j=0;
var k=0;

while(i<=3000) {
    for(j=0;j<k;j++) {
        if(i<3000) {
            a.push(alpha[k-1]);
        }
        i++;
    }
    k++;
    if(k > alpha.length) k = 0;
}a[a.length-1];

t
 
Last edited:
Code:
#!perl
for(A..Z) {$s.=$_ x++$i;}
$t=$s.($s x int(3000/length $s));
print substr($t,2999,1)."\n";

Or, more appropriately:

There are 26 letters in the alphabet, hence the string from the first A to the final Z will be ((1+26)/2)*26 characters long (351 characters). 3000 modulo 351 is 192. Hence, the 3000th character will be the same as the 192nd character. You can find this by finding when N choose 2 is equal to or greater than 192, which happens to be at N=20 (20 choose 2 being 210). And the 20th letter of the alphabet is T.

And the next question-- what happens if instead, after the final Z, the next A repeats 27 times, then B repeats 28 times and so forth?

DaveE
 
Last edited:
davee123 said:
Code:
#!perl
for(A..Z) {$s.=$_ x++$i;}
$t=$s.($s x int(3000/length $s));
print substr($t,2999,1)."\n";

Or, more appropriately:

There are 26 letters in the alphabet, hence the string from the first A to the final Z will be ((1+26)/2)*26 characters long (351 characters). 3000 modulo 351 is 192. Hence, the 3000th character will be the same as the 192nd character. You can find this by finding when N choose 2 is equal to or greater than 192, which happens to be at N=20 (20 choose 2 being 210). And the 20th letter of the alphabet is T.

And the next question-- what happens if instead, after the final Z, the next A repeats 27 times, then B repeats 28 times and so forth?

DaveE

I used basic math for this.
x(x+1) = 6000 and x = int -> x^2 < 6000 < x^2 + x ; x= 77. My answer is Y.
 
Zubin said:
I used basic math for this.
x(x+1) = 6000 and x = int -> x^2 < 6000 < x^2 + x ; x= 77. My answer is Y.

There appears to be something wrong with your basic math.

26*(26+1)/2 = 351
3000 / 351 = 8.547...
3000-351(8) = 192

192-1-2-3-4...-19 = 2

So T is the 3000th letter.
 

Similar threads

  • · Replies 31 ·
2
Replies
31
Views
5K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 32 ·
2
Replies
32
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 17 ·
Replies
17
Views
2K
  • · Replies 21 ·
Replies
21
Views
3K
  • · Replies 22 ·
Replies
22
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K