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.

A356427 a(0) = 0, a(1) = 1; for n > 1, a(n) is the last step before reaching 0 of the iterations x -> x - gpf(x) starting at n, where gpf = A006530.

Original entry on oeis.org

0, 1, 2, 3, 2, 5, 3, 7, 3, 3, 5, 11, 3, 13, 7, 5, 7, 17, 5, 19, 5, 7, 11, 23, 7, 5, 13, 7, 7, 29, 5, 31, 5, 11, 17, 7, 11, 37, 19, 13, 7, 41, 7, 43, 11, 7, 23, 47, 7, 7, 7, 17, 13, 53, 17, 11, 7, 19, 29, 59, 11, 61, 31, 7, 31, 13, 11, 67, 17, 23, 7, 71, 23, 73, 37, 7, 19, 11
Offset: 0

Views

Author

Jianing Song, Aug 07 2022

Keywords

Comments

For n > 1, a(n) is the unique prime in the iterations x -> x - gpf(x) starting at n and ending at 0.

Examples

			In the following examples the numbers produced by the iterations are listed together with their GPFs.
48 (3) -> 45 (5) -> 40 (5) -> 35 (7) -> ... -> 7 (7) -> 0, so a(48) = 7.
96 (3) -> 93 (31) -> 62 (31) -> 31 (31) -> 0, so a(96) = 31.
		

Crossrefs

Programs

  • PARI
    a(n) = if(n>1, my(s=n); while(!isprime(s), s=s-vecmax(factor(s)[, 1])); s, n)

Formula

For n > 0, a(n) = gpf(n) if n is in A356438; otherwise a(n) > gpf(n).