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!)
A284630 a(1)=1, a(2)=2; for n > 1, a(n+1) = (a(n-1) mod n) + n. 1
1, 2, 3, 5, 7, 5, 7, 12, 15, 12, 15, 12, 15, 25, 15, 25, 31, 25, 31, 25, 31, 25, 31, 25, 31, 25, 31, 52, 31, 52, 31, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 105, 63, 105, 63, 105, 63, 105, 63, 105, 63, 105, 127, 105, 127, 105, 127, 105, 127, 105, 127, 105, 127, 105, 127, 105, 127, 105 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
a(3) = a(1) (mod 2) + 2 = 3.
MAPLE
A[1]:= 1: A[2]:= 2:
for n from 3 to 200 do A[n]:= (A[n-2] mod (n-1)) + n-1 od:
seq(A[n], n=1..200); # Robert Israel, Apr 04 2017
MATHEMATICA
a[n_] := a[n] = If[n < 3, n, Mod[a[n - 2], n - 1] + n - 1]; Array[a, 80] (* Michael De Vlieger, Apr 02 2017 *)
nxt[{n_, a_, b_}]:={n+1, b, Mod[a, n]+n}; NestList[nxt, {2, 1, 2}, 100][[;; , 2]] (* Harvey P. Dale, Jul 31 2023 *)
PROG
(PARI) a(n) = if (n<=2, n, (n-1) + a(n-2) % (n-1)); \\ Michel Marcus, Apr 02 2017
CROSSREFS
Cf. A003817.
Sequence in context: A126048 A142349 A234316 * A345872 A081622 A064143
KEYWORD
nonn,easy,look
AUTHOR
Thomas Kerscher, Mar 31 2017
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 May 2 12:49 EDT 2024. Contains 372196 sequences. (Running on oeis4.)