|
|
A309023
|
|
For n >= 1, if there exists an m < n such that a(m) = a(n), take the largest such m and set a(n+1) = (n-m)^a(n); otherwise a(n+1) = 0. Start with a(1)=1, a(2)=2.
|
|
0
|
|
|
1, 2, 0, 0, 1, 4, 0, 1, 3, 0, 1, 3, 27, 0, 1, 4, 10000, 0, 1, 4, 256, 0, 1, 4, 256
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
This sequence quickly generates terms of immense size.
Changing what a(n+1) is set to when a new term arises changes the sequence nontrivially.
|
|
LINKS
|
|
|
MATHEMATICA
|
Nest[Function[{a, n}, Append[a, If[Length@ # == 0, 0, (n - #[[-1, 1]])^Last@ a] &@ Position[Most@ a, _?(# == Last@ a &)] ]] @@ {#, Length@ #} &, {1, 2}, 24] (* Michael De Vlieger, Jul 08 2019 *)
|
|
PROG
|
(Python)
def Prog(length):
L = 2
seq = [1, 2]
while L < length:
x = len(seq)-1
while x > 0:
if seq[-1] == seq[x-1]:
m_minus_n = len(seq)-x
a_n = seq[L-1]
seq.append((m_minus_n)**a_n)
x = -1
else:
x -= 1
if x == 0:
seq.append(0)
L += 1
return seq
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|