login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A366596
Repdigit numbers that are divisible by 7.
3
0, 7, 77, 777, 7777, 77777, 111111, 222222, 333333, 444444, 555555, 666666, 777777, 888888, 999999, 7777777, 77777777, 777777777, 7777777777, 77777777777, 111111111111, 222222222222, 333333333333, 444444444444, 555555555555, 666666666666, 777777777777
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
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
Intersection of A008589 and A010785.
Cf. A002281 (a subsequence).
Cf. A305322 (divisor 3), A002279 (divisor 5), A083118 (the impossible divisors).
Sequence in context: A191465 A229281 A144071 * A061546 A002281 A097983
KEYWORD
nonn,base,easy
AUTHOR
Kritsada Moomuang, Oct 14 2023
STATUS
approved