login
This site is supported by donations 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

Robert Israel, Table of n, a(n) for n = 1..10000

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 *)

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 * A081622 A064143 A283593

Adjacent sequences:  A284627 A284628 A284629 * A284631 A284632 A284633

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 25 04:50 EDT 2019. Contains 323539 sequences. (Running on oeis4.)