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!)
A084663 a(1) = 8; a(n) = a(n-1) + gcd(a(n-1), n). 22

%I #24 Mar 23 2023 03:45:26

%S 8,10,11,12,13,14,21,22,23,24,25,26,39,40,45,46,47,48,49,50,51,52,53,

%T 54,55,56,57,58,87,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,

%U 105,106,107,108,109,110,111,112,113,114,115,116,117,118,177,180,181,182,189,190

%N a(1) = 8; a(n) = a(n-1) + gcd(a(n-1), n).

%C The first 150000000 differences are all primes or 1. Is this true in general?

%D Eric S. Rowland, A simple prime-generating recurrence, Abstracts Amer. Math. Soc., 29 (No. 1, 2008), p. 50 (Abstract 1035-11-986).

%H Indranil Ghosh, <a href="/A084663/b084663.txt">Table of n, a(n) for n = 1..50000</a>

%H Eric S. Rowland, <a href="https://arxiv.org/abs/0710.3217">A natural prime-generating recurrence</a>, arXiv:0710.3217 [math.NT], 2007-2008.

%H E. S. Rowland, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL11/Rowland/rowland21.html">A natural prime-generating recurrence</a>, JIS 11 (2008) 08.2.8.

%p S := 8; f := proc(n) option remember; global S; if n=1 then S else f(n-1)+igcd(n,f(n-1)); fi; end;

%t a[n_]:= a[n]= If[n==1,8, a[n-1] + GCD[n, a[n-1]]]; Table[a[n], {n,70}]

%t RecurrenceTable[{a[1]==8,a[n]==a[n-1]+GCD[a[n-1],n]},a,{n,70}] (* _Harvey P. Dale_, Apr 12 2016 *)

%o (Haskell)

%o a084663 n = a084663_list !! (n-1)

%o a084663_list =

%o 8 : zipWith (+) a084663_list (zipWith gcd a084663_list [2..])

%o -- _Reinhard Zumkeller_, Nov 15 2013

%o (SageMath)

%o @CachedFunction

%o def a(n): # a = A084663

%o if (n==1): return 8

%o else: return a(n-1) + gcd(a(n-1), n)

%o [a(n) for n in range(1, 71)] # _G. C. Greubel_, Mar 22 2023

%Y Cf. A084662, A106108.

%Y Cf. A230504, A134744 (first differences), A134736.

%K nonn

%O 1,1

%A Matthew Frank (mfrank(AT)wopr.wolfram.com) on behalf of the 2003 New Kind of Science Summer School, Jul 15 2003

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 19 21:09 EDT 2024. Contains 371798 sequences. (Running on oeis4.)