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.

A333262 Number of steps to reach 1 by iterating the alternating sum of divisors function A071324 starting from n.

Original entry on oeis.org

0, 1, 2, 3, 4, 4, 5, 5, 6, 5, 6, 6, 7, 6, 7, 7, 8, 8, 9, 7, 8, 7, 8, 8, 9, 7, 8, 9, 10, 8, 9, 9, 9, 9, 10, 10, 11, 8, 10, 9, 10, 10, 11, 9, 11, 9, 10, 10, 12, 10, 11, 11, 12, 10, 11, 9, 10, 9, 10, 10, 11, 10, 10, 12, 10, 11, 12, 11, 11, 11, 12, 13, 14, 9, 11, 11
Offset: 1

Views

Author

Amiram Eldar, Mar 13 2020

Keywords

Examples

			a(3) = 2 since it takes 2 iterations of A071324 to reach from 3 to 1: 3 -> 2 -> 1.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Plus @@ (-(d = Divisors[n])*(-1)^(Range[Length[d],1,-1])); a[n_] := Length @ FixedPointList[f,n] - 2; Array[a, 100]

Formula

a(n) = 0 if n = 1 and a(n) = a(A071324(n)) + 1 otherwise.