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.

A022831 a(n) = c(1)p(1) + ... + c(n)p(n), where c(i) = 1 if a(i-1) <= p(i) and c(i) = -1 if a(i-1) > p(i), for i = 1,...,n (p(i) = primes).

This page as a plain text file.
%I A022831 #36 May 22 2019 06:26:37
%S A022831 2,5,10,3,14,1,18,37,14,43,12,49,8,51,4,57,116,55,122,51,124,45,128,
%T A022831 39,136,35,138,31,140,27,154,23,160,21,170,19,176,13,180,7,186,5,196,
%U A022831 3,200,1,212,435,208,437,204,443,202,453,196,459,190,461,184
%N A022831 a(n) = c(1)p(1) + ... + c(n)p(n), where c(i) = 1 if a(i-1) <= p(i) and c(i) = -1 if a(i-1) > p(i), for i = 1,...,n (p(i) = primes).
%C A022831 a(n) <= 2*prime(n). Conjecture: every number occurs in the sequence at most finitely many times. - _Thomas Ordowski_, Dec 03 2016
%H A022831 Reinhard Zumkeller, <a href="/A022831/b022831.txt">Table of n, a(n) for n = 1..10000</a>
%H A022831 <a href="/index/Rea#Recaman">Index entries for sequences related to Recamán's sequence</a>
%e A022831 a(1)=2, a(2)=2+3=5, a(3)=5+5=10, a(4)=10-7=3, a(5)=3+11=14, a(6)=14-13=1, ...
%o A022831 (Haskell)
%o A022831 a022831 n = a022831_list !! n
%o A022831 a022831_list = 2 : f 2 (tail a000040_list) where
%o A022831    f x (p:ps) | x' > 0    = x' : f x' ps
%o A022831               | otherwise = xp : f xp ps where x' = x - p; xp = x + p
%o A022831 -- _Reinhard Zumkeller_, Apr 26 2012
%Y A022831 Cf. A064365.
%K A022831 nonn
%O A022831 1,1
%A A022831 _Clark Kimberling_
%E A022831 Name corrected by _Sean A. Irvine_, May 22 2019