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.
%I A305322 #99 Jan 16 2024 05:10:15 %S A305322 0,3,6,9,33,66,99,111,222,333,444,555,666,777,888,999,3333,6666,9999, %T A305322 33333,66666,99999,111111,222222,333333,444444,555555,666666,777777, %U A305322 888888,999999,3333333,6666666,9999999,33333333,66666666,99999999,111111111,222222222 %N A305322 Repdigit numbers that are divisible by 3. %C A305322 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 %C A305322 Repdigit remainders A010785(k) mod 3 have period 27. - _Karl-Heinz Hofmann_, Nov 11 2023 %H A305322 Robert Israel, <a href="/A305322/b305322.txt">Table of n, a(n) for n = 1..4996</a> %H A305322 <a href="/index/Rec#order_30">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,0,0,0,0,0,0,0,0,1001,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1000). %F A305322 From _Alois P. Heinz_, May 30 2018: (Start) %F A305322 { A008585 } intersect { A010785 }. %F A305322 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)). %F A305322 a(n) = 1001*a(n-15) - 1000*a(n-30). (End) %F A305322 From _Karl-Heinz Hofmann_, Nov 11 2023: (Start) %F A305322 a(n) = A010785(floor((n-1)/15)*27 + ((n-1) mod 15)*3) iff (n-1 <= 6 (mod 15)). %F A305322 a(n) = A010785(floor((n-1)/15)*27 + ((n-1) mod 15) + 12) iff (n-1 > 6 (mod 15)). %F A305322 (End) %e A305322 111 / 3 = 37; %e A305322 222 / 3 = 74; %e A305322 333 / 3 = 111; %e A305322 444 / 3 = 148; %e A305322 555 / 3 = 185. %p A305322 L:= proc(d) if d mod 3 = 0 then [$1..9] else [3,6,9] fi end proc: %p A305322 0,seq(seq((10^d-1)/9*k,k=L(d)),d=1..9); # _Robert Israel_, Jun 01 2018 %o A305322 (Python) %o A305322 def A010785(n): return (n - 9*((n-1)//9))*(10**((n+8)//9) - 1)//9 %o A305322 def A305322(n): %o A305322 d0, d1 = divmod(n-1,15) %o A305322 if d1 < 7: return A010785(d0 * 27 + d1 * 3) %o A305322 return A010785(d0 * 27 + d1 + 12) # _Karl-Heinz Hofmann_, Nov 26 2023 %Y A305322 Cf. A008585, A010785. %Y A305322 Cf. A002279 (divisor 5), A366596 (divisor 7), A083118 (the impossible divisors). %K A305322 nonn,base,easy %O A305322 1,2 %A A305322 _Kritsada Moomuang_, May 30 2018 %E A305322 Name clarified by _Felix Fröhlich_, Jun 01 2018