

A284630


a(1)=1, a(2)=2; for n > 1, a(n+1) = (a(n1) 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[n2] mod (n1)) + n1 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, (n1) + a(n2) % (n1)); \\ 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



