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.

A305322 Repdigit numbers that are divisible by 3.

Original entry on oeis.org

0, 3, 6, 9, 33, 66, 99, 111, 222, 333, 444, 555, 666, 777, 888, 999, 3333, 6666, 9999, 33333, 66666, 99999, 111111, 222222, 333333, 444444, 555555, 666666, 777777, 888888, 999999, 3333333, 6666666, 9999999, 33333333, 66666666, 99999999, 111111111, 222222222
Offset: 1

Views

Author

Kritsada Moomuang, May 30 2018

Keywords

Comments

The terms > 0 are (10^d-1)*k/9 for k=1..9 if d is divisible by 3, and for k=3,6,9 otherwise. - Robert Israel, Jun 01 2018
Repdigit remainders A010785(k) mod 3 have period 27. - Karl-Heinz Hofmann, Nov 11 2023

Examples

			111 / 3 = 37;
222 / 3 = 74;
333 / 3 = 111;
444 / 3 = 148;
555 / 3 = 185.
		

Crossrefs

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

Programs

  • Maple
    L:= proc(d) if d mod 3 = 0 then [$1..9] else [3,6,9] fi end proc:
    0,seq(seq((10^d-1)/9*k,k=L(d)),d=1..9); # Robert Israel, Jun 01 2018
  • Python
    def A010785(n): return (n - 9*((n-1)//9))*(10**((n+8)//9) - 1)//9
    def A305322(n):
        d0, d1 = divmod(n-1,15)
        if d1 < 7: return A010785(d0 * 27 + d1 * 3)
        return A010785(d0 * 27 + d1 + 12) # Karl-Heinz Hofmann, Nov 26 2023

Formula

From Alois P. Heinz, May 30 2018: (Start)
{ A008585 } intersect { A010785 }.
G.f.: 3*(300*x^20 + 200*x^19 + 100*x^18 + 330*x^17 + 220*x^16 + 110*x^15 + 333*x^14 + 296*x^13 + 259*x^12 + 222*x^11 + 185*x^10 + 148*x^9 + 111*x^8 + 74*x^7 + 37*x^6 + 33*x^5 + 22*x^4 + 11*x^3 + 3*x^2 + 2*x + 1)*x^2 / ((x-1) *(x^2 + x + 1) *(x^4 + x^3 + x^2 + x + 1) *(10*x^5-1) *(x^8 - x^7 + x^5 - x^4 + x^3 - x + 1) *(100*x^10 + 10*x^5 + 1)).
a(n) = 1001*a(n-15) - 1000*a(n-30). (End)
From Karl-Heinz Hofmann, Nov 11 2023: (Start)
a(n) = A010785(floor((n-1)/15)*27 + ((n-1) mod 15)*3) iff (n-1 <= 6 (mod 15)).
a(n) = A010785(floor((n-1)/15)*27 + ((n-1) mod 15) + 12) iff (n-1 > 6 (mod 15)).
(End)

Extensions

Name clarified by Felix Fröhlich, Jun 01 2018

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.