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.
%I A022836 #24 Nov 14 2019 10:45:10 %S A022836 1,3,6,1,8,19,6,23,4,27,56,25,62,21,64,17,70,11,72,5,76,3,82,165,76, %T A022836 173,72,175,68,177,64,191,60,197,58,207,56,213,50,217,44,223,42,233, %U A022836 40,237,38,249,26,253,24,257,18,259,8,265,2,271,542,265,546,263,556 %N A022836 a(n) = c(1)*p(0) + ... + c(n)*p(n-1), where c(i) = 1 if a(i-1) <= p(i-1) and c(i) = -1 if a(i-1) > p(i-1) (with p(0) = 1 and p(i) a prime for i >= 1). %C A022836 Alternate description: a(1) = 1, a(n) = a(n-1) - prime(n) if a(n-1) > prime(n) else a(n) = a(n-1) + prime(n). - _Amarnath Murthy_ and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 27 2003 %H A022836 Harvey P. Dale, <a href="/A022836/b022836.txt">Table of n, a(n) for n = 0..1000</a> %F A022836 a(n) = A008348(n) + 1. %t A022836 nxt[{n_,a_}]:=Module[{p=Prime[n]},{n+1,If[a>p,a-p,a+p]}]; NestList[ nxt,{1,1},70][[All,2]] (* _Harvey P. Dale_, Nov 27 2016 *) %K A022836 nonn %O A022836 0,2 %A A022836 _Clark Kimberling_ %E A022836 Name corrected by _Sean A. Irvine_, May 22 2019