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.

Showing 1-5 of 5 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

A082081 a(n) = fixed point when the pseudo-log function A008475[ ] is iterated.

Original entry on oeis.org

0, 2, 3, 4, 5, 5, 7, 8, 9, 7, 11, 7, 13, 9, 8, 16, 17, 11, 19, 9, 7, 13, 23, 11, 25, 8, 27, 11, 29, 7, 31, 32, 9, 19, 7, 13, 37, 7, 16, 13, 41, 7, 43, 8, 9, 25, 47, 19, 49, 27, 9, 17, 53, 29, 16, 8, 13, 31, 59, 7, 61, 9, 16, 64, 11, 16, 67, 7, 8, 9, 71, 17, 73, 16, 11, 23, 11, 11, 79, 7, 81
Offset: 1

Views

Author

Labos Elemer, Apr 08 2003

Keywords

Comments

Fixed point is always a prime or a power of prime: fixed points are terms of A000961.

Examples

			n=10!=3628800:list to fixed point={3628800,369,50,27}.
		

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]}] ep[x_] := Table[Part[ffi[x], 2*w], {w, 1, lf[x]}] sex[x_] := Apply[Plus, ba[x]^ep[x]] Table[FixedPoint[sex, w], {w, 1, 128}]

A082090 Length of iteration sequence if function A056239, a pseudo-logarithm is iterated and started at n. Fixed point equals zero for all initial values.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Apr 09 2003

Keywords

Comments

From Gus Wiseman, Dec 01 2023: (Start)
Conjecture:
- The position of first appearance of k is n = A007097(k-2).
- The position of last appearance of k is n = A014221(k-2) = 2^^(k-2).
- The number of times k appears is: 1, 1, 2, 8, 435, ...
(End)

Examples

			n=127:list={127,31,11,5,3,2,1,0},a[127]=8
		

References

  • Mohammad K. Azarian, On the Fixed Points of a Function and the Fixed Points of its Composite Functions, International Journal of Pure and Applied Mathematics, Vol. 46, No. 1, 2008, pp. 37-44. Mathematical Reviews, MR2433713 (2009c:65129), March 2009. Zentralblatt MATH, Zbl 1160.65015.
  • Mohammad K. Azarian, Fixed Points of a Quadratic Polynomial, Problem 841, College Mathematics Journal, Vol. 38, No. 1, January 2007, p. 60. Solution published in Vol. 39, No. 1, January 2008, pp. 66-67.

Crossrefs

A112798 lists prime indices, length A001222, sum A056239.
A304038 lists distinct prime indices, length A001221, sum A066328.

Programs

  • Maple
    f:= n-> add (numtheory[pi](i[1])*i[2], i=ifactors(n)[2]):
    a:= n-> 1+ `if`(n=1, 1, a(f(n))):
    seq (a(n), n=1..120);  # Alois P. Heinz, Aug 09 2012
  • 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]}] bpi[x_] := Table[PrimePi[Part[ba[x], j]], {j, 1, lf[x]}] api[x_] := Apply[Plus, ep[x]*bpi[x]] Table[Length[FixedPointList[api, w]]-1, {w, 2, 128}]
    Table[Length[FixedPointList[Total[PrimePi/@Join@@ ConstantArray@@@FactorInteger[#]]&,n]]-1, {n,100}] (* Gus Wiseman, Dec 01 2023 *)

A082091 a(n) = one more than the number of iterations of A005361 needed to reach 1 from the starting value n.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Apr 09 2003

Keywords

Examples

			For n = 2 = 2^1, A005361(2) = 1, so we reach 1 in one step, and thus a(2) = 1+1 = 2.
For n = 4 = 2^2, A005361(4) = 2; A005361(2) = 1, so we reach 1 in two steps, and thus a(4) = 2+1 = 3.
For n = 6 = 2^1 * 3^1, A005361(6) = 1*1 = 1, so we reach 1 in one step, and thus a(6) = 1+1 = 2.
For n = 64 = 2^6, A005361(64) = 6, thus a(64) = 1 + a(6) = 3.
For n = 10! = 3628800 = 2^8 * 3^4 * 5^2 * 7*1, A005361(3628800) = 64, thus a(3628800) = 1 + a(64) = 4.
		

Crossrefs

Programs

  • Mathematica
    ffi[x_] := Flatten[FactorInteger[x]] lf[x_] := Length[FactorInteger[x]] ep[x_] := Table[Part[ffi[x], 2*w], {w, 1, lf[x]}] expr[x_] := Apply[Times, ep[x]] Table[Length[FixedPointList[expr, w]]-1, {w, 2, 128}]
    (* Second program: *)
    Table[Length@ NestWhileList[Apply[Times, FactorInteger[#][[All, -1]]] &, n, # != 1 &], {n, 105}] (* Michael De Vlieger, Jul 29 2017 *)
  • PARI
    A005361(n) = factorback(factor(n)[, 2]); \\ This function from Charles R Greathouse IV, Nov 07 2014
    A082091(n) = if(1==n,1,1+A082091(A005361(n))); \\ Antti Karttunen, Jul 28 2017
    
  • PARI
    first(n) = my(v = vector(n)); v[1] = 1; for(i=2, n, v[i] = v[factorback(factor(i)[, 2])] + 1); v \\ David A. Corneth, Jul 28 2017
    
  • Scheme
    (define (A082091 n) (if (= 1 n) n (+ 1 (A082091 (A005361 n))))) ;; Antti Karttunen, Jul 28 2017

Formula

a(1) = 1, and for n > 1, a(n) = 1 + a(A005361(n)).

Extensions

Term a(1)=1 prepended, Name and Example sections edited by Antti Karttunen, Jul 28 2017

A082084 a(n)=A029908[n! ]=A029908[A000142[n]] Fixed points of iterated A001414 function if started at factorials as initial values.

Original entry on oeis.org

0, 2, 5, 5, 5, 19, 5, 7, 7, 11, 13, 13, 23, 13, 19, 101, 61, 5, 19, 5, 11, 5, 5, 7, 23, 7, 5, 7, 283, 293, 5, 5, 7, 367, 379, 389, 23, 7, 463, 5, 13, 11, 29, 5, 23, 7, 7, 19, 5, 5, 5, 5, 61, 7, 73, 47, 857, 7, 947, 5, 29, 7, 13, 5, 5, 19, 137, 7, 5, 7, 11, 23, 353, 53, 11, 1471, 1489
Offset: 1

Views

Author

Labos Elemer, Apr 08 2003

Keywords

Examples

			Fixed point seems to be always a prime:tested for 1<n<201
n=20!=2432902008176640000: a(20)=5 with fixed-point-list=
{2432902008176640000,154,20,9,6,5,5}
		

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]}] ep[x_] := Table[Part[ffi[x], 2*w], {w, 1, lf[x]}] slog[x_] := Apply[Plus, ba[x]*ep[x]] Table[FixedPoint[slog, w! ], {w, 1, 128}]
Showing 1-5 of 5 results.