login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A366836
a(1) = 1 and a(n) = prime(a(n-1)+n) mod (a(n-1)+n).
1
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
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
Eric Angelini, A fractal sequence by GK, Personal blog "Cinquante signes", Oct 2023.
Eric Angelini, A fractal sequence by GK, Personal blog "Cinquante signes", Oct 2023. [Cached copy]
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
Cf. A004648.
Sequence in context: A279453 A054252 A240472 * A007442 A362483 A054772
KEYWORD
nonn,changed
AUTHOR
STATUS
approved