|
|
A366836
|
|
a(1) = 1 and a(n) = prime(a(n-1)+n) mod (a(n-1)+n).
|
|
0
|
|
|
1, 2, 1, 1, 1, 3, 9, 8, 8, 7, 7, 10, 14, 23, 11, 22, 11, 22, 15, 9, 23, 17, 13, 9, 3, 22, 31, 41, 69, 28, 41, 2, 9, 19, 35, 69, 47, 14, 29, 2, 19, 39, 11, 37, 11, 41, 17, 53, 47, 24, 4, 39, 19, 2, 41, 24, 14, 71, 83, 108, 164, 73, 89, 118, 178, 85, 121, 184, 89, 142, 25, 24, 24
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
In each step we take the (a(n-1)+n)th prime and we find the remainder when we divide it with a(n-1)+n.
If we examine the plot, we notice some rectangles and we get the same fractal pattern every time we scale ~2.4 times. Why does this happen? (See Angelini's link).
|
|
LINKS
|
|
|
FORMULA
|
a(1) = 1, a(n) = prime(a(n-1)+n) mod (a(n-1)+n).
|
|
EXAMPLE
|
a(2) = 2 because a(1) = 1 and prime(1+2) mod (1+2) is 5 mod 3.
a(7) = 9 because a(6) = 3 and prime(3+7) mod (3+7) is 29 mod 10.
|
|
MATHEMATICA
|
a[1] = 1;
a[n_] := a[n] = Mod[Prime[a[n - 1] + n], a[n - 1] + n]; Array[a, 100]
|
|
PROG
|
(PARI) a(n) = if (n==1, 1, my(x=a(n-1)+n); prime(x) % x); \\ Michel Marcus, Oct 29 2023
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|