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.

A062039 a(0) = 1; a(n+1) = a(n) - n if a(n) > n, otherwise a(n+1) = a(n) + a(a(n)).

This page as a plain text file.
%I A062039 #19 Aug 03 2014 16:52:44
%S A062039 1,1,2,4,1,2,4,5,7,12,3,7,12,24,11,18,3,7,12,24,5,7,12,24,1,2,4,5,7,
%T A062039 12,24,25,27,32,59,25,27,32,59,21,28,35,60,18,30,54,9,21,28,35,60,10,
%U A062039 13,37,69,15,33,65,8,15,33,65,4,5,7,12,24,25,27,32,59,74,3,7,12,24,25,27
%N A062039 a(0) = 1; a(n+1) = a(n) - n if a(n) > n, otherwise a(n+1) = a(n) + a(a(n)).
%C A062039 a(A193854(n)) = 1, n>0;
%C A062039 A123643 and A123644 give record values and their positions: A123643(n)=a(A123644(n)). - _Reinhard Zumkeller_, Oct 04 2006
%H A062039 R. Zumkeller, <a href="/A062039/b062039.txt">Table of n, a(n) for n = 0..10000</a>
%t A062039 a[0] = 1; a[n_] := a[n] = If[a[n-1] > n-1, a[n-1] - (n-1), a[n-1] + a[a[n-1]]]; Table[a[n], {n, 0, 77}] (* _Jean-François Alcover_, Mar 20 2011 *)
%o A062039 (Haskell)
%o A062039 a062039 n = a062039_list !! n
%o A062039 a062039_list = 1 : f 1 0 where
%o A062039    f x n | x > n     = (x-n) : f (x-n) (n+1)
%o A062039          | otherwise =    x' : f x' (n+1) where x' = x + a062039 x
%o A062039 -- _Reinhard Zumkeller_, Aug 10 2011
%Y A062039 A123643 and A123644 give record values and their positions: A123643(n)=a(A123644(n)).
%Y A062039 Cf. A193926 (first differences), A193927.
%K A062039 easy,nice,nonn
%O A062039 0,3
%A A062039 _Reinhard Zumkeller_, Jul 12 2001