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.

A099427 a(1) = 1; for n > 1, a(n) = 1 + greatest common divisor of n and a(n-1).

This page as a plain text file.
%I A099427 #20 Jan 10 2017 19:15:55
%S A099427 1,2,2,3,2,3,2,3,4,3,2,3,2,3,4,5,2,3,2,3,4,3,2,3,2,3,4,5,2,3,2,3,4,3,
%T A099427 2,3,2,3,4,5,2,3,2,3,4,3,2,3,2,3,4,5,2,3,2,3,4,3,2,3,2,3,4,5,6,7,2,3,
%U A099427 4,3,2,3,2,3,4,5,2,3,2,3,4,3,2,3,2,3,4,5,2,3,2,3,4,3,2,3,2,3,4,5,2,3,2,3,4
%N A099427 a(1) = 1; for n > 1, a(n) = 1 + greatest common divisor of n and a(n-1).
%C A099427 a(A060401(n)) = n + 1; a(A192489(n)) = 2. - _Reinhard Zumkeller_, Jul 02 2011
%C A099427 For n >= 3, a(n) == n+1 (mod 2). - _Robert Israel_, Jan 10 2017
%H A099427 Reinhard Zumkeller, <a href="/A099427/b099427.txt">Table of n, a(n) for n = 1..10000</a>
%e A099427 a(9)=4 because 1+gcd(a(8),9)=1+gcd(3,9)=1+3.
%p A099427 f:= proc(n) option remember; 1 + igcd(n,procname(n-1)) end proc:
%p A099427 f(1):= 1:
%p A099427 map(f, [$1..1000]); # _Robert Israel_, Jan 10 2017
%t A099427 a[1] = 1; a[n_] := a[n] = GCD[n, a[n - 1]] + 1; Table[ a[n], {n, 105}] (* _Robert G. Wilson v_, Nov 18 2004 *)
%t A099427 nxt[{n_,a_}]:={n+1,GCD[n+1,a]+1}; Transpose[NestList[nxt,{1,1},110]] [[2]] (* _Harvey P. Dale_, Nov 22 2014 *)
%o A099427 (Haskell)
%o A099427 a099427 n = a099427_list !! (n-1)
%o A099427 a099427_list = 1 : map (+ 1) (zipWith gcd [2..] a099427_list)
%o A099427 -- _Reinhard Zumkeller_, Jun 23 2015, Jul 02 2011
%Y A099427 For position of first occurrence of n see A060401.
%K A099427 easy,nonn,nice
%O A099427 1,2
%A A099427 Gaetan Polard (gaetan27(AT)hotmail.com), Nov 18 2004
%E A099427 Edited and extended by _Robert G. Wilson v_, Nov 18 2004