During the 49 days between Passover and Pentecost, Jewish liturgy provides four numerical problems that I've here phrased as code golf problems.
Input/Arguments
These four, in any order, and by any means:
- A text \$L\$ consisting of exactly 7 sentences.
- The first and last sentences have 7 words each, the middle one has 11 words, and the remaining four have 6 words each.
- The 11-word sentence has 49 letters in total.
- The sentences may have commas, and they all have a trailing period.
- You can take this as a 7-element list of strings or as a single string with spaces or line breaks after the inner periods, and optionally after the last one as well.
- A text \$A\$ consisting of 7 sentences.
- Each sentence has exactly 6 words.
- The sentences may have commas, and they all have a trailing period.
- You can take this as a 7-element list of strings or as a single string with spaces or line breaks after the inner periods, and optionally after the last one as well.
- A list \$S\$ consisting of exactly 7 words.
- These are all-lowercase.
- These have no punctuation.
- An integer \$N\$ in the inclusive range 1 though 49.
- You are not allowed to substitute with 0 through 48.
Alternatively, you can use \$L\$, \$A\$, and \$S\$ as predefined variables, and only take \$N\$.
Output/Results
These four, in this precise order, though in any reasonable format, including with extra trailing whitespace:
The text “\$N\$
days, namely
\$N_1\$weeks
\$N_0\$days
”, where \$(N_1,N_0)_7\$ is \$N\$ in base seven, except for \$N=49\$ where \$N_1=7\$ and \$N_0=0\$.- You must omit the plural “
s
” after any number that is \$1\$. - You must omit any part that is \$0\$.
- You must omit the second phrase (from and including the comma) if \$N≤6\$.
- Examples:
- \$N=1\$: “
1 day
” - \$N=6\$: “
6 days
” - \$N=7\$: “
7 days, namely 1 week
” - \$N=8\$: “
8 days, namely 1 week 1 day
” - \$N=13\$: “
13 days, namely 1 week 6 days
” - \$N=14\$: “
14 days, namely 2 weeks
” - \$N=15\$: “
15 days, namely 2 weeks 1 day
”
- \$N=1\$: “
- You must omit the plural “
The text of \$L\$ but with the \$N\$th word highlighted, and the \$N\$th letter of the middle sentence highlighted.
- The highlightings must consist of two distinct enclosures of your choice.
- The enclosing characters must not be letters, nor space, comma, or period. All other visible characters are allowed.
- For example, you can enclose the word in square brackets (“
[word]
”) and the letter in curly braces (“l{e}tter
”), or you could enclose the word in double-asterisks (“**word**
”) and the letter in single-asterisks (“l*e*tter
”). - Spaces, commas, and periods must not be highlighted.
- Be aware that there will be a value of \$N\$ for which the highlighted letter will appear inside the highlighted word (“
[co{m}bo]
” or (“**co*m*bo**
” etc.).
The text of \$A\$ but with one word or sentence highlighted.
- If \$N=1\$ then highlight the first word.
- Otherwise, if \$N\$ is evenly divisible by \$7\$ then highlight the entire \$N\over7\$th sentence.
- Otherwise, highlight the word that follows immediately after the highlighting done for \$N-1\$.
- Commas and periods must not be highlighted when highlighting a word.
- For example, for \$N=8\$, highlight the first word of the second sentence.
The text “\$S_0\$
in
\$S_1\$”, where \$S_0\$ is the \$(M_0+1)\$th word of \$S\$ and \$S_1\$ is the \$(M_1+1)\$th word of \$S\$, and \$M=N-1\$.- For example, for \$N=8\$, \$M=N-1=7\$ which is \$(1,0)_7\$, and therefore \$S_0\$ is the second word of \$S\$ and \$S_1\$ is the first word of \$S\$.
- The trailing period must also be highlighted when highlighting a sentence.
Examples
For these examples, [
…]
is used to highlight words and sentences, {
…}
is used to highlight letters, and \$L\$ is:
God bless grace, face shine us forever.
Know earth ways, saves all nations.
Praise people Lord, all people praise.
Folk sing joy, for judges people justly, guide earth folk ever.
Praise people Lord, all people praise.
Earth gives produce, bless our God.
Bless God, fear Him all earth ends.
\$A\$ is:
Power please, great right, release captive.
Accept prayer, strengthen people, Awesome purify.
Please Mighty, Oneness seekers, eye guard.
Bless cleanse, righteous mercy, bestow always.
Powerful Holy, abounding goodness, guide congregation.
Exalted One, people turn, remember holiness.
Accept supplication, hear cry, thoughts knower.
\$S\$ is:
kindness
might
beauty
victory
glory
groundedness
royalty
For \$N=1\$
1 day
[God] bless grace, face shine us forever.
Know earth ways, saves all nations.
Praise people Lord, all people praise.
{F}olk sing joy, for judges people justly, guide earth folk ever.
Praise people Lord, all people praise.
Earth gives produce, bless our God.
Bless God, fear Him all earth ends.
[Power] please, great right, release captive.
Accept prayer, strengthen people, Awesome purify.
Please Mighty, Oneness seekers, eye guard.
Bless cleanse, righteous mercy, bestow always.
Powerful Holy, abounding goodness, guide congregation.
Exalted One, people turn, remember holiness.
Accept supplication, hear cry, thoughts knower.
kindness in kindness
For \$N=6\$
6 days
God bless grace, face shine [us] forever.
Know earth ways, saves all nations.
Praise people Lord, all people praise.
Folk s{i}ng joy, for judges people justly, guide earth folk ever.
Praise people Lord, all people praise.
Earth gives produce, bless our God.
Bless God, fear Him all earth ends.
Power please, great right, release [captive].
Accept prayer, strengthen people, Awesome purify.
Please Mighty, Oneness seekers, eye guard.
Bless cleanse, righteous mercy, bestow always.
Powerful Holy, abounding goodness, guide congregation.
Exalted One, people turn, remember holiness.
Accept supplication, hear cry, thoughts knower.
groundedness in kindness
For \$N=7\$
7 days, namely 1 week
God bless grace, face shine us [forever].
Know earth ways, saves all nations.
Praise people Lord, all people praise.
Folk si{n}g joy, for judges people justly, guide earth folk ever.
Praise people Lord, all people praise.
Earth gives produce, bless our God.
Bless God, fear Him all earth ends.
[Power please, great right, release captive.]
Accept prayer, strengthen people, Awesome purify.
Please Mighty, Oneness seekers, eye guard.
Bless cleanse, righteous mercy, bestow always.
Powerful Holy, abounding goodness, guide congregation.
Exalted One, people turn, remember holiness.
Accept supplication, hear cry, thoughts knower.
royalty in kindness
For \$N=8\$
8 days, namely 1 week 1 day
God bless grace, face shine us forever.
[Know] earth ways, saves all nations.
Praise people Lord, all people praise.
Folk si{n}g joy, for judges people justly, guide earth folk ever.
Praise people Lord, all people praise.
Earth gives produce, bless our God.
Bless God, fear Him all earth ends.
Power please, great right, release captive.
[Accept] prayer, strengthen people, Awesome purify.
Please Mighty, Oneness seekers, eye guard.
Bless cleanse, righteous mercy, bestow always.
Powerful Holy, abounding goodness, guide congregation.
Exalted One, people turn, remember holiness.
Accept supplication, hear cry, thoughts knower.
kindness in might
For \$N=13\$
13 days, namely 1 week 6 days
God bless grace, face shine us forever.
Know earth ways, saves all [nations].
Praise people Lord, all people praise.
Folk sing joy, f{o}r judges people justly, guide earth folk ever.
Praise people Lord, all people praise.
Earth gives produce, bless our God.
Bless God, fear Him all earth ends.
Power please, great right, release captive.
Accept prayer, strengthen people, Awesome [purify].
Please Mighty, Oneness seekers, eye guard.
Bless cleanse, righteous mercy, bestow always.
Powerful Holy, abounding goodness, guide congregation.
Exalted One, people turn, remember holiness.
Accept supplication, hear cry, thoughts knower.
groundedness in might
For \$N=14\$
14 days, namely 2 weeks
God bless grace, face shine us forever.
Know earth ways, saves all nations.
[Praise] people Lord, all people praise.
Folk sing joy, fo{r} judges people justly, guide earth folk ever.
Praise people Lord, all people praise.
Earth gives produce, bless our God.
Bless God, fear Him all earth ends.
Power please, great right, release captive.
[Accept prayer, strengthen people, Awesome purify.]
Please Mighty, Oneness seekers, eye guard.
Bless cleanse, righteous mercy, bestow always.
Powerful Holy, abounding goodness, guide congregation.
Exalted One, people turn, remember holiness.
Accept supplication, hear cry, thoughts knower.
royalty in might
For \$N=15\$
15 days, namely 2 weeks 1 day
God bless grace, face shine us forever.
Know earth ways, saves all nations.
Praise [people] Lord, all people praise.
Folk sing joy, for {j}udges people justly, guide earth folk ever.
Praise people Lord, all people praise.
Earth gives produce, bless our God.
Bless God, fear Him all earth ends.
Power please, great right, release captive.
Accept prayer, strengthen people, Awesome purify.
[Please] Mighty, Oneness seekers, eye guard.
Bless cleanse, righteous mercy, bestow always.
Powerful Holy, abounding goodness, guide congregation.
Exalted One, people turn, remember holiness.
Accept supplication, hear cry, thoughts knower.
kindness in beauty
For \$N=25\$
25 days, namely 3 weeks 4 days
God bless grace, face shine us forever.
Know earth ways, saves all nations.
Praise people Lord, all people praise.
Folk sing joy, for judges [peop{l}e] justly, guide earth folk ever.
Praise people Lord, all people praise.
Earth gives produce, bless our God.
Bless God, fear Him all earth ends.
Power please, great right, release captive.
Accept prayer, strengthen people, Awesome purify.
Please Mighty, Oneness seekers, eye guard.
Bless cleanse, righteous [mercy], bestow always.
Powerful Holy, abounding goodness, guide congregation.
Exalted One, people turn, remember holiness.
Accept supplication, hear cry, thoughts knower.
victory in victory
For \$N=49\$
49 days, namely 7 weeks
God bless grace, face shine us forever.
Know earth ways, saves all nations.
Praise people Lord, all people praise.
Folk sing joy, for judges people justly, guide earth folk eve{r}.
Praise people Lord, all people praise.
Earth gives produce, bless our God.
Bless God, fear Him all earth [ends].
Power please, great right, release captive.
Accept prayer, strengthen people, Awesome purify.
Please Mighty, Oneness seekers, eye guard.
Bless cleanse, righteous mercy, bestow always.
Powerful Holy, abounding goodness, guide congregation.
Exalted One, people turn, remember holiness.
[Accept supplication, hear cry, thoughts knower.]
royalty in royalty
N=49
?N
in base7
is100
, but do we takeN₁
to be7
? What happens withN₁+1
for theS
output? \$\endgroup\$N=7
in your test case, my program highlightsforever.
instead offorever
. Is that acceptable? \$\endgroup\$