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.

A327159 Size of the cycle containing n in the map x -> usigma(x)-x or 0 if n is not a member of any finite cycle. Here usigma is the sum of unitary divisors of n (A034448).

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Antti Karttunen, Aug 28 2019

Keywords

Examples

			Because A034460(6) = 6, a(6) = 1.
Because A034460(30) = 42, A034460(42) = 54, A034460(54) = 30, a(30) = a(42) = a(54) = 3.
Because A034460(90) = 90, a(90) = 1. Because A034460(78) = 90, a(78) = 0, as even though 78 ends into a cycle of one, it itself is not a part of that cycle.
		

Crossrefs

Cf. A002827 (positions of ones), A063991 (of 2's), A319902 (of 4's), A097024 (of 5's), A319917 (of 6's), A319937 (of 10's), A097030 (of 14's), A327157 (of all nonzero terms).

Programs

  • Mathematica
    a034460[0] = 0; (* avoids dividing by 0 when an iteration reaches 0 *)
    a034460[n_] := Total[Select[Divisors[n], GCD[#, n/#] == 1 &]] - n /; n > 0
    cycleL[k_] := Module[{nL=NestWhileList[a034460, k, UnsameQ, All]}, If[k==Last[nL], Length[nL]-1, 0]]
    a327159[n_] := Map[cycleL, Range[n]]
    a327159[120] (* Hartmut F. W. Hoft, Feb 04 2024 *)
  • PARI
    A034460(n) = (sumdivmult(n, d, if(gcd(d, n/d)==1, d))-n); \\ From A034460
    A327159(n,orgn=n,xs=Set([])) = if(1==n,0,if(vecsearch(xs,n), if(n==orgn,length(xs),0), xs = setunion([n],xs); A327159(A034460(n),orgn,xs)));