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!)
A083743 a(1) = 1; if a(n-1) + n is prime then a(n) = a(n-1) + n, else a(n) = a(n-1). 3
1, 3, 3, 7, 7, 13, 13, 13, 13, 23, 23, 23, 23, 37, 37, 53, 53, 71, 71, 71, 71, 71, 71, 71, 71, 97, 97, 97, 97, 127, 127, 127, 127, 127, 127, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 211, 211, 211, 211, 263, 263, 317, 317, 373, 373, 431, 431, 491 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
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)+n) else RETURN(a(n-1)) fi: end: for n from 1 to 100 do printf(`%d, `, a(n)) od: # James A. Sellers, May 19 2003
MATHEMATICA
a083743[n_] := Block[{i, t = Table[1, {n}]},
For[i = 1, i < n,
If[PrimeQ[t[[i - 1]] + i], t[[i]] = t[[i - 1]] + i,
t[[i]] = t[[i - 1]]], i++]; t]; a083743[60] (* Michael De Vlieger, Dec 24 2014 *)
nxt[{n_, a_}]:={n+1, If[PrimeQ[a+n+1], a+n+1, a]}; NestList[nxt, {1, 1}, 60][[All, 2]] (* Harvey P. Dale, Apr 28 2018 *)
CROSSREFS
Sequence in context: A326936 A336416 A128508 * A126990 A128498 A146906
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 August 22 04:18 EDT 2024. Contains 375356 sequences. (Running on oeis4.)