How many 8-digit positive integers have all digits either 3 or 4, and have exactly three consecutive 3's?

["Title: Counting 8-Digit Positive Integers with Digits Only 3 or 4 and Exactly Three Consecutive 3’s", "---", "Introduction\nIf you’re fascinated by number patterns and digits made from limited choices, counting 8-digit positive integers composed only of digits 3 and 4—while also containing exactly three consecutive 3’s—is a compelling combinatorial puzzle. This article explores how many such 8-digit numbers exist, combining digit constraints, pattern recognition, and careful counting logic.", "---", "### Understanding the Problem", "We want to determine how many 8-digit positive integers:", "- Use only the digits 3 and 4 (no 0, 1, 5+, or other digits),\n- Contain exactly three consecutive 3’s (i.e., the substring "333"),\n- Do not contain any other group of three or more consecutive 3’s,\n- Are valid 8-digit numbers (no leading zeros—though since digits are only 3 and 4, this condition is naturally satisfied),\n- And are 8-digit long, meaning the first digit cannot be zero (but again, digits are 3 or 4—so all combinations are valid numbers).", "We must count all 8-digit binary-like strings (with symbols 3 and 4), satisfying these strict digit and pattern rules.", "---", "### Step 1: Define the Total Structure", "Let each number be an 8-digit string:\n$$d_1 d_2 d_3 d_4 d_5 d_6 d_7 d_8$$\nwhere $d_i \in {3,4}$,\nand among the digits, there is exactly one interval of three consecutive 3’s,\nwith no longer run of 3’s allowed (i.e., no "3333" or "3332623" containing multiple overlapping 3-strings),\nand all other runs of 3’s must be of length ≤2 and not adjacent or overlapping with "333".", "---", "### Step 2: Use Substring Logic to Avoid Overcounting", "The key is precisely three consecutive 3’s, appearing once and not repeated or adjacent.", "We’ll count valid placements of the block "333", then fill the remaining positions with 3 or 4 under strict constraints:\n- No overlapping or adjacent "333"\n- No additional runs of three or more 3’s\n- Single isolated trio of three 3’s\n- Entire string length is 8", "---", "### Step 3: Identify All Possible Starting Positions for "333"", "Since the substring "333" occupies 3 digits, it can start at positions:\n$$1 \leq i \leq 6$$\n(i.e., positions 1–6: 333xxxx, x333xxx, ..., xxxx333)", "We analyze each starting position $i$, ensuring the block fits and surrounding digits prevent overlapping or extended runs.", "Let’s denote the three consecutive 3’s starting at position $i$:\n$$\ ext{Positions } i, i+1, i+2 = 3$$", "We must then assign values to $d_1..d_8$, with:", "- The triple "333" fixed at one location\n- No three 3’s in a row elsewhere\n- No "333" overlapping (e.g., starting at $i-1$ or $i+3$)\n- Any 3’s not adjacent to this block (i.e., separated by at least one non-3)", "---", "### Step 4: Use Inclusion with Careful Posting of Gaps", "We proceed case by case based on the starting index $i$ of "333", and count valid completions for each, avoiding overlaps.", "Let $N_i$ = number of valid assignments for fixed $i$, with blocks = "333" at $i,i+1,i+2$, and no other "333" allowed.", "We calculate $N_i$ for $i = 1$ to $6$, then sum.", "---", "#### Case 1: "333" starts at position 1 (i=1) → digits 1–3 = 333\nConstraints:\n- Cannot have "3333" → digit 4 ≠ 3 at position 4\n- Digits 4,5,6,7,8 must avoid forming another "333"", "So:\n- $d_4 = 4$ or block of 3’s ending before 4 is broken\nBut since we want exactly one block of three 3s, we must break any long runs.", "Here, 3s end at position 3 → isolated as long as position 4 ≠ 3.", "Now for positions 4–8 (5 digits), we assign 3 or 4, but no three consecutive 3s, and also ensure that if multiple 3s appear, they are split.", "But crucially, we must avoid any occurrence of "333" in positions 4–8, and also ensure no merging at boundaries — but since "333" ends at 3 and we force $d_4 = 4$, no issue.", "So now count number of 5-digit strings over {3,4} with no "333" substring.", "Let $a_n$ = number of length-$n$ strings over {3,4} with no three consecutive 3s.", "This is a classic recurrence:\nLet $a_n = a_{n-1} + a_{n-2} + a_{n-3}$,\nwith $a_1 = 2$ (3,4), $a_2 = 4$ (33,34,43,44), $a_3 = 7$ (7 – only 333 forbidden, 8 total strings)", "Then:\n- $a_4 = a_3 + a_2 + a_1 = 7 + 4 + 2 = 13$\n- $a_5 = a_4 + a_3 + a_2 = 13 + 7 + 4 = 24$", "So $N_1 = a_5 = 24$ ways (since $d_4 = 4$ enforced)", "---", "#### Case 2: "333" starts at position 2 (i=2) → digits 2–4 = 333\nThen $d_2 = d_3 = d_4 = 3$\nConstraints:\n- Digit 1: arbitrary 3 or 4\n- Digit 5 ≠ 3 → $d_5 = 4$, to avoid "3333"\n- Digits 6–8 must avoid forming "333"\n- Also must not create another "333" across or within", "Break down:", "- $d_1$: 3 or 4 → 2 choices\n- $d_5 = 4$ → 1 choice\n- $d_6,d_7,d_8$: any 3 or 4, but no "333" substring", "So positions 6–8: 3-digit string with no "333" → $a_3 = 7$", "But must also ensure that $d_5 = 4$ breaks any connection — it does.", "So total: $2 \ imes 1 \ imes 7 = 14$", "Now check for overlaps: could a block end at 5? No — $d_5=4$, so no issue.", "Any "333" across boundary? Only across 4–5: $d_4=3, d_5=4$ → not 3, so safe.", "Thus, $N_2 = 14$", "---", "#### Case 3: "333" starts at 3 (i=3) → $d_3=d_4=d_5=3$\nThen:\n- $d_2 ≠ 3$ → $d_2 = 4$ (to prevent "x333" → if $d_2=3$, then "333" starts earlier if $d_1=3$ or $d_1=3,d_2=3$)\nWait: we want exactly one "333", so must prevent starting triple at 1 or 2.", "But $d_2 = 4$ guarantees:\n- No "333" ending at 2 or earlier\n- $d_2 = 4$ prevents "x333" ending at 2 → safe", "Now:\n- $d_1$: 3 or 4 → 2 choices\n- $d_2 = 4$ → 1 → forces no early triple\n- $d_6$: cannot be 3 if $d_4=3, d_5=3$ → $d_6 ≠ 3$ → $d_6 = 4$, to avoid "333" at 4–6\n- $d_7,d_8$: any 3 or 4, but no "333" in 7–8 (only 2 digits), but also check positions 5–7: $d_5=3, d_6=4$, so no "333" possible starting at 5 or 6", "So constraints:\n- $d_1$: 2 choices\n- $d_6 = 4$ → 1 choice\n- $d_7,d_8$: any 3 or 4, but no "333" in 6–8 → but only two digits → no "333" possible → $a_2 = 4$", "So $N_3 = 2 \ imes 1 \ imes 4 = 8$", "---", "#### Case 4: "333" starts at 4 (i=4) → $d_4=d_5=d_6=3$\nThen:\n- $d_3 ≠ 3$ → $d_3 = 4$\n- $d_7 ≠ 3$ → $d_7 = 4$ to avoid "333" extending to 6–8\n- $d_1,d_2$: arbitrary, but no "333" formed earlier", "So:\n- $d_3 = 4$ → 1\n- $d_7 = 4$ → 1\n- $d_1,d_2$: 3 or 4, but avoid "333" — but max length 2 → all 4 combinations allowed: $a_2 = 4$", "Thus $N_4 = 4 \ imes 1 \ imes 1 = 4$", "---", "#### Case 5: "333" starts at 5 (i=5) → $d_5=d_6=d_7=3$\nThen:\n- $d_4 ≠ 3$ → $d_4 = 4$\n- $d_8 ≠ 3$ → $d_8 = 4$\n- $d_1,d_2,d_3$: arbitrary, full $a_3 = 7$", "So $N_5 = 7 \ imes 1 \ imes 1 = 7$", "---", "#### Case 6: "333" starts at 6 (i=6) → $d_6=d_7=d_8=3$\nThen:\n- $d_5 ≠ 3$ → $d_5 = 4$\n- $d_1–d_4$: any 3 or 4, but no "333" — total $a_4 = 13$", "So $N_6 = 13 \ imes 1 \ imes 1 = 13$", "---", "### Step 5: Sum All Valid Cases", "Now add:", "- $N_1 = 24$\n- $N_2 = 14$\n- $N_3 = 8$\n- $N_4 = 4$\n- $N_5 = 7$\n- $N_6 = 13$", "Total:\n$$24 + 14 + 8 + 4 + 7 + 13 = 70$$", "---", "### Final Answer", "There are exactly 70 eight-digit positive integers composed of digits only 3 and 4 that contain exactly one occurrence of three consecutive 3’s and no longer runs.", "This count demonstrates how intricate digit constraints and substring avoidance logic combine in combinatorics, especially in finite symbolic systems.", "---", "Keywords: 8-digit number, digits only 3 or 4, exactly three consecutive 3’s, no repeated "333", counting_enumeration, combinatorics, digit restrictions", "SEO meta description: Count how many 8-digit positive integers use only digits 3 and 4 and contain exactly three consecutive 3’s, with no longer runs of 3’s — absolute enumeration with pattern constraints. Solution includes case analysis by position of "333" and dynamic programming for forbidden substrings. Total: 70."]









