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.

A337903 a(0) = 0, a(1) = 1; for n>1, if a(n-1) is composite then a(n) = a(n-1)/A107286(n-1), where A107286(n) = the smallest prime factor of n, otherwise a(n) = a(n-1) + n.

Original entry on oeis.org

0, 1, 3, 6, 3, 8, 4, 2, 10, 5, 15, 5, 17, 30, 15, 5, 21, 7, 25, 5, 25, 5, 27, 9, 3, 28, 14, 7, 35, 7, 37, 68, 34, 17, 51, 17, 53, 90, 45, 15, 5, 46, 23, 66, 33, 11, 57, 19, 67, 116, 58, 29, 81, 27, 9, 3, 59, 116, 58, 29, 89, 150, 75, 25, 5, 70, 35, 7, 75, 25, 5, 76, 38, 19, 93, 31, 107, 184, 92
Offset: 0

Views

Author

Scott R. Shannon, Sep 29 2020

Keywords

Comments

The sequence can only increase for two consecutive terms at most as if a(n) is even then a(n+1) will be a(n)/2, while if a(n) is odd and a(n+1) is prime then a(n+2) will be even and thus a(n+3) = a(n+2)/2.
For the first 100 million terms the lowest number not to have appeared is 888. It is likely all numbers eventually appear although this is unknown.

Examples

			a(3) = 6 as a(2) = 3 which is prime thus a(3) = 3 + 3 = 6.
a(4) = 3 as a(3) = 6 which has the smallest divisor 2 thus a(4) = 6/2 = 3.
a(11) = 5 as a(10) = 15 which has the smallest divisor 3 thus a(11) = 15/3 = 5.
		

Crossrefs

Programs

  • Mathematica
    a[0] = 0;  a[1] = 1; a[n_] := a[n] = If[CompositeQ[a[n - 1]], a[n - 1]/FactorInteger[a[n - 1]][[1, 1]], a[n - 1] + n]; Array[a, 100, 0] (* Amiram Eldar, Sep 30 2020 *)