A346276 Composite m-digit numbers with m <> 3k and digital product = 7 that are divisible by 7.
11711, 1111117, 7111111, 11171111, 1111711111, 11111111711, 11711111111, 1111111111117, 1111117111111, 7111111111111, 11111111171111, 11171111111111, 1111111111711111, 1111711111111111, 11111111111111711, 11111111711111111, 11711111111111111, 1111111111111111117, 1111111111117111111
Offset: 1
Examples
a(1) = 11711 because 11711 has 5 digits, a digital product = 7 and 11711 = 7^2 * 239.
References
- Derek Holton, A Second Step to Mathematical Olympiad Problems, Vol. 7, Mathematical Olympiad Series, World Scientific, 2011, Section 8.2. USS 1 p. 260 and Section 8.14 Solutions pp. 284-287.
Programs
-
Mathematica
seq[digmax_] := Module[{dig = Select[Range[5, digmax], Mod[#, 3] > 0 &], s = {}}, Do[s = Join[s, Select[(10^d - 1)/9 + 6*10^Range[0, d - 1], Divisible[#, 7] &]], {d, dig}]; s]; seq[19] (* Amiram Eldar, Jul 22 2021 *)
-
PARI
a(n) = { my(q = floor((-3+sqrt(1+8*n))/4), s = [1, 2, 1, 1] + [1, 1, 1, 1] * q, c, b = [2, 0, 4, 5]); n -= (2*q^2 + 3*q); for(i = 1, 4, if(s[i] < n, n-=s[i] , c = i; break; ) ); qd = ceil(6*q + 3*c/2+7/2); 10^qd\9 + 6*10^(6*(n-1)+b[c]) } \\ David A. Corneth, Jul 23 2021
-
Python
from sympy import isprime def auptod(digs): return [t for t in (int('1'*(m-1-i) + '7' + '1'*i) for m in range(5, digs+1) if m%3 != 0 for i in range(m)) if t%7 == 0] print(auptod(19)) # Michael S. Branicky, Jul 22 2021
Comments