|
|
A083744
|
|
a(1) = 1; if a(n-1) + n is composite then a(n) = a(n-1) + n, else a(n) = a(n-1).
|
|
2
|
|
|
1, 1, 4, 8, 8, 14, 21, 21, 30, 40, 51, 63, 76, 90, 105, 121, 138, 156, 175, 195, 216, 238, 261, 285, 310, 336, 363, 391, 420, 450, 481, 513, 546, 580, 615, 651, 688, 726, 765, 805, 846, 888, 931, 975, 1020, 1066, 1113, 1161, 1210, 1260, 1311, 1363, 1416, 1470
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
Michael De Vlieger, Table of n, a(n) for n = 1..10000
|
|
MAPLE
|
a := proc(n) option remember: if n=1 then RETURN(1) fi: if isprime(a(n-1)+n) then RETURN(a(n-1)) else RETURN(a(n-1)+n) fi: end: for n from 1 to 100 do printf(`%d, `, a(n)) od: # James A. Sellers, May 19 2003
|
|
MATHEMATICA
|
a083744[n_] := Block[{i, t = Table[1, {n}]},
For[i = 2, i < n,
If[CompositeQ[t[[i - 1]] + i], t[[i]] = t[[i - 1]] + i,
t[[i]] = t[[i - 1]]], i++]; t]; a083744[54] (* Michael De Vlieger, Dec 24 2014 *)
|
|
CROSSREFS
|
Cf. A083743.
Sequence in context: A014198 A316316 A159786 * A255992 A273572 A273779
Adjacent sequences: A083741 A083742 A083743 * A083745 A083746 A083747
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
Amarnath Murthy, May 05 2003
|
|
EXTENSIONS
|
More terms from James A. Sellers, May 19 2003
|
|
STATUS
|
approved
|
|
|
|