login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A166944 a(1)=2; a(n) = a(n-1) + gcd(n, a(n-1)) if n is even, a(n) = a(n-1) + gcd(n-2, a(n-1)) if n is odd. 12

%I #20 Apr 01 2019 03:01:30

%S 2,4,5,6,9,12,13,14,21,22,23,24,25,26,39,40,45,54,55,60,61,62,63,66,

%T 67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,129,130,

%U 135,138,139,140,147,148,149,150,151,152,153,154,155,160,161,162,163

%N a(1)=2; a(n) = a(n-1) + gcd(n, a(n-1)) if n is even, a(n) = a(n-1) + gcd(n-2, a(n-1)) if n is odd.

%C Conjecture: Every record of differences a(n)-a(n-1) more than 5 is the greater of twin primes (A006512).

%H Harvey P. Dale, <a href="/A166944/b166944.txt">Table of n, a(n) for n = 1..1000</a>

%H 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, Vol.11(2008), Article 08.2.8. arXiv:<a href="https://arxiv.org/abs/0710.3217">0710.3217</a> [math.NT]

%H V. 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. - _Vladimir Shevelev_, Oct 27 2009

%H V. Shevelev, <a href="https://arxiv.org/abs/0911.5478">Three theorems on twin primes</a>, arXiv:0911.5478 [math.NT], 2009-2010. - _Vladimir Shevelev_, Dec 03 2009

%p A166944 := proc(n) option remember; if n = 1 then 2; else p := procname(n-1) ; if type(n,'even') then p+igcd(n,p) ; else p+igcd(n-2,p) ; end if; end if; end proc: # _R. J. Mathar_, Sep 03 2011

%t nxt[{n_,a_}]:={n+1,If[OddQ[n],a+GCD[n+1,a],a+GCD[n-1,a]]}; Transpose[ NestList[ nxt,{1,2},70]][[2]] (* _Harvey P. Dale_, Feb 10 2015 *)

%o (PARI) print1(a=2); for(n=2, 100, d=gcd(a, if(n%2, n-2, n)); print1(", "a+=d)) \\ _Charles R Greathouse IV_, Oct 13 2017

%Y Cf. A084662, A084663, A106108, A132199, A134162, A135506, A135508, A118679, A120293.

%K nonn

%O 1,1

%A _Vladimir Shevelev_, Oct 24 2009

%E Terms beginning with a(18) corrected by _Vladimir Shevelev_, Nov 10 2009

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 04:56 EDT 2024. Contains 371767 sequences. (Running on oeis4.)