OFFSET
1,2
COMMENTS
7 divides a repdigit iff it consists of only digit 7, or has length 6*k (for any digit).
Repdigit remainders A010785(k) mod 7 have period 54. - Karl-Heinz Hofmann, Dec 04 2023
LINKS
Karl-Heinz Hofmann, Table of n, a(n) for n = 1..2329
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,0,0,0,0,0,0,1000001,0,0,0,0,0,0,0,0,0,0,0,0,0,-1000000).
FORMULA
From Karl-Heinz Hofmann, Dec 04 2023: (Start)
a(n) = A010785(floor((n-2)/14)*54 + ((n-2) mod 14) + 41), for (n-2) mod 14 > 4.
a(n) = (10^(6*floor((n-2)/14) + 6)-1)/9*(((n-2) mod 14)-4), for (n-2) mod 14 > 4.
a(n) = A010785(floor((n-2)/14)*54 + ((n-2) mod 14)*9 + 7), for (n-2) mod 14 <= 4.
a(n) = (10^(6*floor((n-2)/14) + 1 + ((n-2) mod 14))-1)/9*7, for (n-2) mod 14 <= 4.
(End)
PROG
(PARI) r(n) = 10^((n+8)\9)\9*((n-1)%9+1); \\ A010785
lista(nn) = select(x->!(x%7), vector(nn, k, r(k-1))); \\ Michel Marcus, Oct 26 2023
(Python)
def A366596(n):
digitlen, digit = (n+12)//14*6, (n+12)%14-4
if digit < 1: digitlen += digit - 1; digit = 7
return 10**digitlen // 9 * digit # Karl-Heinz Hofmann, Dec 04 2023
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Kritsada Moomuang, Oct 14 2023
STATUS
approved