A365933 a(n) is the period of the remainders when repdigits are divided by n.
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
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]
Links
- Karl-Heinz Hofmann, Table with additional information.
Crossrefs
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
Comments