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.

A369562 Smallest positive n-digit number divisible by 7.

Original entry on oeis.org

7, 14, 105, 1001, 10003, 100002, 1000006, 10000004, 100000005, 1000000001, 10000000003, 100000000002, 1000000000006, 10000000000004, 100000000000005, 1000000000000001, 10000000000000003, 100000000000000002, 1000000000000000006, 10000000000000000004, 100000000000000000005
Offset: 1

Views

Author

J. Lowell, Jan 25 2024

Keywords

Comments

The only semiprime terms are a(2) = 14 and a(n) such that (10^(n-1) + 3)/7 is a prime. - Jon E. Schoenfield, Jan 27 2024

Examples

			a(3) = 105 = 7*15.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := 10^(n - 1) + {6, 4, 5, 1, 3, 2}[[Mod[n, 6, 1]]]; Array[a, 30]
    (* or *)
    LinearRecurrence[{11, -10, -1, 11, -10}, {7, 14, 105, 1001, 10003, 100002}, 30] (* Amiram Eldar, Jan 27 2024 *)
    Table[10^n+7-PowerMod[10,n,7],{n,0,20}] (* Harvey P. Dale, Jan 13 2025 *)

Formula

a(n) = (floor(10^(n-1)/7) + 1)*7.
a(n) = 10^(n-1) + A033940(n+2). - Amiram Eldar, Jan 27 2024
G.f.: 7*x*(1 - 9*x + 3*x^2 - x^3 - 3*x^4)/((1 - x)*(1 + x)*(1 - 10*x)*(1 - x + x^2)). - Stefano Spezia, Jan 28 2024