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.

A362698 For n > 1, if n appears in the sequence, a(n) = a(n-1) - n if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + n. Otherwise a(n+1) = a(n)/(n+1) if (n+1)|a(n), otherwise a(n)*(n+1), a(1) = 1 and a(2) = 1*2.

This page as a plain text file.
%I A362698 #29 Sep 06 2023 20:58:44
%S A362698 1,2,6,24,120,114,798,6384,57456,574560,6320160,526680,6846840,489060,
%T A362698 32604,521664,8868288,159629184,8401536,168030720,3528645120,
%U A362698 160392960,3689038080,3689038056,92225951400,2397874736400,64742617882800,1812793300718400,52571005720833600
%N A362698 For n > 1, if n appears in the sequence, a(n) = a(n-1) - n if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + n. Otherwise a(n+1) = a(n)/(n+1) if (n+1)|a(n), otherwise a(n)*(n+1), a(1) = 1 and a(2) = 1*2.
%H A362698 Michael De Vlieger, <a href="/A362698/b362698.txt">Table of n, a(n) for n = 1..1996</a>
%H A362698 Michael De Vlieger, <a href="/A362698/a362698.png">Log log scatterplot of log_10 a(n)</a>, n = 2..2^18.
%e A362698 a(2) = 2, as a(1) = 1 and 1 times 2 is 2.
%e A362698 a(6) = 114, as a(3) = 6 = n, thus a(6) = a(5) - 6 =  114.
%e A362698 a(7) = 798, as a(6) = 114 and 7 times 114 is 798.
%t A362698 nn = 120; c[_] := False; Array[Set[{a[#], c[#]}, {#, True}] &, 2]; j = 2; Do[k = If[c[n], If[And[! c[#], # >= 0], #, j + n] &[j - n], If[Divisible[j, n], j/n, j n]]; Set[{a[n], c[k], j}, {k, True, k}], {n, 3, nn}]; Array[a, nn] (* _Michael De Vlieger_, Aug 30 2023 *)
%Y A362698 Cf. A008336, A362332, A340612.
%K A362698 nonn
%O A362698 1,2
%A A362698 _Kelvin Voskuijl_, Jul 07 2023
%E A362698 More terms from _Michael De Vlieger_, Aug 30 2023