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-8 of 8 results.

A121360 Smallest k such that A002217(k)=n.

Original entry on oeis.org

2, 1, 8, 14, 26, 62, 134, 393, 1257, 4659, 9314, 27933, 167073, 334142, 4677862, 14033577, 56134292, 2133102298, 11788191218, 52541651594, 536226160966, 2681130804805, 8512643845707, 129535245187539
Offset: 1

Views

Author

Klaus Brockhaus, Jul 27 2006

Keywords

Comments

Least number which becomes prime or 0 or 4 after n-1 iterations of f(x) = sum of prime factors of x (cf. A001414). Agrees with A048133 except for the second term.
a(21) <= 536226160966. a(22) <= 2681130804805. a(23) <= 8512643845707. - Donovan Johnson, Oct 16 2010
a(25) <= 1679460336114602. - Danila Potapov, Dec 01 2024

Crossrefs

Extensions

a(19)-a(20) from Donovan Johnson, Oct 16 2010
a(21)-a(24) from Danila Potapov, Dec 01 2024

A001414 Integer log of n: sum of primes dividing n (with repetition). Also called sopfr(n).

Original entry on oeis.org

0, 2, 3, 4, 5, 5, 7, 6, 6, 7, 11, 7, 13, 9, 8, 8, 17, 8, 19, 9, 10, 13, 23, 9, 10, 15, 9, 11, 29, 10, 31, 10, 14, 19, 12, 10, 37, 21, 16, 11, 41, 12, 43, 15, 11, 25, 47, 11, 14, 12, 20, 17, 53, 11, 16, 13, 22, 31, 59, 12, 61, 33, 13, 12, 18, 16, 67, 21, 26, 14, 71, 12, 73, 39, 13, 23, 18, 18
Offset: 1

Views

Author

Keywords

Comments

MacMahon calls this the potency of n.
Downgrades the operators in a prime decomposition. E.g., 40 factors as 2^3 * 5 and sopfr(40) = 2 * 3 + 5 = 11.
Consider all ways of writing n as a product of zero, one, or more factors; sequence gives smallest sum of terms. - Amarnath Murthy, Jul 07 2001
a(n) <= n for all n, and a(n) = n iff n is 4 or a prime.
Look at the graph of this sequence. At the lower edge of the logarithmic scatterplot there is a set of fuzzy but unmistakable diagonal fringes, sloping toward the southeast. Their spacing gradually increases, and their slopes gradually decrease; they are more distinct toward the lower edge of the range. Is any explanation known? - Allan C. Wechsler, Oct 11 2015
For n >= 2, the glb and lub are: 3 * log(n) / log(3) <= a(n) <= n, where the lub occurs when n = 3^k, k >= 1. (Jakimczuk 2012) - Daniel Forgues, Oct 12 2015
Except for the initial term, row sums of A027746. - M. F. Hasler, Feb 08 2016
Atanassov proves that a(n) <= A065387(n) - n. - Charles R Greathouse IV, Dec 06 2016
From Robert G. Wilson v, Aug 15 2022: (Start)
Differs from A337310 beginning with n at 64, 192, 256, 320, 448, 512, ..., .
The number of terms which equal k is A000607(k).
The first occurrence of k>1 is A056240(k).
The last occurrence of k>1 is A000792(k).
The Amarnath Murthy comment of Jul 07 2001 is a result of the fundamental theorem of arithmetic.
(End)

Examples

			a(24) = 2+2+2+3 = 9.
a(30) = 10: 30 can be written as 30, 15*2, 10*3, 6*5, 5*3*2. The corresponding sums are 30, 17, 13, 11, 10. Among these 10 is the least.
		

References

  • K. Atanassov, New integer functions, related to ψ and σ functions. IV., Bull. Number Theory Related Topics 12 (1988), pp. 31-35.
  • Amarnath Murthy, Generalization of Partition function and introducing Smarandache Factor Partition, Smarandache Notions Journal, Vol. 11, 1-2-3, Spring-2000.
  • Amarnath Murthy and Charles Ashbacher, Generalized Partitions and Some New Ideas on Number Theory and Smarandache Sequences, Hexis, Phoenix; USA 2005. See Section 1.4.
  • Joe Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 89.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A000607(n) gives the number of values of k for which A001414(k) = n.
Cf. A036349 (indices of even terms), A356163 (their char. function), A335657 (indices of odd terms), A289142 (of multiples of 3), A373371 (their char. function).
For sum of squares of prime factors see A067666, for cubes see A224787.
Other completely additive sequences with primes p mapped to a function of p include: A001222 (with a(p)=1), A056239 (with a(p)=primepi(p)), A059975 (with a(p)=p-1), A064097 (with a(p)=1+a(p-1)), A113177 (with a(p)=Fib(p)), A276085 (with a(p)=p#/p), A341885 (with a(p)=p*(p+1)/2), A373149 (with a(p)=prevprime(p)), A373158 (with a(p)=p#).
For other completely additive sequences see the cross-references in A104244.

Programs

  • Haskell
    a001414 1 = 0
    a001414 n = sum $ a027746_row n
    -- Reinhard Zumkeller, Feb 27 2012, Nov 20 2011
    
  • Magma
    [n eq 1 select 0 else (&+[j[1]*j[2]: j in Factorization(n)]): n in [1..100]]; // G. C. Greubel, Jan 10 2019
  • Maple
    A001414 := proc(n) add( op(1,i)*op(2,i),i=ifactors(n)[2]) ; end proc:
    seq(A001414(n), n=1..100); # Peter Luschny, Jan 17 2011
  • Mathematica
    a[n_] := Plus @@ Times @@@ FactorInteger@ n; a[1] = 0; Array[a, 78] (* Ray Chandler, Nov 12 2005 *)
  • PARI
    a(n)=local(f); if(n<1,0,f=factor(n); sum(k=1,matsize(f)[1],f[k,1]*f[k,2]))
    
  • PARI
    A001414(n) = (n=factor(n))[,1]~*n[,2] \\ M. F. Hasler, Feb 07 2009
    
  • Python
    from sympy import factorint
    def A001414(n):
        return sum(p*e for p,e in factorint(n).items()) # Chai Wah Wu, Jan 08 2016
    
  • Sage
    [sum(factor(n)[j][0]*factor(n)[j][1] for j in range(0,len(factor(n)))) for n in range(1,79)] # Giuseppe Coppoletta, Jan 19 2015
    

Formula

If n = Product p_j^k_j then a(n) = Sum p_j * k_j.
Dirichlet g.f. f(s)*zeta(s), where f(s) = Sum_{p prime} p/(p^s-1) = Sum_{k>0} primezeta(k*s-1) is the Dirichlet g.f. for A120007. Totally additive with a(p^e) = p*e. - Franklin T. Adams-Watters, Jun 02 2006
For n > 1: a(n) = Sum_{k=1..A001222(n)} A027746(n,k). - Reinhard Zumkeller, Aug 27 2011
Sum_{n>=1} (-1)^a(n)/n^s = ((2^s + 1)/(2^s - 1))*zeta(2*s)/zeta(s), if Re(s)>1 and 0 if s=1 (Alladi and Erdős, 1977). - Amiram Eldar, Nov 02 2020
a(n) >= k*log(n), where k = 3/log(3). This bound is sharp. - Charles R Greathouse IV, Jul 28 2025

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

A081758 Sum of prime factors (with repetition) of sum of prime factors (with repetition) of n.

Original entry on oeis.org

2, 3, 4, 5, 5, 7, 5, 5, 7, 11, 7, 13, 6, 6, 6, 17, 6, 19, 6, 7, 13, 23, 6, 7, 8, 6, 11, 29, 7, 31, 7, 9, 19, 7, 7, 37, 10, 8, 11, 41, 7, 43, 8, 11, 10, 47, 11, 9, 7, 9, 17, 53, 11, 8, 13, 13, 31, 59, 7, 61, 14, 13, 7, 8, 8, 67, 10, 15, 9, 71, 7, 73, 16, 13, 23, 8, 8, 79, 13, 7, 43, 83, 9, 13, 11
Offset: 2

Views

Author

Reinhard Zumkeller, Apr 08 2003

Keywords

Comments

a(n) = A001414(A001414(n)). For further iterations see: A029908, A002217;
a(n)=n iff n is prime or 4.

Examples

			18 = 2*3*3 -> 2+3+3 = 2*2*2 -> 2+2+2 = 6: a(18) = 6.
		

Programs

  • Mathematica
    spf[n_]:=Flatten[Table[#[[1]],#[[2]]]&/@FactorInteger[n]]; Table[Nest[Total[spf[#]]&,n,2],{n,2,90}] (* Harvey P. Dale, May 31 2025 *)

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

A048124 Becomes prime or 4 after exactly 2 iterations of f(x) = sum of prime factors of x.

Original entry on oeis.org

8, 9, 21, 25, 30, 32, 35, 36, 42, 50, 57, 60, 64, 72, 81, 85, 86, 93, 102, 111, 115, 121, 122, 138, 145, 146, 159, 164, 174, 182, 187, 194, 215, 219, 235, 236, 237, 253, 258, 260, 265, 266, 282, 284, 287, 289, 302, 303, 308, 312, 318, 319, 326, 329, 338, 346
Offset: 1

Views

Author

Keywords

Comments

f(x) = sum of prime factors with multiplicity, so that f(1500) = 2+2+3+5+5+5 = 22.
Numbers k such that A002217(k) = 3. - Andrew Howroyd, Sep 15 2019

Crossrefs

Programs

  • Mathematica
    okQ[n_]:=Module[{lst=NestList[Total[Times@@@FactorInteger[#]]&,n,2]}, !PrimeQ[First[lst]] &&!PrimeQ[lst[[2]]]&&First[lst]!=4&&lst[[2]]!=4&&(PrimeQ[Last[lst]]||Last[lst]==4)]; Select[Range[400], okQ] (* Harvey P. Dale, Mar 23 2011 *)
  • PARI
    sopfr(n)={my(f=factor(n)); sum(i=1, #f~, f[i,1]*f[i,2])}
    ok(n)={forstep(k=2, 1, -1, n=sopfr(n); if(n==4||isprime(n), return(k==1))); 0}
    select(ok, [1..500]) \\ Andrew Howroyd, Sep 14 2019

A048125 Becomes prime or 4 after exactly 3 iterations of f(x) = sum of prime factors of x.

Original entry on oeis.org

14, 15, 16, 18, 20, 24, 27, 38, 46, 68, 87, 124, 141, 152, 155, 158, 161, 166, 171, 183, 185, 186, 195, 203, 208, 209, 212, 218, 221, 222, 226, 230, 231, 232, 234, 247, 249, 255, 261, 272, 275, 276, 290, 295, 299, 301, 306, 314, 322, 323, 330, 335, 341, 343
Offset: 1

Views

Author

Keywords

Comments

f(x) = sum of prime factors with multiplicity, so that f(1500) = 2+2+3+5+5+5 = 22.

Crossrefs

Programs

  • Mathematica
    f[n_] := Total[Times @@@ FactorInteger[n]];
    okQ[n_] := For[k = 3; r = n, k >= 1, k--, r = f[r]; If[r == 4 || PrimeQ[r], Return[k == 1]]];
    Select[Range[500], okQ] (* Jean-François Alcover, Sep 20 2019, from PARI *)
  • PARI
    sopfr(n)={my(f=factor(n)); sum(i=1, #f~, f[i,1]*f[i,2])}
    ok(n)={forstep(k=3, 1, -1, n=sopfr(n); if(n==4||isprime(n), return(k==1))); 0}
    select(ok, [1..500]) \\ Andrew Howroyd, Sep 14 2019

A318387 Starting with a(1) = 6, a(n) is the smallest number whose sum of prime divisors (taken with multiplicity) is a(n-1). In other words, a(n) = A056240(a(n-1)).

Original entry on oeis.org

6, 8, 15, 26, 69, 134, 393, 1556, 4659, 9314, 27933, 921327, 85680249, 171360494, 2227686253, 17821489976, 124750429783, 19336316610785, 4544034403522255, 3567067006764843005, 203322819385596050031, 25008706784428314148401, 825287323886134366896771, 91606892951360914725537141, 1923744751978579209236279751
Offset: 1

Views

Author

David James Sycamore, Aug 25 2018

Keywords

Comments

Any nonzero number other than 4 or a prime could be chosen for a(1) so as to generate a nontrivial sequence (because A056240(r)=r for r=4 or a prime). In this sequence a(1) is set to 6 because it is the smallest composite number which is the sum of prime divisors of a greater number (8), and is therefore the smallest starting value for a non-stationary sequence of this kind.
Let m = A056240(a(n-1)-q), where q is the greatest (prime or 4) < a(n-1)-1. Then a(n) = m*q, since sopfr(m*q) = sopf(m)+sopf(q) = a(n-1). Each term represents a step up (from the previous term) in the number of repeated iterations of sopfr required to reach a prime; a(n) >= A048133(n).

Examples

			a(2) = 8, the smallest number whose sopfr is 6: A056240(8) = 6;
a(3) = 15, the smallest number whose sopfr is 8: A056240(8) = 15; etc.
		

Crossrefs

Programs

  • Mathematica
    With[{s = Array[Total@ Flatten[ConstantArray[#1, #2] & @@@ FactorInteger@ #] &,10^6]}, Nest[Append[#, First@ FirstPosition[s, #[[-1]] ]] &, {6}, 11]] (* Michael De Vlieger, Aug 25 2018 *)

Formula

a(n) = A056240(a(n-1)); A002217(a(n)) = 1 + A002217(a(n - 1))

Extensions

a(13)-a(17) from Giovanni Resta, Aug 28 2018
Terms a(18) onward from Max Alekseyev, Sep 20 2024
Showing 1-8 of 8 results.