cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 11-14 of 14 results.

A346274 Number of n-digit primes with digital product = 7.

Original entry on oeis.org

1, 2, 0, 2, 2, 0, 3, 3, 0, 2, 1, 0, 1, 0, 0, 0, 2, 0, 3, 1, 0, 3, 1, 0, 2, 1, 0, 2, 3, 0, 2, 1, 0, 2, 2, 0, 3, 0, 0, 3, 0, 0, 2, 1, 0, 3, 3, 0, 4, 4, 0, 1, 2, 0, 4, 2, 0, 1, 2, 0, 1, 2, 0, 3, 3, 0, 2, 1, 0, 2, 2, 0, 1, 3, 0, 0, 3, 0, 1, 3, 0, 2, 8, 0, 1, 3, 0
Offset: 1

Views

Author

Bernard Schott, Jul 12 2021

Keywords

Comments

Equivalently: Number of n-digit terms of A107693 that are primes.
This sequence is inspired by the 1st problem, submitted by USSR during the 31st International Mathematical Olympiad in 1990 at Beijing, but not used for the competition.
The problem was: Consider the n-digit numbers consisting of one '7' and n-1 '1'. For what values of n are all these numbers prime?
a(n) = n iff n = 1 or n = 2 (this is the answer to the Olympiad problem).
a(n) < n for n >= 3 <=> for n >= 3, there is always at least one composite number among the n-digit numbers with digital product = 7.
Steps of the proof by disjunction elimination (proof in Derek Holton in reference):
-> If n = 3*k, k>0, a(n) = 0 because the n-digit numbers with digital product = 7 are then divisible by 3.
-> If n = 4, 1117 and 1171 are primes, but 1711 = 29 * 59 and 7111 = 13 * 547; hence a(4) = 2 < 4.
-> If n > 4 and n <> 3k, there is always at least one n-digit number that is divisible by 7, these composites are in A346276.
Also, a(n) = 0 for n = 14, 16, 38, 41, 76, 104, 107, 110, 128, 134, 146, 152, 155, 164, 166, 178, 185, ... (comes from b-file in A107693).

Examples

			7 is prime, hence a(1) = 1.
17 and 71 are primes, hence a(2) = 2.
1117 and 1171 are primes, but 1711 = 29 * 59 and 7111 = 13 * 547; hence a(4) = 2.
		

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.

Crossrefs

Programs

  • Mathematica
    a[n_] := Count[(10^n - 1)/9 + 6*10^Range[0, n - 1], ?PrimeQ]; Array[a, 100] (* _Amiram Eldar, Jul 12 2021 *)
  • PARI
    a(n) = {my(s = 10^n\9); sum(i = 0, n-1, isprime(s + 6*10^i))} \\ David A. Corneth, Jul 12 2021
    
  • Python
    from sympy import isprime
    def a(n):
        return sum(isprime(int('1'*(n-1-i) + '7' + '1'*i)) for i in range(n))
    print([a(n) for n in range(1, 88)]) # Michael S. Branicky, Jul 12 2021

Formula

a(3*k) = 0 for k >= 1.

A179303 Indices of primes occurring in A034054.

Original entry on oeis.org

0, 1, 2, 6, 7, 10, 11, 23, 24, 25, 28, 29, 35, 51, 53, 64, 85, 137, 143, 172, 184, 185, 193, 233, 244, 245, 253, 305, 323, 331, 385, 397, 406, 417, 423, 472, 492, 499, 563, 567, 599, 601, 673, 692, 694, 780, 786, 792, 922, 930, 975, 1049, 1051, 1053, 1096, 1120
Offset: 0

Views

Author

Dmitry Kamenetsky, Jul 10 2010

Keywords

Crossrefs

A346276 Composite m-digit numbers with m <> 3k and digital product = 7 that are divisible by 7.

Original entry on oeis.org

11711, 1111117, 7111111, 11171111, 1111711111, 11111111711, 11711111111, 1111111111117, 1111117111111, 7111111111111, 11111111171111, 11171111111111, 1111111111711111, 1111711111111111, 11111111111111711, 11111111711111111, 11711111111111111, 1111111111111111117, 1111111111117111111
Offset: 1

Views

Author

Bernard Schott, Jul 22 2021

Keywords

Comments

Proposition: when m > 4 and m <> 3k, there is always at least one m-digit number that is divisible by 7 (proof in Derek Holton in reference), these composites are in this sequence (see A346274).
Every term has m = 5+6r, resp. (7+6r, 8+6r, 10+6r (r>=0)) digits and comes from the concatenation of a(1) = 11711, resp. (7, a(4) = 11171111, a(5) = 1111711111) with one or more strings of R_6 = 111111 = 7*15873 placed before and/or after a(1), resp. (7, a(4), a(5)).
The corresponding smallest term b(m) with m = 5+6r, resp. (7+6r, 8+6r, 10+6r (r>=0)) digits is b(m) = R_m + 6*10^k with k = 2, resp. (0, 4, 5) with R_m = A002275(m) is the repunit with a string of m 1's.
Alternatively, numbers viewed as strings over {1, 7} divisible by 7 are accepted by an automaton with 12 states, {0..6, 0'..6'} - {3, 3'}, with k (resp. k') representing remainder mod 7 where 7 has not (resp. has) been seen; transition function delta(k, 1) = 10*k+1 mod 7, delta(k, 7) = (10*k+7 mod 7)', delta(k', 1) = 10*k'+1 mod 7; start state 0; and accept state 0'. Accepted strings satisfy the regular expression (111111)*(7 + 11711 + 11171111 + 1111711111 + 111117111)(111111)*. This sequence includes all terms matching (111111)*(7 + 11711 + 11171111 + 1111711111)(111111)* except the number 7 alone. - Michael S. Branicky, Jul 22 2021

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.

Crossrefs

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
    

A201021 Composite numbers whose multiplicative digital root is 7.

Original entry on oeis.org

117, 171, 711, 1711, 7111, 11711, 17111, 71111, 111117, 111171, 111711, 117111, 171111, 711111, 1111117, 1111171, 1711111, 7111111, 11111711, 11117111, 11171111, 11711111, 17111111, 111111117, 111111171, 111111711, 111117111, 111171111, 111711111, 117111111, 171111111
Offset: 1

Views

Author

Jaroslav Krizek, Nov 25 2011

Keywords

Comments

Also composite numbers whose product of digits is 7.
Complement of A107693 with respect to A034054. ~

Crossrefs

Cf. A107693 (primes whose multiplicative digital root is 7), A034054 (numbers whose multiplicative digital root is 7).

Programs

  • Mathematica
    Flatten[Table[Select[FromDigits/@Permutations[PadRight[{7},n,1]],CompositeQ],{n,9}]]//Sort (* Harvey P. Dale, Mar 29 2023 *)

Formula

Number 171 is in sequence because 1*7*1=7.
Previous Showing 11-14 of 14 results.