Coefficients of $(1+x+x^2)^2018$ The Next CEO of Stack OverflowHow to compute $I(n)=int_0^1x_1^aint_x_1^1x_2^acdotsint_x_n-1^1x_n^adx_ncdots dx_2dx_1$?Number of possible results in election with one of candidates getting more then 50% votesLinear recursion with coefficients depending on nCoefficients of exponential generating functionsHow do you solve a two variable 2nd degree polynomialDo all polynomials of degree n with indeterminate coefficients have Galois groups that are isomorphic to Sn?Closed Form Expression of sum with binomial coefficientSolutions of $lfloor 4xrfloor+lfloor 3xrfloor=1$Trigonometric/polynomial equations and the algebraic nature of trig functionscoefficients of $x^k$ and $x^k+1$Divisiblity of binomial coefficients

Physiological effects of huge anime eyes

My ex-girlfriend uses my Apple ID to login to her iPad, do I have to give her my Apple ID password to reset it?

Is dried pee considered dirt?

Is a distribution that is normal, but highly skewed, considered Gaussian?

Towers in the ocean; How deep can they be built?

How did Beeri the Hittite come up with naming his daughter Yehudit?

Reshaping json / reparing json inside shell script (remove trailing comma)

What day is it again?

how one can write a nice vector parser, something that does pgfvecparseA=B-C; D=E x F;

Why don't programming languages automatically manage the synchronous/asynchronous problem?

How to get the last not-null value in an ordered column of a huge table?

What was Carter Burke's job for "the company" in Aliens?

Can I board the first leg of the flight without having final country's visa?

What does "shotgun unity" refer to here in this sentence?

Is French Guiana a (hard) EU border?

IC has pull-down resistors on SMBus lines?

Vector calculus integration identity problem

Is it correct to say moon starry nights?

Which one is the true statement?

Is there an equivalent of cd - for cp or mv

Is there a difference between "Fahrstuhl" and "Aufzug"?

Can I calculate next year's exemptions based on this year's refund/amount owed?

what's the use of '% to gdp' type of variables?

How to avoid supervisors with prejudiced views?



Coefficients of $(1+x+x^2)^2018$



The Next CEO of Stack OverflowHow to compute $I(n)=int_0^1x_1^aint_x_1^1x_2^acdotsint_x_n-1^1x_n^adx_ncdots dx_2dx_1$?Number of possible results in election with one of candidates getting more then 50% votesLinear recursion with coefficients depending on nCoefficients of exponential generating functionsHow do you solve a two variable 2nd degree polynomialDo all polynomials of degree n with indeterminate coefficients have Galois groups that are isomorphic to Sn?Closed Form Expression of sum with binomial coefficientSolutions of $lfloor 4xrfloor+lfloor 3xrfloor=1$Trigonometric/polynomial equations and the algebraic nature of trig functionscoefficients of $x^k$ and $x^k+1$Divisiblity of binomial coefficients










2












$begingroup$


The question is




How many of the coefficients of $(1+x+x^2)^2018$ are not divisible by 3?




Somebody asked me the question, and I have no idea how to solve it. I am not sure if the coefficients are known to have a closed form either.



I guess that the question might be solvable using a combinatorics way, but not sure either. Thanks.










share|cite|improve this question









$endgroup$











  • $begingroup$
    Mathematica says it's 576: Length[Select[(Mod[#, 3] & /@ CoefficientList[(1 + x + x^2)^2018, x]), # != 0 &]].
    $endgroup$
    – JimB
    Mar 19 at 21:50
















2












$begingroup$


The question is




How many of the coefficients of $(1+x+x^2)^2018$ are not divisible by 3?




Somebody asked me the question, and I have no idea how to solve it. I am not sure if the coefficients are known to have a closed form either.



I guess that the question might be solvable using a combinatorics way, but not sure either. Thanks.










share|cite|improve this question









$endgroup$











  • $begingroup$
    Mathematica says it's 576: Length[Select[(Mod[#, 3] & /@ CoefficientList[(1 + x + x^2)^2018, x]), # != 0 &]].
    $endgroup$
    – JimB
    Mar 19 at 21:50














2












2








2


2



$begingroup$


The question is




How many of the coefficients of $(1+x+x^2)^2018$ are not divisible by 3?




Somebody asked me the question, and I have no idea how to solve it. I am not sure if the coefficients are known to have a closed form either.



I guess that the question might be solvable using a combinatorics way, but not sure either. Thanks.










share|cite|improve this question









$endgroup$




The question is




How many of the coefficients of $(1+x+x^2)^2018$ are not divisible by 3?




Somebody asked me the question, and I have no idea how to solve it. I am not sure if the coefficients are known to have a closed form either.



I guess that the question might be solvable using a combinatorics way, but not sure either. Thanks.







sequences-and-series combinatorics algebra-precalculus polynomials binomial-coefficients






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Mar 19 at 21:24









Kay K.Kay K.

6,9401337




6,9401337











  • $begingroup$
    Mathematica says it's 576: Length[Select[(Mod[#, 3] & /@ CoefficientList[(1 + x + x^2)^2018, x]), # != 0 &]].
    $endgroup$
    – JimB
    Mar 19 at 21:50

















  • $begingroup$
    Mathematica says it's 576: Length[Select[(Mod[#, 3] & /@ CoefficientList[(1 + x + x^2)^2018, x]), # != 0 &]].
    $endgroup$
    – JimB
    Mar 19 at 21:50
















$begingroup$
Mathematica says it's 576: Length[Select[(Mod[#, 3] & /@ CoefficientList[(1 + x + x^2)^2018, x]), # != 0 &]].
$endgroup$
– JimB
Mar 19 at 21:50





$begingroup$
Mathematica says it's 576: Length[Select[(Mod[#, 3] & /@ CoefficientList[(1 + x + x^2)^2018, x]), # != 0 &]].
$endgroup$
– JimB
Mar 19 at 21:50











1 Answer
1






active

oldest

votes


















5












$begingroup$

If $p$ is a prime and $m geq 1$, then by the Freshman's dream,



$$ (X + Y)^p^m equiv X^p^m + Y^p^m pmodp. $$



So, expanding $2018 = sum_kgeq 0 a_k 3^k$, then



beginalign*
(1+x+x^2)^2018
= prod_k geq 0 left( (1 + x + x^2)^3^k right)^a_k
equiv prod_k geq 0 left( 1 + x^3^k + x^2cdot 3^k right)^a_k pmod3
endalign*



Now, from $ 2018 = 2 + 2cdot3^2 + 2cdot3^3 + 2cdot3^5 + 2cdot3^6 $, we have $a_k = 2$ when $k = 0, 2, 3, 5, 6$ and $a_k = 0$ otherwise. Moreover,



$$ left( 1 + x^3^k + x^2cdot 3^k right)^2
equiv left( 1 + 2x^3^k right)left(1 + 2 x^3^k+1right) pmod3 $$



Plugging this back,



beginalign*
(1 + x + x^2)^2018
&equiv prod_k in 0, 2, 3, 5, 6 left( 1 + 2x^3^k right)left(1 + 2 x^3^k+1right) pmod3 \
&= (1 + 2x) (1 + 2x^3) (1 + 2x^3^2) (1 + 2x^3^3)^2 \
&quad times (1 + 2x^3^4) (1 + 2x^3^5) (1 + 2x^3^6)^2 (1 + 2x^3^7) \
&equiv (1 + 2x^3^0) (1 + 2x^3^1) (1 + 2x^3^2) (1 + x^3^3 + x^2cdot 3^3) \
&quad times (1 + 2x^3^4) (1 + 2x^3^5) (1 + x^3^6 + x^2cdot 3^6) (1 + 2x^3^7) pmod3
endalign*



If we expand the last product, no two terms have the same exponent, and so, there are total $2^6 times 3^2 = 576$ terms with coefficients not divisible by $3$.






share|cite|improve this answer









$endgroup$












  • $begingroup$
    Wow. This is amazing. Thanks a lot!
    $endgroup$
    – Kay K.
    Mar 19 at 22:51










  • $begingroup$
    @KayK. No problem :)
    $endgroup$
    – Sangchul Lee
    Mar 19 at 22:59






  • 1




    $begingroup$
    @SangchulLee: Nice presentation. (+1)
    $endgroup$
    – Markus Scheuer
    Mar 20 at 9:27











Your Answer





StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3154629%2fcoefficients-of-1xx22018%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









5












$begingroup$

If $p$ is a prime and $m geq 1$, then by the Freshman's dream,



$$ (X + Y)^p^m equiv X^p^m + Y^p^m pmodp. $$



So, expanding $2018 = sum_kgeq 0 a_k 3^k$, then



beginalign*
(1+x+x^2)^2018
= prod_k geq 0 left( (1 + x + x^2)^3^k right)^a_k
equiv prod_k geq 0 left( 1 + x^3^k + x^2cdot 3^k right)^a_k pmod3
endalign*



Now, from $ 2018 = 2 + 2cdot3^2 + 2cdot3^3 + 2cdot3^5 + 2cdot3^6 $, we have $a_k = 2$ when $k = 0, 2, 3, 5, 6$ and $a_k = 0$ otherwise. Moreover,



$$ left( 1 + x^3^k + x^2cdot 3^k right)^2
equiv left( 1 + 2x^3^k right)left(1 + 2 x^3^k+1right) pmod3 $$



Plugging this back,



beginalign*
(1 + x + x^2)^2018
&equiv prod_k in 0, 2, 3, 5, 6 left( 1 + 2x^3^k right)left(1 + 2 x^3^k+1right) pmod3 \
&= (1 + 2x) (1 + 2x^3) (1 + 2x^3^2) (1 + 2x^3^3)^2 \
&quad times (1 + 2x^3^4) (1 + 2x^3^5) (1 + 2x^3^6)^2 (1 + 2x^3^7) \
&equiv (1 + 2x^3^0) (1 + 2x^3^1) (1 + 2x^3^2) (1 + x^3^3 + x^2cdot 3^3) \
&quad times (1 + 2x^3^4) (1 + 2x^3^5) (1 + x^3^6 + x^2cdot 3^6) (1 + 2x^3^7) pmod3
endalign*



If we expand the last product, no two terms have the same exponent, and so, there are total $2^6 times 3^2 = 576$ terms with coefficients not divisible by $3$.






share|cite|improve this answer









$endgroup$












  • $begingroup$
    Wow. This is amazing. Thanks a lot!
    $endgroup$
    – Kay K.
    Mar 19 at 22:51










  • $begingroup$
    @KayK. No problem :)
    $endgroup$
    – Sangchul Lee
    Mar 19 at 22:59






  • 1




    $begingroup$
    @SangchulLee: Nice presentation. (+1)
    $endgroup$
    – Markus Scheuer
    Mar 20 at 9:27















5












$begingroup$

If $p$ is a prime and $m geq 1$, then by the Freshman's dream,



$$ (X + Y)^p^m equiv X^p^m + Y^p^m pmodp. $$



So, expanding $2018 = sum_kgeq 0 a_k 3^k$, then



beginalign*
(1+x+x^2)^2018
= prod_k geq 0 left( (1 + x + x^2)^3^k right)^a_k
equiv prod_k geq 0 left( 1 + x^3^k + x^2cdot 3^k right)^a_k pmod3
endalign*



Now, from $ 2018 = 2 + 2cdot3^2 + 2cdot3^3 + 2cdot3^5 + 2cdot3^6 $, we have $a_k = 2$ when $k = 0, 2, 3, 5, 6$ and $a_k = 0$ otherwise. Moreover,



$$ left( 1 + x^3^k + x^2cdot 3^k right)^2
equiv left( 1 + 2x^3^k right)left(1 + 2 x^3^k+1right) pmod3 $$



Plugging this back,



beginalign*
(1 + x + x^2)^2018
&equiv prod_k in 0, 2, 3, 5, 6 left( 1 + 2x^3^k right)left(1 + 2 x^3^k+1right) pmod3 \
&= (1 + 2x) (1 + 2x^3) (1 + 2x^3^2) (1 + 2x^3^3)^2 \
&quad times (1 + 2x^3^4) (1 + 2x^3^5) (1 + 2x^3^6)^2 (1 + 2x^3^7) \
&equiv (1 + 2x^3^0) (1 + 2x^3^1) (1 + 2x^3^2) (1 + x^3^3 + x^2cdot 3^3) \
&quad times (1 + 2x^3^4) (1 + 2x^3^5) (1 + x^3^6 + x^2cdot 3^6) (1 + 2x^3^7) pmod3
endalign*



If we expand the last product, no two terms have the same exponent, and so, there are total $2^6 times 3^2 = 576$ terms with coefficients not divisible by $3$.






share|cite|improve this answer









$endgroup$












  • $begingroup$
    Wow. This is amazing. Thanks a lot!
    $endgroup$
    – Kay K.
    Mar 19 at 22:51










  • $begingroup$
    @KayK. No problem :)
    $endgroup$
    – Sangchul Lee
    Mar 19 at 22:59






  • 1




    $begingroup$
    @SangchulLee: Nice presentation. (+1)
    $endgroup$
    – Markus Scheuer
    Mar 20 at 9:27













5












5








5





$begingroup$

If $p$ is a prime and $m geq 1$, then by the Freshman's dream,



$$ (X + Y)^p^m equiv X^p^m + Y^p^m pmodp. $$



So, expanding $2018 = sum_kgeq 0 a_k 3^k$, then



beginalign*
(1+x+x^2)^2018
= prod_k geq 0 left( (1 + x + x^2)^3^k right)^a_k
equiv prod_k geq 0 left( 1 + x^3^k + x^2cdot 3^k right)^a_k pmod3
endalign*



Now, from $ 2018 = 2 + 2cdot3^2 + 2cdot3^3 + 2cdot3^5 + 2cdot3^6 $, we have $a_k = 2$ when $k = 0, 2, 3, 5, 6$ and $a_k = 0$ otherwise. Moreover,



$$ left( 1 + x^3^k + x^2cdot 3^k right)^2
equiv left( 1 + 2x^3^k right)left(1 + 2 x^3^k+1right) pmod3 $$



Plugging this back,



beginalign*
(1 + x + x^2)^2018
&equiv prod_k in 0, 2, 3, 5, 6 left( 1 + 2x^3^k right)left(1 + 2 x^3^k+1right) pmod3 \
&= (1 + 2x) (1 + 2x^3) (1 + 2x^3^2) (1 + 2x^3^3)^2 \
&quad times (1 + 2x^3^4) (1 + 2x^3^5) (1 + 2x^3^6)^2 (1 + 2x^3^7) \
&equiv (1 + 2x^3^0) (1 + 2x^3^1) (1 + 2x^3^2) (1 + x^3^3 + x^2cdot 3^3) \
&quad times (1 + 2x^3^4) (1 + 2x^3^5) (1 + x^3^6 + x^2cdot 3^6) (1 + 2x^3^7) pmod3
endalign*



If we expand the last product, no two terms have the same exponent, and so, there are total $2^6 times 3^2 = 576$ terms with coefficients not divisible by $3$.






share|cite|improve this answer









$endgroup$



If $p$ is a prime and $m geq 1$, then by the Freshman's dream,



$$ (X + Y)^p^m equiv X^p^m + Y^p^m pmodp. $$



So, expanding $2018 = sum_kgeq 0 a_k 3^k$, then



beginalign*
(1+x+x^2)^2018
= prod_k geq 0 left( (1 + x + x^2)^3^k right)^a_k
equiv prod_k geq 0 left( 1 + x^3^k + x^2cdot 3^k right)^a_k pmod3
endalign*



Now, from $ 2018 = 2 + 2cdot3^2 + 2cdot3^3 + 2cdot3^5 + 2cdot3^6 $, we have $a_k = 2$ when $k = 0, 2, 3, 5, 6$ and $a_k = 0$ otherwise. Moreover,



$$ left( 1 + x^3^k + x^2cdot 3^k right)^2
equiv left( 1 + 2x^3^k right)left(1 + 2 x^3^k+1right) pmod3 $$



Plugging this back,



beginalign*
(1 + x + x^2)^2018
&equiv prod_k in 0, 2, 3, 5, 6 left( 1 + 2x^3^k right)left(1 + 2 x^3^k+1right) pmod3 \
&= (1 + 2x) (1 + 2x^3) (1 + 2x^3^2) (1 + 2x^3^3)^2 \
&quad times (1 + 2x^3^4) (1 + 2x^3^5) (1 + 2x^3^6)^2 (1 + 2x^3^7) \
&equiv (1 + 2x^3^0) (1 + 2x^3^1) (1 + 2x^3^2) (1 + x^3^3 + x^2cdot 3^3) \
&quad times (1 + 2x^3^4) (1 + 2x^3^5) (1 + x^3^6 + x^2cdot 3^6) (1 + 2x^3^7) pmod3
endalign*



If we expand the last product, no two terms have the same exponent, and so, there are total $2^6 times 3^2 = 576$ terms with coefficients not divisible by $3$.







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered Mar 19 at 22:47









Sangchul LeeSangchul Lee

96.3k12171282




96.3k12171282











  • $begingroup$
    Wow. This is amazing. Thanks a lot!
    $endgroup$
    – Kay K.
    Mar 19 at 22:51










  • $begingroup$
    @KayK. No problem :)
    $endgroup$
    – Sangchul Lee
    Mar 19 at 22:59






  • 1




    $begingroup$
    @SangchulLee: Nice presentation. (+1)
    $endgroup$
    – Markus Scheuer
    Mar 20 at 9:27
















  • $begingroup$
    Wow. This is amazing. Thanks a lot!
    $endgroup$
    – Kay K.
    Mar 19 at 22:51










  • $begingroup$
    @KayK. No problem :)
    $endgroup$
    – Sangchul Lee
    Mar 19 at 22:59






  • 1




    $begingroup$
    @SangchulLee: Nice presentation. (+1)
    $endgroup$
    – Markus Scheuer
    Mar 20 at 9:27















$begingroup$
Wow. This is amazing. Thanks a lot!
$endgroup$
– Kay K.
Mar 19 at 22:51




$begingroup$
Wow. This is amazing. Thanks a lot!
$endgroup$
– Kay K.
Mar 19 at 22:51












$begingroup$
@KayK. No problem :)
$endgroup$
– Sangchul Lee
Mar 19 at 22:59




$begingroup$
@KayK. No problem :)
$endgroup$
– Sangchul Lee
Mar 19 at 22:59




1




1




$begingroup$
@SangchulLee: Nice presentation. (+1)
$endgroup$
– Markus Scheuer
Mar 20 at 9:27




$begingroup$
@SangchulLee: Nice presentation. (+1)
$endgroup$
– Markus Scheuer
Mar 20 at 9:27

















draft saved

draft discarded
















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3154629%2fcoefficients-of-1xx22018%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Lowndes Grove History Architecture References Navigation menu32°48′6″N 79°57′58″W / 32.80167°N 79.96611°W / 32.80167; -79.9661132°48′6″N 79°57′58″W / 32.80167°N 79.96611°W / 32.80167; -79.9661178002500"National Register Information System"Historic houses of South Carolina"Lowndes Grove""+32° 48' 6.00", −79° 57' 58.00""Lowndes Grove, Charleston County (260 St. Margaret St., Charleston)""Lowndes Grove"The Charleston ExpositionIt Happened in South Carolina"Lowndes Grove (House), Saint Margaret Street & Sixth Avenue, Charleston, Charleston County, SC(Photographs)"Plantations of the Carolina Low Countrye

random experiment with two different functions on unit interval Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Random variable and probability space notionsRandom Walk with EdgesFinding functions where the increase over a random interval is Poisson distributedNumber of days until dayCan an observed event in fact be of zero probability?Unit random processmodels of coins and uniform distributionHow to get the number of successes given $n$ trials , probability $P$ and a random variable $X$Absorbing Markov chain in a computer. Is “almost every” turned into always convergence in computer executions?Stopped random walk is not uniformly integrable

How should I support this large drywall patch? Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How do I cover large gaps in drywall?How do I keep drywall around a patch from crumbling?Can I glue a second layer of drywall?How to patch long strip on drywall?Large drywall patch: how to avoid bulging seams?Drywall Mesh Patch vs. Bulge? To remove or not to remove?How to fix this drywall job?Prep drywall before backsplashWhat's the best way to fix this horrible drywall patch job?Drywall patching using 3M Patch Plus Primer