0%

Problem 691


Problem 691


Long substring with many repetitions

Given a character string s, we define L(k,s) to be the length of the longest substring of s which appears at least k times in s, or 0 if such a substring does not exist. For example, L(3,“bbabcabcabcacba”)=4 because of the three occurrences of the substring “abca”, and L(2,“bbabcabcabcacba”)=7 because of the repeated substring “abcabca”. Note that the occurrences can overlap.

Let an, bn and cn be the 0/1 sequences defined by:

  • a0=0
  • a2n=an
  • a2n+1=1an
  • bn=n+1φnφ (where φ is the golden ratio)
  • cn=an+bn2anbn

and Sn the character string c0cn1. You are given that L(2,S10)=5, L(3,S10)=2, L(2,S100)=14, L(4,S100)=6, L(2,S1000)=86, L(3,S1000)=45, L(5,S1000)=31, and that the sum of non-zero L(k,S1000) for k1 is 2460.

Find the sum of non-zero L(k,S5000000) for k1.


多次重复的长子串

给定字符串s,记L(k,s)为在s中至少重复出现k次的子串中最长子串的长度,如果这样的子串不存在则取0。例如,L(3,“bbabcabcabcacba”)=4,因为子串“abca”重复出现了三次;而L(2,“bbabcabcabcacba”)=7因为子串“abcabca”重复出现了两次。注意子串的多次出现之间允许重复使用字符。

anbncn为由如下规则生成的0/1序列:

  • a0=0
  • a2n=an
  • a2n+1=1an
  • bn=n+1φnφ(其中φ表示黄金比1+52
  • cn=an+bn2anbn

Sn为字符串c0cn1。已知L(2,S10)=5L(3,S10)=2L(2,S100)=14L(4,S100)=6L(2,S1000)=86L(3,S1000)=45L(5,S1000)=31,而对于任意k1,所有非零的L(k,S1000)之和为2460

对于任意k1,求所有非零的L(k,S5000000)之和。


Gitalking ...