|
|
A343026
|
|
a(n) is the smallest positive integer such that there exists no positive integer k with 2k < n where a(n-2k)*a(n-k)=a(n).
|
|
1
|
|
|
1, 1, 2, 1, 1, 2, 3, 3, 2, 1, 1, 2, 1, 1, 2, 3, 3, 2, 4, 4, 2, 4, 4, 2, 3, 3, 2, 1, 1, 2, 1, 1, 2, 3, 3, 2, 1, 1, 2, 1, 1, 2, 3, 3, 2, 4, 4, 2, 4, 4, 2, 3, 3, 2, 5, 5, 2, 5, 5, 2, 3, 3, 2, 5, 5, 2, 5, 5, 2, 3, 3, 2, 4, 4, 2, 4, 4, 2, 3, 3
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
EXAMPLE
|
a(1) = 1, a(2) = 1, but a(3) != 1 because if a(3) = 1, a(1)*a(2)=a(3). Therefore, a(3) = 2, and so on.
|
|
PROG
|
(Python)
#generates first x digits of sequence
def seq(x):
a = []
excluded = {}
for n in range(x):
if n == 0 or n == 1:
a.append(1)
else:
m = 1
while m in excluded[n]:
m += 1
a.append(m)
for i in range(n):
j = 2 * n - i
k = a[i] * a[n]
if j in excluded and k not in excluded[j]:
excluded[j].append(k)
else:
excluded[j] = [k]
return a
(PARI) isok(v, n, j) = {for (k=1, n, if (n-2*k<=0, break); if (v[n-2*k]*v[n-k] == j, return (0)); ); return (1); }
nextv(v, n) = {my(j=1); while (!isok(v, n, j), j++); j; }
lista(nn) = {my(v = vector(nn)); v[1] = 1; for (n=2, nn, v[n] = nextv(v, n); ); v; } \\ Michel Marcus, Apr 04 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|