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!)
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
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 *)
nxt[{n_, a_}]:={n+1, If[CompositeQ[a+n+1], a+n+1, a]}; NestList[nxt, {1, 1}, 60][[All, 2]] (* Harvey P. Dale, Oct 09 2019 *)
CROSSREFS
Cf. A083743.
Sequence in context: A316316 A333288 A159786 * A255992 A273572 A273779
KEYWORD
easy,nonn
AUTHOR
Amarnath Murthy, May 05 2003
EXTENSIONS
More terms from James A. Sellers, May 19 2003
STATUS
approved

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 23 08:33 EDT 2024. Contains 371905 sequences. (Running on oeis4.)