scieee AI-readable full text Open interactive document viewer

An elementary note on a digit–product condition forcing repunits

Caraccioli Abrego, Ricardo Adonis

Abstract

We study a very simple condition on the decimal digits of a positive integer. Let PD(n) be the product of the decimal digits of n. We show that if n has at least 22 digits and satisfies the divisibility condition “n divides PD(n) minus 1”, then n must be a repunit, that is, all of its digits are equal to 1. The proof is purely a size comparison: for 22 or more digits, the maximum possible product of digits is already smaller than the smallest integer with that many digits, so the only way the divisibility can hold is when PD(n) equals 1. The remaining finite range of digit lengths from 1 to 21 can be checked by computer; we include a short Python script that performs an exhaustive search up to 6 digits (and can be extended further) and report that no non-repunit examples were found. We also briefly explain how the same argument works in any integer base greater than or equal to 3.

Full text

An elementary note on a digit–product condition forcing repunits Ricardo Adonis Caraccioli Abrego Department of Electrical Engineering, Campus Cortés Universidad Nacional Autónoma de Honduras (UNAH-VS), San Pedro Sula, Honduras ORCID: 0009-0006-3522-5818 [email protected] Abstract We record a very simple observation about the decimal digits of an integer. Let nbe a positive integer and let PD(n)denote the product of its decimal digits. If nhas at least 22 digits and satisfies n|(PD(n)−1), then nmust be a repunit, i.e. all its digits are 1. The proof is just a size comparison: for k≥22 digits, the maximal possible product of digits is strictly smaller than the minimal k– digit number. What remains is a finite range 1≤k≤21 that can be checked by computer. We include a short Python script illustrating how to perform this verification, and we report that an exhaustive search over digit strings without zeros up to length 6found no non-repunit examples. The aim of this note is simply to register the observation in a clean, reproducible form. 1 Introduction Let n≥1be a positive integer written in base 10. Write nas n=d1d2. . . dk in decimal, where each di∈ {0,1,...,9}and kis the number of digits. We denote by PD(n) the product of its decimal digits: PD(n):=d1d2···dk. We are interested in integers nthat satisfy the divisibility condition n|(PD(n)−1).(1) If nis a (decimal) repunit, i.e. n= 1,11,111, . . . , then PD(n) = 1 and the condition is automatic. The point of this note is that, once nis long enough, (1) actually forces all digits to be 1. The argument is entirely elementary. This is, of course, not a deep result; but it is short, explicit, and has a natural finite remainder that one can check with a few lines of code. It also works verbatim in other bases. 2 Elementary observations Lemma 1 (Repunits satisfy the condition).If all decimal digits of nare 1, then n|(PD(n)−1). Proof. If n= 11 ...1, then PD(n)=1,soPD(n)−1 = 0, which is divisible by n. Lemma 2 (Zero digits are excluded).If nhas at least one digit equal to 0, then ncannot satisfy (1). 1 Proof. If one digit is 0, then PD(n)=0, hence PD(n)−1=−1, which is not divisible by n≥1. So any nwith (1) must have digits in {1,2,...,9}. Thus, for our problem we may assume from the start that every digit lies in {1,...,9}. 3 A size argument for long integers Theorem 1. Let nbe a decimal integer with k≥22 digits. If n|(PD(n)−1), then nis a repunit. Proof. If nhas kdigits, then n≥10k−1.(2) Since every digit is at most 9, we also have PD(n)≤9k.(3) A direct check shows that 9k<10k−1for all k≥22.(4) (Indeed, this follows from klog 9 <(k−1) log 10 for k≥22.) Combining (2), (3) and (4) we obtain, for k≥22, 0≤PD(n)−1<9k≤10k−1≤n. Now assume n|(PD(n)−1). Then PD(n)−1is a nonnegative multiple of nstrictly smaller than n, so it must be 0. Hence PD(n)=1, and that only happens when every digit is 1. Thus nis a repunit. Remark. The constant 22 is just the one that drops out of the coarsest comparison “largest digit product” vs. “smallest k–digit number”. One could lower this threshold by excluding certain digit patterns or by using a sharper estimate, but the present form is enough to isolate a finite range. 4 The remaining finite range Theorem 1 shows that every nwith k≥22 digits satisfying (1) is a repunit. Therefore, to obtain a full statement in base 10 it suffices to check the finite range 1≤k≤21. By Lemma 2, digits equal to 0never appear in solutions, so we only need to look at digits in {1,...,9}. This makes the search noticeably smaller. We explicitly tested (by code) all digit strings over {1,...,9}of length up to 6and found no non-repunit example satisfying (1). Longer lengths can be explored on a standard computer using the script in Appendix A; one can either proceed exhaustively up to a chosen bound or sample digit strings of lengths 10 to 21. In any case, the computational component is now clearly separated from the proven part. 2 5 A base-bversion The same idea works in any base b≥3. Let PDb(n)be the product of the base-bdigits of n. If nhas kdigits in base b, then n≥bk−1and PDb(n)≤(b−1)k. Thus, whenever (b−1)k< bk−1, the condition n|(PDb(n)−1) forces PDb(n)=1, hence all base-bdigits are 1. So for each base there is a (small) digit-length from which the statement is automatic. References •I. Niven, H. S. Zuckerman, H. L. Montgomery, An Introduction to the Theory of Numbers, 5th ed., Wiley, 1991. •P. Ribenboim, The Little Book of Big Primes, 2nd ed., Springer, 2004. •OEIS Foundation Inc., The On-Line Encyclopedia of Integer Sequences,https://oeis. org. A Python script for the finite range The following script generates all digit strings over {1,...,9}of length 1to 6and tests the condition n|(PD(n)−1). It reports any solution that is not a repunit. The same structure can be extended to longer lengths or adapted to sampling. from itertools import product def prod_digits(n: int) -> int: p=1 for ch in str(n): p *= int(ch) return p def is_repunit(n: int) -> bool: return set(str(n)) == {"1"} bad = [] # exhaustive check up to 6 digits, digits 1..9 for length in range(1, 7): for digits in product("123456789", repeat=length): s = "".join(digits) n = int(s) pd = prod_digits(n) value = pd - 1 if value >= 0 and value % n == 0: if not is_repunit(n): bad.append(n) 3 print("Non-repunit solutions found (length <= 6):") for n in bad: print(n) # optional: sample longer lengths 7..21 # import random # for length in range(7, 22): # for _ in range(20000): # digits = [random.choice("123456789") for _ in range(length)] # n = int("".join(digits)) # pd = prod_digits(n) # value = pd - 1 # if value >= 0 and value % n == 0 and not is_repunit(n): # print("Long non-repunit solution:", n, "length", length) Running the first (exhaustive) part of this script up to length 6produced no non-repunit solutions, which is consistent with the theoretical part of this note. 4