Here is an article, regarding mod 5 analogs of A246039 and A246038, where t\ he individuality of the coefficients 1,2,3,4 is kept.: 2 2 2 2 2 n On the sequence, (x y + x y + x + x y + y + y + 1) , modulo , 5 By Shalosh B. Ekhad 2 2 2 2 2 You raise the polynomial, x y + x y + x + x y + y + y + 1, to the n-th power, and then take it mod, 5, and would like to know, for each i from 1 to, 4 the number of times it shows up as a coefficient in that expanded polynomial\ . This article answers this question. The first, 41, terms staring at n=0, for the number of occurrences of, 1, are: [1, 7, 4, 18, 31, 7, 49, 28, 98, 109, 4, 28, 72, 142, 152, 18, 126, 254, 337, 284, 31, 217, 240, 510, 599, 7, 49, 28, 126, 217, 49, 343, 196, 686, 763, 28, 196, 504, 886, 876, 98] The first, 41, terms staring at n=0, for the number of occurrences of, 2, are: [0, 0, 13, 4, 10, 0, 0, 91, 52, 70, 13, 91, 112, 182, 183, 4, 28, 292, 224, 294 , 10, 70, 495, 444, 392, 0, 0, 91, 28, 70, 0, 0, 637, 364, 490, 91, 637, 784, 1266, 1177, 52] The first, 41, terms staring at n=0, for the number of occurrences of, 3, are: [0, 0, 2, 12, 4, 0, 0, 14, 36, 40, 2, 14, 68, 131, 188, 12, 84, 209, 304, 302, 4, 28, 384, 340, 420, 0, 0, 14, 84, 28, 0, 0, 98, 252, 280, 14, 98, 476, 825, 1240, 36] The first, 41, terms staring at n=0, for the number of occurrences of, 4, are: [0, 0, 2, 9, 22, 0, 0, 14, 59, 82, 2, 14, 189, 132, 168, 9, 63, 148, 258, 345, 22, 154, 288, 475, 532, 0, 0, 14, 63, 154, 0, 0, 98, 413, 574, 14, 98, 1323, 924, 1032, 59] Just for kicks, for the googol-th term, the number of occurrences of i from \ 1 to, 4, are: [262339642909562924391516703535458398653547, 262339642908851974310025781327096547173002, 262339642899643117914873678055749815626758, 262339642900337475899595043127919728839014] The first , 40, terms of the sequence, number of occurrences, 1, i shows up at the, 5 - 1, places are [1, 31, 599, 13837, 323041, 7890043, 195442919, 4869730597, 121592082901, 3038349143023, 75945060183779, 1898491881936517, 47460999445808081, 1186511996255495903, 29662671584246405859, 741565485264072572777, 18539123959506684204761, 463477963291612520613703, 11586947688648632727848559, 289673677718330441574935137, 7241841792372907387876610461, 181046043232933774418761163823, 4526151064335205114063482440959, 113153776435117802087127108241097, 2828844409058153990639554617845901, 70721110207288036524992614677734603, 1768027754980408230836997860250040399, 44200693872382177299276834744253421617, 1105017346787116925964777666358322910481, 27625433669441124953740203716710295571823, 690635841733529267573662896629087235129979, 17265896043311847385054411743177607988726817, 431647401082517616780216680001786723695487041, 10791185027059998285166820378327096527356621663, 269779625676468883779258558382547315574118363659, 6744490641911393845161589154533131856517103732197, 168612266047781378597035253100950049142882930359261, 4215306651194497830152943118268788255316803995927103, 105382666279862058701087391771351525449102212410447059, 2634566656996547377914685713584202318298316088886929237, 65864166424913641236483694912514098321632031533796730241] The first , 40, terms of the sequence, number of occurrences, 2, i shows up at the, 5 - 1, places are [0, 10, 392, 11558, 306924, 7808746, 196111684, 4909605474, 122796045552, 3070335480170, 76762382708516, 1919093096215290, 47977655611737340, 1199444341874198494, 29986138220662470648, 749653736294787728246, 18741346280002613861188, 468533685198520941618698, 11713342421524978531123160, 292833563469954509772550042, 7320839117225740208991740076, 183020978241882941906778921902, 4575524459293741329730431327212, 114388111515858237359324201683578, 2859702788247197513545626625529764, 71492569709829433039519721295458726, 1787314242784046204659901729216920064, 44682856070002093860194023219327458114, 1117071401754271997161329992837372200472, 27926785043901139263779865430932868860430, 698169626097996017024464708721141967138796, 17454240652454826226416193575275968231982490, 436356016311422661492989401554518141618909560, 10908900407786115346027061934064134000589176454, 272722510194658682234253401586351259386962582908, 6818062754866528303813588778596774340760893652106, 170451568871663854973401008020839071014381449924048, 4261289221791603215515088748438011456866886838023278, 106532230544790152708197155888207467575247305235029240, 2663305763619754582101409036187968563376048978724513302, 66582644090493872633310888488049645978587911003296222316] The first , 40, terms of the sequence, number of occurrences, 3, i shows up at the, 5 - 1, places are [0, 4, 420, 11604, 306972, 7782844, 195928944, 4907765936, 122781228228, 3070211023952, 76761405753668, 1919085796578188, 47977604104703184, 1199444009538508920, 29986136375015823092, 749653729284454166620, 18741346295135354321120, 468533685943608637634948, 11713342432809346329331396, 292833563604008009540436432, 7320839118647784147660793476, 183020978255947819632414022476, 4575524459426122946150919226440, 114388111517056147934071860226264, 2859702788257680423193401906445772, 71492569709918392532787007787988884, 1787314242784778996337170067397525524, 44682856070007947138201808463332877076, 1117071401754317202104296484493803377048, 27926785043901474808381092017659407023212, 698169626097998385130652999082334048200548, 17454240652454841785485526903869256801191328, 436356016311422752317018767472214721454575644, 10908900407786115755026323976036439222954847460, 272722510194658682627815530129538070611662059112, 6818062754866528281749048583672855045876277221040, 170451568871663854582824551834028010895553892724280, 4261289221791603210626885675335882089135326769966288, 106532230544790152655006231880526253837460070172084816, 2663305763619754581567138109582903368353983324458273052, 66582644090493872628230074757666525296601467323800384476] The first , 40, terms of the sequence, number of occurrences, 4, i shows up at the, 5 - 1, places are [0, 22, 532, 12854, 316744, 7837726, 195082128, 4867009722, 121573093988, 3038223784738, 75944316740884, 1898488405189830, 47460993282275532, 1186512139090866570, 29662674329828457960, 741565520560161784958, 18539124347171695539936, 463477967212974645843642, 11586947726051149633013016, 289673678060481601080251766, 7241841795389782594083901100, 181046043258719923819202410534, 4526151064548856318271438878232, 113153776436835105305617121926914, 2828844409071497521635312666535104, 70721110207387824585348362468675646, 1768027754981118853865215625332172888, 44200693872386909951217376082529504422, 1105017346787145199684687710807168208588, 27625433669441260054722876016313871202138, 690635841733529516749428185532955105071384, 17265896043311842060044951827318271562856590, 431647401082517511696208958698452311282589212, 10791185027059996927442044900996349757800106050, 269779625676468868764880066337883791262237146700, 6744490641911393692815515494147171001250616086218, 168612266047781377137442345669581629138137388855476, 4215306651194497816763442397723336196080042615125142, 105382666279862058582581785915609942926785577653504696, 2634566656996547376898789772974736037152832599909847826, 65864166424913641228034336904685573835885851775986233640]