|
|
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
|
|
|
4, 6, 9, 36, 180, 186, 1302, 1310, 11790, 11800, 11811, 11823, 11836, 11850, 11865, 11881, 11898, 11916, 11935, 11955, 11976, 11998, 12021, 12045, 12070, 12096, 12123, 12151, 12180, 12210, 378510, 378542, 378575, 378609, 378644, 378680
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Each term is composite.
|
|
LINKS
|
|
|
MAPLE
|
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:
|
|
MATHEMATICA
|
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 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|