cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A348217 a(1) = 2; for n > 1, let d be the largest divisor of n appearing in all previous terms and k the largest value such that a(k) = d, then a(n) = n - k.

Original entry on oeis.org

2, 1, 1, 3, 2, 2, 4, 1, 5, 1, 1, 5, 2, 1, 3, 9, 3, 2, 5, 1, 4, 4, 3, 2, 6, 2, 11, 6, 9, 2, 11, 10, 2, 1, 16, 7, 3, 5, 2, 8, 7, 1, 1, 13, 16, 7, 4, 3, 3, 18, 2, 8, 10, 4, 24, 4, 8, 7, 16, 7, 18, 11, 34, 5, 21, 4, 24, 5, 20, 17, 28, 5, 30, 23, 3, 10, 15, 34, 36, 11, 52, 31, 40, 13, 15, 35, 12, 8
Offset: 1

Views

Author

Scott R. Shannon, Oct 07 2021

Keywords

Comments

As n increases the terms generally remain scattered between 1 and n - see the linked image. However also present are lines of various gradients along which numerous terms are concentrated. These correspond to the distances back from a(n) to the last appearance of the terms like 1,2,3. These small terms become rare as n increases, e.g., in the first 10 millions terms, a(2849898) = 1 but then 1 does not appear again until a(6839757) = 1. In that range all terms where n is prime will have a(n) = n - 2849898.

Examples

			a(2) = 1 as the largest divisor of 2 so far appearing is 2, and that is 2 - 1 = 1 term back from 2.
a(3) = 1 as the largest divisor of 3 so far appearing is 1, and that is 3 - 2 = 1 term back from 3.
a(4) = 3 as the largest divisor of 4 so far appearing is 2, and that is 4 - 1 = 3 terms back from 4.
a(5) = 2 as the largest divisor of 5 so far appearing is 1, and that is 5 - 3 = 2 terms back from 5.
		

Crossrefs