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.

Previous Showing 11-15 of 15 results.

A029908 Starting with n, repeatedly sum prime factors (with multiplicity) until reaching 0 or a fixed point. Then a(n) is the fixed point (or 0).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

That is, the sopfr function (see A001414) applied repeatedly until reaching 0 or a fixed point.
For n > 1, the sequence reaches a fixed point which is either 4 or a prime.
A002217(n) is number of terms in sequence from n to a(n). - Reinhard Zumkeller, Apr 08 2003
Because sopfr(n) <= n (with equality at 4 and the primes), the first appearance of all primes is in the natural order: 2,3,5,7,11,... . - Zak Seidov, Mar 14 2011
The terms 0, 2, 3 and 4 occur exactly once, because no number > 5 can have factors that sum to be < 5, and therefore can never enter a trajectory that will drop below 5. - Christian N. K. Anderson, May 19 2013
For all primes p, where p is contained in A001359, then a(p^2) = p + 2. (A006512). Proof: p^2 has prime factors (p, p). This sums to 2p. 2p has factors (2, p). This sums to p + 2. Since p was the lesser of a twin prime, then p + 2 is the greater of a twin prime. - Ryan Bresler, Nov 04 2021

Examples

			20 -> 2+2+5 = 9 -> 3+3 = 6 -> 2+3 = 5, so a(20)=5.
		

Crossrefs

Cf. A001414 (sum of prime factors of n).

Programs

  • Maple
    f:= proc(n) option remember;
    if isprime(n) then n
    else `procname`(add(x[1]*x[2], x = ifactors(n)[2]))
    fi
    end proc:
    f(1):= 0: f(4):= 4:
    map(f, [$1..100]); # Robert Israel, Apr 27 2015
  • Mathematica
    ffi[x_] := Flatten[FactorInteger[x]] lf[x_] := Length[FactorInteger[x]] ba[x_] := Table[Part[ffi[x], 2*w-1], {w, 1, lf[x]}] ep[x_] := Table[Part[ffi[x], 2*w], {w, 1, lf[x]}] slog[x_] := slog[x_] := Apply[Plus, ba[x]*ep[x]] Table[FixedPoint[slog, w], {w, 1, 128}]
    f[n_] := Plus @@ Flatten[ Table[ #[[1]], {#[[2]]}] & /@ FactorInteger@n]; Array[ FixedPoint[f, # ] &, 87] (* Robert G. Wilson v, Jan 18 2006 *)
    fz[n_]:=Plus@@(#[[1]]*#[[2]]&/@FactorInteger@n); Array[FixedPoint[fz,#]&,1000] (* Zak Seidov, Mar 14 2011 *)
  • Python
    from sympy import factorint
    def a(n, pn):
        if n == pn:
            return n
        else:
            return a(sum(p*e for p, e in factorint(n).items()), n)
    print([a(i, None) for i in range(1, 100)]) # Gleb Ivanov, Nov 05 2021

A082087 a(n) is the fixed point if function A008472 (= sum of prime factors with no repetition) is iterated when started at initial value n!.

Original entry on oeis.org

2, 5, 5, 7, 7, 17, 17, 17, 17, 3, 3, 41, 41, 41, 41, 31, 31, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 5, 5, 7, 7, 7, 7, 7, 7, 197, 197, 197, 197, 2, 2, 281, 281, 281, 281, 43, 43, 43, 43, 43, 43, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, 73, 73, 73, 73, 2, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 13, 13, 13, 13
Offset: 1

Views

Author

Labos Elemer, Apr 09 2003

Keywords

Examples

			n=73: iteration list=
{73!=61234458376886086861524070385274672740778091784697328983823014963978384987221689274204160000000000000000,639,74,39,16,2,2}
		

Crossrefs

Programs

  • Mathematica
    ffi[x_] := Flatten[FactorInteger[x]] lf[x_] := Length[FactorInteger[x]] ba[x_] := Table[Part[ffi[x], 2*w-1], {w, 1, lf[x]}] sopf[x_] := Apply[Plus, ba[x]] Table[FixedPoint[sopf, w! ], {w, 2, 100}]

Formula

a(n) = A075860(A000142(n)).

A082088 a(n) is the fixed point if function A008472[=sum of prime factors with no repetition] is iterated when started at initial value prime[n]!.

Original entry on oeis.org

2, 5, 7, 17, 3, 41, 31, 5, 7, 5, 7, 197, 2, 281, 43, 7, 5, 5, 73, 2, 7, 7, 13, 5, 7, 5, 3, 7, 13, 3, 7, 7, 7, 7, 571, 7, 7, 5, 7, 7, 5, 7, 5, 7, 2, 7, 19, 3, 3, 67, 5, 2, 71, 43, 7, 71, 239, 7, 7, 7699, 2, 5, 313, 8893, 2, 3, 199, 5, 5, 2, 5, 2, 3, 7, 6361, 3, 97, 5, 19, 97, 7, 2593, 5, 5
Offset: 1

Views

Author

Labos Elemer, Apr 09 2003

Keywords

Examples

			n=100,p(100)=541,start at 541! and get iteration list=
{541!,24133} ended immediately in a(100)=24133;
n=99,p(99)-523,start at 523! and get a list of
{523!,23592,988,34,19}, a(99)=19.
		

Crossrefs

Programs

  • Mathematica
    ffi[x_] := Flatten[FactorInteger[x]] lf[x_] := Length[FactorInteger[x]] ba[x_] := Table[Part[ffi[x], 2*w-1], {w, 1, lf[x]}] sopf[x_] := Apply[Plus, ba[x]] Table[FixedPoint[sopf, Prime[w]! ], {w, 2, 100}]

Formula

a(n)=A082087[A000142(p[n])].

A321944 Starting from n, repeatedly compute the sum of the prime divisors until a fixed point or 0 is reached; a(n) is the number of terms, including n.

Original entry on oeis.org

2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 3, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 2, 4, 2, 3, 1, 3, 1, 2, 4, 2, 3, 2, 1, 4, 3, 2, 1, 3, 1, 2, 3, 3, 1, 2, 2, 2, 3, 4, 1, 2, 3, 3, 3, 2, 1, 3, 1, 5, 3, 2, 3, 3, 1, 2, 5, 4, 1, 2, 1, 4, 3, 4, 3, 3, 1, 2, 2, 2, 1, 3, 3, 4, 3, 2, 1, 3
Offset: 1

Views

Author

Keywords

Comments

a(n) is 1 + the number of iterations of n -> A008472(n) until n = A008472(n) or n=0.
The fixed points are in A075860.
For n>1 the fixed point is a prime number.

Examples

			For n=21: 21->{3,7} 3+7=10, 10->{2,5} 2+5=7, 7->{7} 7; 3 terms found {21,10,7}, therefore a(21) = 3.
For n=2: 2->{2} 2, 1 term found {2}, therefore a(2) = 1.
For n=1: 1->{} 0, 2 term found {1,0}, therefore a(1) = 2.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) option remember;
      if isprime(n) then 1
      else 1+procname(convert(numtheory:-factorset(n),`+`))
      fi
    end proc:
    f(1):= 2:
    map(f, [$1..100]); # Robert Israel, Mar 30 2020
  • Mathematica
    s[n_] := DivisorSum[n, # &, PrimeQ[#] &]; a[1] = 2; a[n_] := Length[ FixedPointList[s, n]] - 1; Array[a, 60, 0] (* Amiram Eldar, Dec 12 2018 *)
  • PARI
    a(n)={my(k=1); while(n&&!isprime(n), k++; n=vecsum(factor(n)[, 1])); k} \\ Andrew Howroyd, Dec 12 2018

A082089 a(n)-th prime is the fixed point if function A008472[=sum of prime factors with no repetition] is iterated when started at factorial of n-th prime.

Original entry on oeis.org

1, 3, 4, 7, 2, 13, 11, 3, 4, 3, 4, 45, 1, 60, 14, 4, 3, 3, 21, 1, 4, 4, 6, 3, 4, 3, 2, 4, 6, 2, 4, 4, 4, 4, 105, 4, 4, 3, 4, 4, 3, 4, 3, 4, 1, 4, 8, 2, 2, 19, 3, 1, 20, 14, 4, 20, 52, 4, 4, 977, 1, 3, 65, 1108, 1, 2, 46, 3, 3, 1, 3, 1, 2, 4, 829, 2, 25, 3, 8, 25, 4, 378, 3, 3, 29, 3, 6, 8, 1, 1, 28
Offset: 2

Views

Author

Labos Elemer, Apr 09 2003

Keywords

Comments

a(n) < n holds usually, except few large values arising unexpectedly.

Examples

			n=100, p(100)=541, starts at factorial of 100th prime and ends in 24133, the 2687th prime, so a(100)=2687;
n=99, initial value=523!, fixed point is 19, the 8th prime, a(99)=8.
		

Crossrefs

Programs

  • Mathematica
    ffi[x_] := Flatten[FactorInteger[x]] lf[x_] := Length[FactorInteger[x]] ba[x_] := Table[Part[ffi[x], 2*w-1], {w, 1, lf[x]}] sopf[x_] := Apply[Plus, ba[x]] Table[PrimePi[FixedPoint[sopf, Prime[w]! ]], {w, 2, 100}]

Formula

a(n) = A000720(A082087(A000142(A000040(n)))) = pi(A082087(p(n)!)).
Previous Showing 11-15 of 15 results.