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.

Showing 1-3 of 3 results.

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

A341691 a(0) = 0, and for any n > 0, a(n) = n - a(k) where k is the greatest number < n such that n AND a(k) = a(k) (where AND denotes the bitwise AND operator).

Original entry on oeis.org

0, 1, 2, 1, 4, 1, 2, 5, 8, 1, 2, 9, 4, 9, 10, 5, 16, 1, 2, 17, 4, 17, 18, 5, 8, 17, 18, 9, 20, 9, 10, 21, 32, 1, 2, 33, 4, 33, 34, 5, 8, 33, 34, 9, 36, 9, 10, 37, 16, 33, 34, 17, 36, 17, 18, 37, 40, 17, 18, 41, 20, 41, 42, 21, 64, 1, 2, 65, 4, 65, 66, 5, 8, 65
Offset: 0

Views

Author

Rémy Sigrist, Feb 17 2021

Keywords

Comments

This sequence is a binary variant of A341679; here we look for a term whose binary 1's match those of n, there we look for a term that divides n.

Examples

			The first terms, alongside the corresponding value of k, are:
  n   a(n)  k
  --  ----  ---
   0     0  N/A
   1     1    0
   2     2    0
   3     1    2
   4     4    0
   5     1    4
   6     2    4
   7     5    6
   8     8    0
   9     1    8
		

Crossrefs

Programs

  • C
    See Links section.

Formula

a(n) = n iff n = 0 or n is a power of 2.
a(2*n) = 2*a(n).
Apparently, a(n) = n - a(n - A006519(n)).

A348285 a(1) = 2; for n > 1, let a(k) be a divisor > 1 of n appearing in all previous terms where k is as large as possible. Then a(n) = n - k. If no such k exists then a(n) = n - m, where a(m) = 1 and m is as large as possible.

Original entry on oeis.org

2, 1, 1, 3, 2, 1, 1, 3, 1, 5, 2, 1, 1, 3, 1, 5, 2, 1, 1, 3, 1, 5, 2, 1, 3, 3, 1, 5, 2, 1, 1, 3, 1, 5, 1, 4, 2, 1, 7, 3, 3, 1, 1, 7, 4, 9, 4, 1, 5, 1, 10, 5, 3, 1, 3, 9, 2, 1, 1, 3, 2, 1, 3, 3, 13, 2, 5, 2, 5, 1, 1, 4, 2, 1, 6, 3, 33, 2, 5, 1, 5, 4, 3, 1, 4, 8, 4, 1, 1, 7, 1, 5, 10, 16, 3, 1
Offset: 1

Views

Author

Scott R. Shannon, Oct 09 2021

Keywords

Comments

The sequence shows long runs of 2 appearing as every second term separated with larger values, corresponding to the offset for the odd-numbered divisors. These are eventually broken when an even number is divisible by the previous odd-numbered offset term. See the linked image.
The largest value in the first 10^6 terms is 291774, and in the same range the smallest number not yet seen is 2919. It is likely all numbers eventually appear although this is unknown. In the same range, the only composite number whose divisors > 1 have not appeared in the sequence is 121, i.e., 11 has not appeared before a(121), thus a(121) = 1 as a(120) = 1.

Examples

			a(2) = 1 as the last divisor > 1 of 2 so far appearing is a(1) = 2, and that is 2 - 1 = 1 term back from 2.
a(3) = 1 as 3 is prime, thus the offset to the last 1 term, a(2), is 3 - 2 = 1.
a(4) = 3 as the last divisor of 4 > 1 so far appearing is a(1) = 2, and that is 4 - 1 = 3 terms back from 4.
a(6) = 1 as the last divisor of 6 > 1 so far appearing is a(5) = 2, and that is 6 - 5 = 1 term back from 6.
		

Crossrefs

Showing 1-3 of 3 results.