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.
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
Philip Kalisman, Jul 07 2019
STATUS
approved