login
A029448
Numbers k that divide the (right) concatenation of all numbers <= k written in base 3 (most significant digit on left).
1
1, 3, 4, 9, 12, 27, 72, 81, 104, 216, 219, 243, 324, 729, 756, 972, 2187, 3888, 3921, 6561, 9477, 11664, 16848, 19683, 21156, 22599, 26244, 26811, 29245, 30132, 32805, 37665, 38788, 39852, 40905, 45756, 46965, 47871, 59049, 78732, 80676, 82380, 90396, 91740, 92340
OFFSET
1,2
COMMENTS
Includes all powers of 3. - Robert Israel, Nov 06 2025
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..125 (terms 1..79 from Jianing Song; terms 1..71 from Robert Israel)
MAPLE
c:= 1: R:= 1: count:= 1:
for k from 2 while count < 50 do
c:= c * 3^(1+ilog[3](k)) + k;
if c mod k = 0 then R:= R, k; count:= count+1 fi
od;
R; # Robert Israel, Nov 06 2025
MATHEMATICA
b = 3; c = {}; Select[Range[10^4], Divisible[FromDigits[c = Join[c, IntegerDigits[#, b]], b], #] &] (* Robert Price, Mar 10 2020 *)
PROG
(PARI) c=0; for(d=1, 3^15, for(n=d, -1+d*=3, (c=c*d+n)%n || print1(n", ")); d--) \\ Jianing Song, Apr 26 2026, copied from M. F. Hasler's program in A029455
(Python)
def ok(k): return concat_mod(3, k, k) == 0 # uses concat_mod by Jason Yuen in A029455
print([k for k in range(1, 10**5) if ok(k)]) # Michael S. Branicky, Apr 26 2026
KEYWORD
nonn,base
EXTENSIONS
More terms from David W. Wilson
STATUS
approved