%I #69 Feb 10 2024 18:52:47
%S 1,1,1,5,3,1,1,1,1,11,3,1,1,1,1,1,1,1,1,1,1,23,3,1,1,1,1,1,1,1,1,1,1,
%T 1,1,1,1,1,1,1,1,1,1,1,1,47,3,1,5,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
%U 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,101,3,1,1
%N Rowland's prime-generating sequence: first differences of A106108.
%C Rowland shows that the terms are all 1's or primes.
%C The prime terms form A137613.
%C See A137613 for additional comments, links and references. - _Jonathan Sondow_, Aug 14 2008
%C From _Robert G. Wilson v_, Apr 30 2009: (Start)
%C First appearance of k-th prime, k >= 0: 1, 0, 5, 4, 104, 10, 116, 242878, 242819, 22, 243019, 3891770, 242867, ..., .
%C The number of different numbers in the first 10^k terms beginning with k=0: 1, 4, 7, 12, 15, 19, 30, >35, ..., .
%C Record high values are A191304. (End)
%D Eric S. Rowland, A simple prime-generating recurrence, Abstracts Amer. Math. Soc., 29 (No. 1, 2008), p. 50 (Abstract 1035-11-986).
%H Robert G. Wilson v, <a href="/A132199/b132199.txt">Table of n, a(n) for n = 1..10000 </a>.
%H Jean-Paul Delahaye, <a href="https://www.pourlascience.fr/sr/logique-calcul/deconcertantes-conjectures-3819.php">Déconcertantes conjectures</a>, Pour la Science (French edition of Scientific American), No. 367, May 2008.
%H Brian Hayes, <a href="http://bit-player.org/2015/pumping-the-primes">Pumping the Primes</a>, bit-player, 19 August 2015.
%H Eric S. Rowland, <a href="http://arXiv.org/abs/0710.3217">A natural prime-generating recurrence</a>, arXiv:0710.3217 [math.NT], 2007-2008.
%H Eric S. Rowland, <a href="https://ericrowland.github.io/talks/A_simple_prime-generating_recurrence.pdf">A simple prime-generating recurrence</a>, 2008.
%H Eric S. Rowland, <a href="https://youtu.be/OpaKpzMFOpg">Prime-Generating Recurrences and a Tale of Logarithmic Scale</a>, 20 January 2023.
%p A106108 := proc(n)
%p option remember;
%p if n = 1 then
%p 7;
%p else
%p procname(n-1)+igcd(n,procname(n-1)) ;
%p end if;
%p end proc:
%p A132199 := proc(n)
%p A106108(n+1)-A106108(n) ;
%p end proc: # _R. J. Mathar_, Jul 04 2013
%t a[1] = 7; a[n_] := a[n] = a[n - 1] + GCD[n, a[n - 1]]; t = Array[a, 104]; Rest@t - Most@t (* _Robert G. Wilson v_, Apr 30 2009 *)
%o (Haskell)
%o a132199 n = a132199_list !! (n-1)
%o a132199_list = zipWith (-) (tail a106108_list) a106108_list
%o -- _Reinhard Zumkeller_, Nov 15 2013
%o (PARI)
%o ub=1000; a=7; n=2; while(n<ub, d=gcd(n,a); print1(d,", "); a=a+d; n=n+1; ); \\ _Daniel Constantin Mayer_, Aug 31 2014
%o (Python)
%o from itertools import count, islice
%o from math import gcd
%o def A132199_gen(): # generator of terms
%o a = 7
%o for n in count(2):
%o yield (b:=gcd(a,n))
%o a += b
%o A132199_list = list(islice(A132199_gen(),20)) # _Chai Wah Wu_, Mar 14 2023
%Y Cf. A106108, A137613, A134734, A134743, A134744, A191304 (record highs) A247090. See A106108 for other cross-references.
%K nonn
%O 1,4
%A _N. J. A. Sloane_, Jan 28 2008