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.

Showing 1-2 of 2 results.

A366596 Repdigit numbers that are divisible by 7.

Original entry on oeis.org

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

Views

Author

Kritsada Moomuang, Oct 14 2023

Keywords

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

Crossrefs

Intersection of A008589 and A010785.
Cf. A002281 (a subsequence).
Cf. A305322 (divisor 3), A002279 (divisor 5), A083118 (the impossible divisors).

Programs

  • 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

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)

A365933 a(n) is the period of the remainders when repdigits are divided by n.

Original entry on oeis.org

1, 9, 27, 9, 9, 27, 54, 9, 81, 9, 18, 27, 54, 54, 27, 9, 144, 81, 162, 9, 54, 18, 198, 27, 9, 54, 243, 54, 252, 27, 135, 9, 54, 144, 54, 81, 27, 162, 54, 9, 45, 54, 189, 18, 81, 198, 414, 27, 378, 9, 432, 54, 117, 243, 18, 54, 162, 252, 522, 27, 540, 135, 162, 9, 54
Offset: 1

Views

Author

Karl-Heinz Hofmann, Nov 07 2023

Keywords

Comments

For n>1: Periods are divisible by 9 (= a full cycle in the sequence of repdigits). a(n)/9 is the period of the remainders when repunits are divided by n. So the digit part of the repdigits has no effect on periods generally. For most n the beginning of the periodic part is always A010785(1). If n is a term of A083118 the periodic part starts later after some initial remainders that do not repeat.

Examples

			For n = 6:                Remainders of A010785(1..54) mod n.
A010785( 1...9) mod n:      [1, 2, 3, 4, 5, 0, 1, 2, 3]
A010785(10..18) mod n:      [5, 4, 3, 2, 1, 0, 5, 4, 3]
A010785(19..27) mod n:      [3, 0, 3, 0, 3, 0, 3, 0, 3]
So the period is 3*9 = 27. Thus a(n) = 27. And the pattern seen above starts again:
A010785(28..36) mod n:      [1, 2, 3, 4, 5, 0, 1, 2, 3]
A010785(37..45) mod n:      [5, 4, 3, 2, 1, 0, 5, 4, 3]
A010785(46..54) mod n:      [3, 0, 3, 0, 3, 0, 3, 0, 3]
		

Crossrefs

Cf. A305322 (divisor 3), A002279 (divisor 5), A366596 (divisor 7).
Cf. A083118 (the impossible divisors).

Programs

  • Python
    def A365933(n):
        if n == 1: return 1
        remainders, exponent = [], 1
        while (rem:=(10**exponent // 9 % n)) not in remainders:
            remainders.append(rem); exponent += 1
        return (exponent - remainders.index(rem) - 1) * 9
    
  • Python
    def A365933(n):
        if n==1: return 1
        a,b,x,y=1,1,1%n,11%n
        while x!=y:
            if a==b:
                a<<=1
                x,b=y,0
            y = (10*y+1)%n
            b+=1
        return 9*b # Chai Wah Wu, Jan 23 2024
Showing 1-2 of 2 results.