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 A167197 #27 Jan 20 2024 17:49:22 %S A167197 7,14,16,17,18,19,20,21,28,29,30,31,32,33,34,35,36,37,38,39,52,53,54, %T A167197 55,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81, %U A167197 82,83,84,85,86,87,116,117,120,121,122,123,124,125,126,127,128 %N A167197 a(6) = 7, for n >= 7, a(n) = a(n - 1) + gcd(n, a(n - 1)). %C A167197 For every n >= 7, a(n) - a(n - 1) is 1 or prime. This Rowland-like "generator of primes" is different from A106108 (see comment to A167168) and from A167170. Note that, lim sup a(n) / n = 2, while lim sup A106108(n) / n = lim sup A167170(n) / n = 3. %C A167197 Going up to a million, differences of two consecutive terms of this sequence gives primes about 0.009% of the time. The rest are 1's. [_Alonso del Arte_, Nov 30 2009] %H A167197 G. C. Greubel, <a href="/A167197/b167197.txt">Table of n, a(n) for n = 6..1000</a> %H A167197 E. S. Rowland, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL11/Rowland/rowland21.html">A natural prime-generating recurrence</a>, Journal of Integer Sequences, 11 (2008), Article 08.2.8. %H A167197 Vladimir Shevelev, <a href="https://arxiv.org/abs/0910.4676">An infinite set of generators of primes based on the Rowland idea and conjectures concerning twin primes</a>, arXiv:0910.4676 [math.NT], 2009. %p A167197 A[6]:= 7: %p A167197 for n from 7 to 100 do A[n]:= A[n-1] + igcd(n,A[n-1]) od: %p A167197 seq(A[i],i=6..100); # _Robert Israel_, Jun 05 2016 %t A167197 a[6] = 7; a[n_ /; n > 6] := a[n] = a[n - 1] + GCD[n, a[n - 1]]; Table[a[n], {n, 6, 58}] %o A167197 (Python) %o A167197 from math import gcd %o A167197 def aupton(nn): %o A167197 alst = [7] %o A167197 for n in range(7, nn+1): alst.append(alst[-1] + gcd(n, alst[-1])) %o A167197 return alst %o A167197 print(aupton(68)) # _Michael S. Branicky_, Jul 14 2021 %Y A167197 Cf. A167195, A167170, A167168, A106108, A132199, A167054, A167053, A166944, A166945, A116533, A163961, A163963, A084662, A084663, A134162, A135506, A135508, A118679, A120293. %K A167197 nonn %O A167197 6,1 %A A167197 _Vladimir Shevelev_, Oct 30 2009, Nov 06 2009 %E A167197 Verified and edited by _Alonso del Arte_, Nov 30 2009