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!)
A175459 a(1)=4. a(n) = a(n-1) + n, if a(n-1)+n is composite. Otherwise a(n) = a(n-1)*n. 1

%I #14 Aug 11 2019 13:23:38

%S 4,6,9,36,180,186,1302,1310,11790,11800,11811,11823,11836,11850,11865,

%T 11881,11898,11916,11935,11955,11976,11998,12021,12045,12070,12096,

%U 12123,12151,12180,12210,378510,378542,378575,378609,378644,378680

%N a(1)=4. a(n) = a(n-1) + n, if a(n-1)+n is composite. Otherwise a(n) = a(n-1)*n.

%C Each term is composite.

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

%p A175459 := proc(n) option remember; if n =1 then 4; else if isprime( procname(n-1)+n) then procname(n-1)*n; else procname(n-1)+n ; end if; end if; end proc:

%p seq(A175459(n),n=1..120) ; # _R. J. Mathar_, May 28 2010

%t nxt[{n_,a_}]:={n+1,If[CompositeQ[a+n+1],a+n+1,a(n+1)]}; NestList[nxt,{1,4},40][[All,2]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Aug 11 2019 *)

%K nonn

%O 1,1

%A _Leroy Quet_, May 20 2010

%E More terms from _R. J. Mathar_, May 28 2010

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 July 20 01:41 EDT 2024. Contains 374441 sequences. (Running on oeis4.)