cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A364929 a(0) = 0; for n > 0, if n appears in the sequence then a(n) is the product of the indices of all previous appearances of n. Otherwise a(n) = a(n-1) - n if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + n.

This page as a plain text file.
%I A364929 #112 Jan 31 2024 11:33:00
%S A364929 0,1,3,2,6,11,4,11,19,10,9,35,23,36,22,7,23,40,58,8,28,49,14,192,168,
%T A364929 143,117,90,20,49,79,48,16,49,15,11,13,50,12,51,17,58,100,57,101,56,
%U A364929 102,55,31,20097,37,39,91,38,92,47,45,43,738,679,619,558,496,433,369
%N A364929 a(0) = 0; for n > 0, if n appears in the sequence then a(n) is the product of the indices of all previous appearances of n. Otherwise a(n) = a(n-1) - n if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + n.
%H A364929 Michael S. Branicky, <a href="/A364929/b364929.txt">Table of n, a(n) for n = 0..10000</a>
%H A364929 David A. Corneth, <a href="/A364929/a364929.gp.txt">PARI program</a>
%e A364929 a(2) = 3 = n, thus a(3) = 2.
%e A364929 a(5) = 11, as 5 has not previously appeared in the sequence, but a(4) - 5 = 1 has, thus a(5) = a(4) + 5 = 6 + 5 = 11.
%e A364929 a(5) and a(7) = 11, and 5 * 7 = 35, thus a(11) = 35.
%o A364929 (PARI) See PARI link
%o A364929 (Python)
%o A364929 from itertools import count, islice
%o A364929 def agen(): # generator of terms
%o A364929     an, p = 0, {0: 0} # data list, map of product of indices
%o A364929     for n in count(1):
%o A364929         yield an
%o A364929         an = p[n] if n in p else an+n if an-n < 0 or an-n in p else an-n
%o A364929         p[an] = p[an]*n if an in p else n
%o A364929 print(list(islice(agen(), 65))) # _Michael S. Branicky_, Dec 09 2023
%Y A364929 Cf. A005132, A340612, A362373.
%K A364929 nonn
%O A364929 0,3
%A A364929 _Kelvin Voskuijl_, Dec 05 2023
%E A364929 More terms from _David A. Corneth_, Dec 09 2023