英文:
How to express h(n) which is the "union" of the two sequences f(n) & g(n)
问题
抱歉,我只能为您提供代码的翻译,以下是翻译好的代码部分:
我在语法和英语方面都有些困难,如果我在这里表达数学的方式有些乱七八糟,请原谅。
我有两个序列/“函数”f(n)和g(n)。严格来说,它们不是函数,我只是将它们定义为9和10的重复模数序列。
n = 0,1,2,3,...
f(n): nMOD9={0,3,4,6}
g(n): nMOD10={0,3,4,5,8,9}
这意味着f(n)将会是0,3,4,6,9,12,13,15,18等,只是重复了模9中括号中的四个数字。
g(n)将会是0,3,4,5,8,9,10,13,14,15,18,19,20等,重复了模10中括号中的六个数字。
现在我想知道,是否可以表示h(n),它是同时存在于f(n)和g(n)中的数字列表?这将是0,3,4,9,13,15,18等,可以表示为某个函数或nMODx={a,b,c}之类的形式吗?或者是我没有考虑到的其他聪明方法。
目前,我手动检查了两个列表,我想知道是否可以更优雅地完成。
英文:
I am on thin ice both syntax-wise and English-wise here, apologise if my way of expressing maths here is a rambling of a mad-man.
I have two sequences/"functions" f(n) and g(n). They are technically not functions, I have them just defined as a sequence of repeating modulus of 9 and 10.
n = 0,1,2,3,...
f(n): nMOD9={0,3,4,6}
g(n): nMOD10={0,3,4,5,8,9}
This means that f(n) is will go 0,3,4,6,9,12,13,15,18,ect. Just repeating the four numbers in the brackets of modulus of 9.
g(n) will be 0,3,4,5,8,9,10,13,14,15,18,19,20,ect. Repeating the six numbers in brackets of modulus of 10.
Now I wonder, can I express h(n) which is the list of numbers that is both present in f(n) and g(n)? This will be 0,3,4,9,13,15,18,ect. Either as a function or as some nMODx={a,b,c}? Or some other genius way I have not thought about.
Currently I do a manual check of both list, and I wonder if can be done more elegant.
答案1
得分: 1
一种可能的解决方案是找到所有小于90的h(n)值,然后h(n)将等于nMOD90,因此
h(n): nMOD90={0,3,4,9,13,15,18,24,30,33,39,40,45,48,49,54,58,60,63,69,75,78,84,85}
英文:
One possible solution would be to find all values of h(n) up to 90, then h(n) will be those nMOD90, so
h(n): nMOD90={0,3,4,9,13,15,18,24,30,33,39,40,45,48,49,54,58,60,63,69,75,78,84,85}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论