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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
More terms from David W. Wilson
STATUS
approved
