A106108 Rowland's prime-generating sequence: a(1) = 7; for n > 1, a(n) = a(n-1) + gcd(n, a(n-1)).
7, 8, 9, 10, 15, 18, 19, 20, 21, 22, 33, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 69, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 141, 144, 145, 150, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168
Offset: 1
Keywords
References
- Eric S. Rowland, A simple prime-generating recurrence, Abstracts Amer. Math. Soc., 29 (No. 1, 2008), p. 50 (Abstract 1035-11-986).
Links
- Indranil Ghosh, Table of n, a(n) for n = 1..25000 (terms 1..1000 from T. D. Noe)
- Fernando Chamizo, Dulcinea Raboso and Serafin Ruiz-Cabello, On Rowland's sequence, Electronic J. Combin., Vol. 18(2), 2011, #P10.
- Brian Hayes, Pumping the Primes, bit-player, 19 August 2015.
- Eric S. Rowland, A simple prime-generating recurrence, arXiv:0710.3217 [math.NT], 2007-2008.
- Eric S. Rowland, Prime-Generating Recurrence, Wolfram Demonstrations Project. - _Robert G. Wilson v_, Sep 10 2008
- Eric S. Rowland, Prime-Generating Recurrences and a Tale of Logarithmic Scale, YouTube video, 2023.
Crossrefs
Programs
-
Haskell
a106108 n = a106108_list !! (n-1) a106108_list = 7 : zipWith (+) a106108_list (zipWith gcd a106108_list [2..]) -- Reinhard Zumkeller, Nov 15 2013
-
Magma
[n le 1 select 7 else Self(n-1) + Gcd(n, Self(n-1)): n in [1..70]]; // Vincenzo Librandi, Jul 19 2015
-
Maple
S:=7; f:= proc(n) option remember; global S; if n=1 then RETURN(S); else RETURN(f(n-1)+gcd(n,f(n-1))); fi; end; [seq(f(n),n=1..200)];
-
Mathematica
a[1] = 7; a[n_] := a[n] = a[n - 1] + GCD[n, a[n - 1]]; Array[a, 66] (* Robert G. Wilson v, Sep 10 2008 *)
-
PARI
a=vector(100);a[1]=7;for(n=2,#a,a[n]=a[n-1]+gcd(n,a[n-1]));a \\ Charles R Greathouse IV, Jul 15 2011
-
Python
from itertools import count, islice from math import gcd def A106108_gen(): # generator of terms yield (a:=7) for n in count(2): yield (a:=a+gcd(a,n)) A106108_list = list(islice(A106108_gen(),20)) # Chai Wah Wu, Mar 14 2023
Comments