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!)
A326935 a(1) = 1; a(n) = the largest prime factor of a(n-1) if a(n-1) is a composite number, otherwise a(n)=a(n-1)+n. 2

%I #25 Sep 08 2022 08:46:24

%S 1,3,6,3,8,2,9,3,12,3,14,7,20,5,20,5,22,11,30,5,26,13,36,3,28,7,34,17,

%T 46,23,54,3,36,3,38,19,56,7,46,23,64,2,45,5,50,5,52,13,62,31,82,41,94,

%U 47,102,17,74,37,96,3,64,2,65,13,78,13,80,5,74,37

%N a(1) = 1; a(n) = the largest prime factor of a(n-1) if a(n-1) is a composite number, otherwise a(n)=a(n-1)+n.

%C Will all prime numbers appear in this sequence?

%H Robert Israel, <a href="/A326935/b326935.txt">Table of n, a(n) for n = 1..10000</a>

%e a(5)=8, a(6) = largest prime factor of 8 = 2, a(12)=7, a(13)=7+13=20.

%p f:= proc(n) option remember; local t;

%p t:= procname(n-1);

%p if isprime(t) or (t=1) then t+n else max(numtheory:-factorset(t)) fi

%p end proc:

%p f(1):= 1:

%p map(f, [$1..100]); # _Robert Israel_, Oct 24 2019

%t nxt[{n_,a_}]:={n+1,If[CompositeQ[a],FactorInteger[a][[-1,1]],a+n+1]}; NestList[nxt,{1,1},70][[All,2]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, May 21 2020 *)

%o (Magma) a:=[1,3]; for n in [3..70] do if not IsPrime(a[n-1]) then Append(~a,Max(PrimeDivisors(a[n-1]))); else Append(~a,a[n-1]+n); end if; end for; a; // _Marius A. Burtea_, Oct 24 2019

%K nonn,look

%O 1,2

%A _Ali Sada_, Oct 22 2019

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 September 6 20:19 EDT 2024. Contains 375727 sequences. (Running on oeis4.)