A262922 a(1)=1; for n>1, a(n) = a(n-1) + n + 2 if a(n-1) and n are coprime, otherwise a(n) = a(n-1)/gcd(a(n-1),n).
1, 5, 10, 5, 1, 9, 18, 9, 1, 13, 26, 13, 1, 17, 34, 17, 1, 21, 42, 21, 1, 25, 50, 25, 1, 29, 58, 29, 1, 33, 66, 33, 1, 37, 74, 37, 1, 41, 82, 41, 1, 45, 90, 45, 1, 49, 98, 49, 1, 53, 106, 53, 1, 57, 114, 57, 1, 61, 122, 61, 1, 65, 130, 65, 1, 69, 138, 69, 1, 73, 146, 73, 1, 77, 154, 77, 1, 81, 162
Offset: 1
Keywords
Links
- Benoit Cloitre, 10 conjectures in additive number theory, arXiv:1101.4274 [math.NT], 2011.
- Eric S. Rowland, A natural prime-generating recurrence, arXiv:0710.3217 [math.NT], 2007-2008.
Programs
-
Mathematica
a[1] = 1; a[n_] := a[n] = If[CoprimeQ[a[n - 1], n], a[n - 1] + n + 2, a[n - 1]/GCD[a[n - 1], n]]; Array[a, {79}] (* Michael De Vlieger, Oct 05 2015 *)
-
PARI
A=vector(1000, i, 1); for(n=2, #A, A[n]=if(gcd(A[n-1], n)>1, A[n-1]/gcd(A[n-1], n), A[n-1]+n+2))
Formula
Maple suggests the rational o.g.f. (-x^6 - x^5 - x^3 + 6x^2 + 4x + 1)/((x + 1)(x - 1)^2(x^2 + 1)^2), which should be easy to check. - Pater Bala, Oct 04 2015
Comments