OFFSET
0,2
COMMENTS
The first a(n) elements include all a(n) residues mod 3^n.
LINKS
Dominic McCarty, Table of n, a(n) for n = 0..1000
PROG
(Python)
a, m, n, i, b = [1, 2, 4], 1, 1, 0, 3
while len(a) <= 100:
while (a[-1]==a[-2] or not all(len(set([x % (b ** j) for x in a])) <= a[j] for j in range(1, len(a)-1))):
i += 1
if (i == len(a)-1):i, m = 0, m+1
a[-1] = (m*(b**n))+a[i]
if (len(a) in a): m, n, i = 1, n+1, 0; a.append((b**n)+1)
else: a.append(a[-1])
a.pop();
def tern(n):
if n == 0: return ""
return tern(n // 3) + str(n % 3)
for k in a: print(tern(k)) # Dominic McCarty, Jan 29 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved