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-10 of 300 results. Next

A175943 Partial products of A027746.

Original entry on oeis.org

1, 2, 6, 12, 24, 120, 240, 720, 5040, 10080, 20160, 40320, 120960, 362880, 725760, 3628800, 39916800, 79833600, 159667200, 479001600, 6227020800, 12454041600, 87178291200, 261534873600, 1307674368000, 2615348736000, 5230697472000
Offset: 1

Views

Author

Lior Manor, Oct 27 2010

Keywords

Comments

a(n) <= A265125(n), a(n) < A265125(n) for n > 10. - Reinhard Zumkeller, Dec 02 2015

Crossrefs

n! (A000142) is a subsequence.
Cf. A027746.
Cf. A265125.

Programs

  • Haskell
    a175943 n = a175943_list !! (n-1)
    a175943_list = scanl1 (*) $ concat a027746_tabf
    -- Reinhard Zumkeller, Dec 02 2015
  • PARI
    print1(t=1); for(n=2, 10, f=factor(n); for(i=1, #f[,1], for(j=1,f[i,2], print1(", "t*=f[i,1])))) \\ Charles R Greathouse IV, Sep 12 2012
    

Formula

a(n) is approximately (n / (e log log n))^(n/log log n). - Charles R Greathouse IV, Sep 12 2012

A265110 Partial row products of table A027746, prime factors with repetition.

Original entry on oeis.org

1, 2, 3, 2, 4, 5, 2, 6, 7, 2, 4, 8, 3, 9, 2, 10, 11, 2, 4, 12, 13, 2, 14, 3, 15, 2, 4, 8, 16, 17, 2, 6, 18, 19, 2, 4, 20, 3, 21, 2, 22, 23, 2, 4, 8, 24, 5, 25, 2, 26, 3, 9, 27, 2, 4, 28, 29, 2, 6, 30, 31, 2, 4, 8, 16, 32, 3, 33, 2, 34, 5, 35, 2, 4, 12, 36
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 01 2015

Keywords

Comments

T(n,1) = A020639(n); T(n,A001222(n)) = n.

Examples

			.   n |   T(n,*)       |   A027746(n,*)
. ----+----------------+----------------
.   1 |   1            |   1
.   2 |   2            |   2
.   3 |   3            |   3
.   4 |   2, 4         |   2, 2
.   5 |   5            |   5
.   6 |   2, 6         |   2, 3
.   7 |   7            |   7
.   8 |   2, 4, 8      |   2, 2, 2
.   9 |   3, 9         |   3, 3
.  10 |   2, 10        |   2, 5
.  11 |   11           |   11
.  12 |   2, 4, 12     |   2, 2, 3
.  13 |   13           |   13
.  14 |   2, 14        |   2, 7
.  15 |   3, 15        |   3, 5
.  16 |   2, 4, 8, 16  |   2, 2, 2, 2
.  17 |   17           |   17
.  18 |   2, 6, 18     |   2, 3, 3
.  19 |   19           |   19
.  20 |   2, 4, 20     |   2, 2, 5
		

Crossrefs

Cf. A027746, A175943, A001222 (row lengths), A020639.

Programs

  • Haskell
    a265110 n k = a265110_tabf !! (n-1) !! (k-1)
    a265110_row n = a265110_tabf !! (n-1)
    a265110_tabf = map (scanl1 (*)) a027746_tabf
  • Mathematica
    Table[FoldList[Times, Flatten[FactorInteger[n] /. {p_, e_} /; e > 0 :> ConstantArray[p, e]]], {n, 37}] // Flatten (* Michael De Vlieger, Apr 28 2017 *)

Formula

T(n,k) = product(A027747(n,k): k = 1 .. A001221(n)).

A265111 A rearrangement of the terms of A027746 (seen as flat list) such that adjacent terms are distinct.

Original entry on oeis.org

1, 2, 3, 2, 5, 2, 3, 2, 7, 2, 3, 2, 5, 3, 2, 11, 2, 3, 2, 13, 2, 7, 2, 5, 3, 2, 17, 2, 3, 2, 19, 3, 2, 5, 2, 7, 3, 2, 11, 2, 23, 2, 3, 2, 5, 2, 13, 5, 2, 3, 2, 7, 3, 2, 29, 3, 2, 5, 3, 2, 31, 2, 11, 3, 2, 17, 2, 7, 5, 2, 3, 2, 37, 3, 2, 19, 2, 13, 3, 2, 5, 2
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 01 2015

Keywords

Examples

			.  k  | 1 2 3 4   5 6   7 8     9   10   11 12     13 14  15  16       17
.     | 1 2 3 2*2 5 2*3 7 2*2*2 3*3 2*5  11 2*2*3  13 2*7 3*5 2*2*2*2  17
. ----+-------------------------------------------------------------------
. a(n)| 1 2 3 2 5 2 3 2 7 2 3 2 5 3 2 11 2  3 2 13 2  7 2 5 3 2 17 2 3 2 ..
		

Crossrefs

Cf. A027746, A265125 (partial products).

Programs

  • Haskell
    a265111 n = a265111_list !! (n-1)
    a265111_list = 1 : f 1 [] 0 1 where
       f u [] w x = f 1 (reverse $ a027746_row' (u * x)) w (x + 1)
       f u (v:vs) w x | v == w    = f (u * v) vs w x
                      | otherwise = v : f u vs v x

A285904 Partial row products of table A027746, prime factors with repetition, reversed.

Original entry on oeis.org

1, 2, 3, 2, 4, 5, 3, 6, 7, 2, 4, 8, 3, 9, 5, 10, 11, 3, 6, 12, 13, 7, 14, 5, 15, 2, 4, 8, 16, 17, 3, 9, 18, 19, 5, 10, 20, 7, 21, 11, 22, 23, 3, 6, 12, 24, 5, 25, 13, 26, 3, 9, 27, 7, 14, 28, 29, 5, 15, 30, 31, 2, 4, 8, 16, 32, 11, 33, 17, 34, 7, 35, 3, 9, 18, 36, 37
Offset: 1

Views

Author

Michael De Vlieger, Apr 28 2017

Keywords

Comments

T(n,1) = A006530(n); T(n,A001222(n)) = n.

Examples

			.   n |   T(n,*)       |   A027746(n,*)
. ----+----------------+----------------
.   1 |   1            |   1
.   2 |   2            |   2
.   3 |   3            |   3
.   4 |   2, 4         |   2, 2
.   5 |   5            |   5
.   6 |   3, 6         |   2, 3
.   7 |   7            |   7
.   8 |   2, 4, 8      |   2, 2, 2
.   9 |   3, 9         |   3, 3
.  10 |   5, 10        |   2, 5
.  11 |   11           |   11
.  12 |   3, 6, 12     |   2, 2, 3
.  13 |   13           |   13
.  14 |   7, 14        |   2, 7
.  15 |   5, 15        |   3, 5
.  16 |   2, 4, 8, 16  |   2, 2, 2, 2
.  17 |   17           |   17
.  18 |   3, 9, 18     |   2, 3, 3
.  19 |   19           |   19
.  20 |   5, 10, 20    |   2, 2, 5
		

Crossrefs

Programs

  • Mathematica
    Table[FoldList[Times, Reverse@ Flatten[FactorInteger[n] /. {p_, e_} /; e > 0 :> ConstantArray[p, e]]], {n, 37}] // Flatten (* Michael De Vlieger, Apr 28 2017 *)

A268489 a(n) + f(a(n)) is always odd, where f is the sequence obtained by replacing each term with the corresponding row of A027746 (list of its prime factors). Lexicographic first such sequence without duplicates.

Original entry on oeis.org

2, 1, 5, 7, 4, 10, 11, 13, 8, 17, 14, 16, 15, 19, 22, 28, 27, 30, 34, 35, 36, 38, 39, 42, 43, 44, 46, 47, 48, 50, 51, 56, 57, 59, 64, 66, 67, 69, 70, 72, 75, 77, 79, 82, 84, 88, 89, 91, 92, 94, 96, 98, 103, 104, 107, 110, 112, 113, 119, 121, 126, 129, 132
Offset: 1

Views

Author

M. F. Hasler, Feb 06 2016

Keywords

Examples

			The reasoning below leads to the following list of indices n, prime factors f(n) and terms a(n):
n = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12,13,14,15,16,...
F = 2, 1, 5, 7, 2, 2, 2, 5,11, 13, 2, 2, 2,17, 2, 7,...
a = 2, 1, 5, 7, 4,10,11,13, 8, 17,14,...
a(1)=1=f(1) is not possible because 1+1 is not odd, but a(1)=2=f(1) does not lead to a contradiction.
Then, a(2)=1=f(2) is also possible, because a(2)+f(a(2)) = 1+2 is odd.
a(3)=3=f(3) not possible because 3+3 is even. a(3)=4=f(3) is not possible because this leads to f(4)=2. But a(3)=5=f(3) is possible, leading to the constraint f(5) = 2, the only possible even prime factor.
We note that 3 can never occur because 3+f(3) = 3+3 is not odd.
a(4)=4 => f(4)=2 is not possible because 4+2 is not odd. a(4)=6 => f(5)=3 is not possible. a(4)=7=f(4) is possible, but requires that f(7) = 2.
a(5)=2q because f(5)=2, a(5)=4, i.e., q=2=f(6) is ok since f(4)=7 is odd.
We note that 6 can never occur because 6+f(6) = 6+2 is not odd.
a(6)=2q because f(7)=2. The number 6 is excluded. a(6)=8 is not possible because then f(8)=2 is not odd. a(6)=10, f(8)=5 is possible, and must have f(10)=odd.
a(7)=8 => f(9,10,11)=2 is not possible because f(10)=odd. a(7)=9 => f(9,10)=3 is not possible (9+3 is even). a(7)=11= f(9) is possible, we must have f(11)=2.
Now f(10) must be odd and f(11)=2 so a(8) must be an odd prime, a(8)=13=f(10) is the smallest available. Thus f(13)=2.
a(9)=2x because f(11)=2 and we can use a(9)=8, f(11,12,13)=2, which is possible because 8+f(8)=13. And so on...
		

Programs

  • PARI
    {list(n,s=[],check=(s,f=concat(apply(A027746_row,s)))->!for(i=1,#s,s[i]<=#f&&(bittest(s[i]+f[s[i]],0)||return)))=for(n=2,n,S=Set(s);s=concat(s,1);for(k=1,S[#S]+99,!setsearch(S,k)&&(s[n]=k)&&check(s)&&break));s}

A112798 Table where n-th row is factorization of n, with each prime p_i replaced by i.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This is an enumeration of all partitions.
Technically this is an enumeration of all multisets (finite weakly increasing sequences of positive integers) rather than integer partitions. - Gus Wiseman, Dec 12 2016
A000040(a(n)) is a prime factor of A082288(n). - Reinhard Zumkeller, Feb 03 2008
Row n is the partition with Heinz number n. We define the Heinz number of a partition p = [p_1, p_2, ..., p_r] as Product(p_j-th prime, j=1..r) (concept used by Alois P. Heinz in A215366 as an "encoding" of a partition). For example, for the partition [1, 1, 2, 4, 10] we get 2*2*3*7*29 = 2436. For a given n, the 2nd Maple program yields row n; for example, we obtain at once B(2436) = [1,1,2,4,10]. - Emeric Deutsch, Jun 04 2015
From Emeric Deutsch, May 05 2015: (Start)
Number of entries in row n is bigomega(n) (i.e., the number of prime factors of n, multiplicities included).
Product of entries in row n = A003963(n).
Row n contains the Matula numbers of the rooted trees obtained from the rooted tree with Matula number n by deleting the edges emanating from the root. Example: row 8 is 1,1,1; indeed the rooted tree with Matula number 8 is \|/ and deleting the edges emanating from the root we obtain three one-vertex trees, having Matula numbers 1, 1, 1. Example: row 7 is 4; indeed, the rooted tree with Matula number 7 is Y and deleting the edges emanating from the root we obtain the rooted tree V, having Matula number 4.
The Matula (or Matula-Goebel) number of a rooted tree can be defined in the following recursive manner: to the one-vertex tree there corresponds the number 1; to a tree T with root degree 1 there corresponds the t-th prime number, where t is the Matula-Goebel number of the tree obtained from T by deleting the edge emanating from the root; to a tree T with root degree m >= 2 there corresponds the product of the Matula-Goebel numbers of the m branches of T. (End)

Examples

			Row 20 is 1,1,3 because the prime factors of 20, namely 2,2,5 are the 1st, 1st, 3rd primes.
Table begins:
  1;
  2;
  1, 1;
  3;
  1, 2;
  4;
  1, 1, 1;
  ...
The sequence of all finite multisets of positive integers begins: (), (1), (2), (11), (3), (12), (4), (111), (22), (13), (5), (112), (6), (14), (23), (1111), (7), (122), (8), (113), (24), (15), (9), (1112), (33), (16), (222), (114). - _Gus Wiseman_, Dec 12 2016
		

Crossrefs

Row lengths are A001222. Cf. A000040, A027746, A000720, A036036.
Cf. A056239 (row sums).
Cf. A003963 (row products).

Programs

  • Haskell
    a112798 n k = a112798_tabf !! (n-2) !! (n-1)
    a112798_row n = a112798_tabf !! (n-2)
    a112798_tabf = map (map a049084) $ tail a027746_tabf
    -- Reinhard Zumkeller, Aug 04 2014
    
  • Maple
    T:= n-> sort([seq(numtheory[pi](i[1])$i[2], i=ifactors(n)[2])])[]:
    seq(T(n), n=2..50);  # Alois P. Heinz, Aug 09 2012
    with(numtheory): B := proc (n) local nn, j, m: nn := op(2, ifactors(n)); for j to nops(nn) do m[j] := op(j, nn) end do: [seq(seq(pi(op(1, m[i])), q = 1 .. op(2, m[i])), i = 1 .. nops(nn))] end proc: # Emeric Deutsch, Jun 04 2015. (This is equivalent to the first Maple program.)
  • Mathematica
    PrimePi /@ Flatten[Table[#1, {#2}] & @@@ FactorInteger@ #] & /@ Range@ 60 // Flatten // Rest (* Michael De Vlieger, May 09 2015 *)
  • PARI
    row(n)=my(v=List(),f=factor(n)); for(i=1,#f~,for(j=1,f[i,2], listput(v,primepi(f[i,1])))); Vec(v) \\ Charles R Greathouse IV, Nov 09 2021

Formula

T(n,k) = A000720(A027746(n,k)); A027746(n,k) = A000040(T(n,k)).
Also T(n,k) = A049084(A027746(n,k)). - Reinhard Zumkeller, Aug 04 2014

A006530 Gpf(n): greatest prime dividing n, for n >= 2; a(1)=1.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The initial term a(1)=1 is purely conventional: The unit 1 is not a prime number, although it has been considered so in the past. 1 is the empty product of prime numbers, thus 1 has no largest prime factor. - Daniel Forgues, Jul 05 2011
Greatest noncomposite number dividing n, (cf. A008578). - Omar E. Pol, Aug 31 2013
Conjecture: Let a, b be nonzero integers and f(n) denote the maximum prime factor of a*n + b if a*n + b <> 0 and f(n)=0 if a*n + b=0 for any integer n. Then the set {n, f(n), f(f(n)), ...} is finite of bounded size. - M. Farrokhi D. G., Jan 10 2021

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 844.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section IV.1.
  • H. L. Montgomery, Ten Lectures on the Interface Between Analytic Number Theory and Harmonic Analysis, Amer. Math. Soc., 1996, p. 210.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000040, A020639 (smallest prime divisor), A034684, A028233, A034699, A053585.
Cf. A046670 (partial sums), A104350 (partial products).
See A385503 for "popular" primes.

Programs

  • Magma
    [ #f eq 0 select 1 else f[ #f][1] where f is Factorization(n): n in [1..86] ]; // Klaus Brockhaus, Oct 23 2008
    
  • Maple
    with(numtheory,divisors); A006530 := proc(n) local i,t1,t2,t3,t4,t5; t1 := divisors(n); t2 := convert(t1,list); t3 := sort(t2); t4 := nops(t3); t5 := 1; for i from 1 to t4 do if isprime(t3[t4+1-i]) then return t3[t4+1-i]; fi; od; 1; end;
    # alternative
    A006530 := n->max(1,op(numtheory[factorset](n))); # Peter Luschny, Nov 02 2010
  • Mathematica
    Table[ FactorInteger[n][[ -1, 1]], {n, 100}] (* Ray Chandler, Nov 12 2005 and modified by Robert G. Wilson v, Jul 16 2014 *)
  • PARI
    A006530(n)=if(n>1,vecmax(factor(n)[,1]),1) \\ Edited to cover n=1. - M. F. Hasler, Jul 30 2015
    
  • Python
    from sympy import factorint
    def a(n): return 1 if n == 1 else max(factorint(n))
    print([a(n) for n in range(1, 87)]) # Michael S. Branicky, Aug 08 2022
    
  • SageMath
    def A006530(n): return list(factor(n))[-1][0] if n > 1 else 1
    print([A006530(n) for n in range(1, 87)])  # Peter Luschny, Jan 07 2024
  • Scheme
    ;; The following uses macro definec for the memoization (caching) of the results. A naive implementation of A020639 can be found under that entry. It could be also defined with definec to make it faster on the later calls. See http://oeis.org/wiki/Memoization#Scheme
    (definec (A006530 n) (let ((spf (A020639 n))) (if (= spf n) spf (A006530 (/ n spf)))))
    ;; Antti Karttunen, Mar 12 2017
    

Formula

a(n) = A027748(n, A001221(n)) = A027746(n, A001222(n)); a(n)^A071178(n) = A053585(n). - Reinhard Zumkeller, Aug 27 2011
a(n) = A000040(A061395(n)). - M. F. Hasler, Jan 16 2015
a(n) = n + 1 - Sum_{k=1..n} (floor((k!^n)/n) - floor(((k!^n)-1)/n)). - Anthony Browne, May 11 2016
n/a(n) = A052126(n). - R. J. Mathar, Oct 03 2016
If A020639(n) = n [when n is 1 or a prime] then a(n) = n, otherwise a(n) = a(A032742(n)). - Antti Karttunen, Mar 12 2017
a(n) has average order Pi^2*n/(12 log n) [Brouwer]. See also A046670. - N. J. A. Sloane, Jun 26 2017

Extensions

Edited by M. F. Hasler, Jan 16 2015

A020639 Lpf(n): least prime dividing n (when n > 1); a(1) = 1. Or, smallest prime factor of n, or smallest prime divisor of n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Also, the largest number of distinct integers such that all their pairwise differences are coprime to n. - Max Alekseyev, Mar 17 2006
The unit 1 is not a prime number (although it has been considered so in the past). 1 is the empty product of prime numbers, thus 1 has no least prime factor. - Daniel Forgues, Jul 05 2011
a(n) = least m > 0 for which n! + m and n - m are not relatively prime. - Clark Kimberling, Jul 21 2012
For n > 1, a(n) = the smallest k > 1 that divides n. - Antti Karttunen, Feb 01 2014
For n > 1, records are at prime indices. - Zak Seidov, Apr 29 2015
The initials "lpf" might be mistaken for "largest prime factor" (A009190), using "spf" for "smallest prime factor" would avoid this. - M. F. Hasler, Jul 29 2015
n = 89 is the first index > 1 for which a(n) differs from the smallest k > 1 such that (2^k + n - 2)/k is an integer. - M. F. Hasler, Aug 11 2015
From Stanislav Sykora, Jul 29 2017: (Start)
For n > 1, a(n) is also the smallest k, 1 < k <= n, for which the binomial(n,k) is not divisible by n.
Proof: (A) When k and n are relatively prime then binomial(n,k) is divisible by n because k*binomial(n,k) = n*binomial(n-1,k-1). (B) When gcd(n,k) > 1, one of its prime factors is the smallest; let us denote it p, p <= k, and consider the binomial(n,p) = (1/p!)*Product_{i=0..p-1} (n-i). Since p is a divisor of n, it cannot be a divisor of any of the remaining numerator factors. It follows that, denoting as e the largest e > 0 such that p^e|n, the numerator is divisible by p^e but not by p^(e+1). Hence, the binomial is divisible by p^(e-1) but not by p^e and therefore not divisible by n. Applying (A), (B) to all considered values of k completes the proof. (End)
From Bob Selcoe, Oct 11 2017, edited by M. F. Hasler, Nov 06 2017: (Start)
a(n) = prime(j) when n == J (mod A002110(j)), n, j >= 1, where J is the set of numbers <= A002110(j) with smallest prime factor = prime(j). The number of terms in J is A005867(j-1). So:
a(n) = 2 when n == 0 (mod 2);
a(n) = 3 when n == 3 (mod 6);
a(n) = 5 when n == 5 or 25 (mod 30);
a(n) = 7 when n == 7, 49, 77, 91, 119, 133, 161 or 203 (mod 210);
etc. (End)
For n > 1, a(n) is the leftmost term, other than 0 or 1, in the n-th row of A127093. - Davis Smith, Mar 05 2019

References

  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section IV.1.

Crossrefs

Cf. A090368 (bisection).
Cf. A046669 (partial sums), A072486 (partial products).
Cf. A127093.

Programs

  • Haskell
    a020639 n = spf a000040_list where
      spf (p:ps) | n < p^2      = n
                 | mod n p == 0 = p
                 | otherwise    = spf ps
    -- Reinhard Zumkeller, Jul 13 2011
    
  • Maple
    A020639 := proc(n) if n = 1 then 1; else min(op(numtheory[factorset](n))) ; end if; end proc: seq(A020639(n),n=1..20) ; # R. J. Mathar, Oct 25 2010
  • Mathematica
    f[n_]:=FactorInteger[n][[1,1]]; Join[{1}, Array[f,120,2]]  (* Robert G. Wilson v, Apr 06 2011 *)
    Join[{1}, Table[If[EvenQ[n], 2, FactorInteger[n][[1,1]]], {n, 2, 120}]] (* Zak Seidov, Nov 17 2013 *)
    Riffle[Join[{1},Table[FactorInteger[n][[1,1]],{n,3,101,2}]],2] (* Harvey P. Dale, Dec 16 2021 *)
  • PARI
    A020639(n) = { vecmin(factor(n)[,1]) } \\ [Will yield an error for n = 1.] - R. J. Mathar, Mar 02 2012
    
  • PARI
    A020639(n)=if(n>1, if(n>n=factor(n,0)[1,1], n, factor(n)[1,1]), 1) \\ Avoids complete factorization if possible. Often the smallest prime factor can be found quickly even if it is larger than primelimit. If factoring takes too long for large n, use debugging level >= 3 (\g3) to display the smallest factor as soon as it is found. - M. F. Hasler, Jul 29 2015
    
  • Python
    from sympy import factorint
    def a(n): return 1 if n == 1 else min(factorint(n))
    print([a(n) for n in range(1, 98)]) # Michael S. Branicky, Dec 09 2021
  • Sage
    def A020639_list(n) : return [1] + [prime_divisors(n)[0] for n in (2..n)]
    A020639_list(97) # Peter Luschny, Jul 16 2012
    
  • Sage
    [trial_division(n) for n in (1..100)] # Giuseppe Coppoletta, May 25 2016
    
  • Scheme
    (define (A020639 n) (if (< n 2) n (let loop ((k 2)) (cond ((zero? (modulo n k)) k) (else (loop (+ 1 k))))))) ;; Antti Karttunen, Feb 01 2014
    

Formula

A014673(n) = a(A032742(n)); A115561(n) = a(A054576(n)). - Reinhard Zumkeller, Mar 10 2006
A028233(n) = a(n)^A067029(n). - Reinhard Zumkeller, May 13 2006
a(n) = A027746(n,1) = A027748(n,1). - Reinhard Zumkeller, Aug 27 2011
For n > 1: a(n) = A240694(n,2). - Reinhard Zumkeller, Apr 10 2014
a(n) = A000040(A055396(n)) = n / A032742(n). - Antti Karttunen, Mar 07 2017
a(n) has average order n/(2 log n) [Brouwer] - N. J. A. Sloane, Sep 03 2017

Extensions

Deleted wrong comment from M. Lagneau in 2012, following an observation by Gionata Neri. - M. F. Hasler, Aug 11 2015
Edited by M. F. Hasler, Nov 06 2017
Expanded definition to make this easier to find. - N. J. A. Sloane, Sep 21 2020

A003961 Completely multiplicative with a(prime(k)) = prime(k+1).

Original entry on oeis.org

1, 3, 5, 9, 7, 15, 11, 27, 25, 21, 13, 45, 17, 33, 35, 81, 19, 75, 23, 63, 55, 39, 29, 135, 49, 51, 125, 99, 31, 105, 37, 243, 65, 57, 77, 225, 41, 69, 85, 189, 43, 165, 47, 117, 175, 87, 53, 405, 121, 147, 95, 153, 59, 375, 91, 297, 115, 93, 61, 315, 67, 111, 275, 729, 119
Offset: 1

Views

Author

Keywords

Comments

Meyers (see Guy reference) conjectures that for all r >= 1, the least odd number not in the set {a(i): i < prime(r)} is prime(r+1). - N. J. A. Sloane, Jan 08 2021
Meyers' conjecture would be refuted if and only if for some r there were such a large gap between prime(r) and prime(r+1) that there existed a composite c for which prime(r) < c < a(c) < prime(r+1), in which case (by Bertrand's postulate) c would necessarily be a term of A246281. - Antti Karttunen, Mar 29 2021
a(n) is odd for all n and for each odd m there exists a k with a(k) = m (see A064216). a(n) > n for n > 1: bijection between the odd and all numbers. - Reinhard Zumkeller, Sep 26 2001
a(n) and n have the same number of distinct primes with (A001222) and without multiplicity (A001221). - Michel Marcus, Jun 13 2014
From Antti Karttunen, Nov 01 2019: (Start)
More generally, a(n) has the same prime signature as n, A046523(a(n)) = A046523(n). Also A246277(a(n)) = A246277(n) and A287170(a(n)) = A287170(n).
Many permutations and other sequences that employ prime factorization of n to encode either polynomials, partitions (via Heinz numbers) or multisets in general can be easily defined by using this sequence as one of their constituent functions. See the last line in the Crossrefs section for examples.
(End)

Examples

			a(12) = a(2^2 * 3) = a(prime(1)^2 * prime(2)) = prime(2)^2 * prime(3) = 3^2 * 5 = 45.
a(A002110(n)) = A002110(n + 1) / 2.
		

References

  • Richard K. Guy, editor, Problems From Western Number Theory Conferences, Labor Day, 1983, Problem 367 (Proposed by Leroy F. Meyers, The Ohio State U.).

Crossrefs

See A045965 for another version.
Row 1 of table A242378 (which gives the "k-th powers" of this sequence), row 3 of A297845 and of A306697. See also arrays A066117, A246278, A255483, A308503, A329050.
Cf. A064989 (a left inverse), A064216, A000040, A002110, A000265, A027746, A046523, A048673 (= (a(n)+1)/2), A108228 (= (a(n)-1)/2), A191002 (= a(n)*n), A252748 (= a(n)-2n), A286385 (= a(n)-sigma(n)), A283980 (= a(n)*A006519(n)), A341529 (= a(n)*sigma(n)), A326042, A049084, A001221, A001222, A122111, A225546, A260443, A245606, A244319, A246269 (= A065338(a(n))), A322361 (= gcd(n, a(n))), A305293.
Cf. A249734, A249735 (bisections).
Cf. A246261 (a(n) is of the form 4k+1), A246263 (of the form 4k+3), A246271, A246272, A246259, A246281 (n such that a(n) < 2n), A246282 (n such that a(n) > 2n), A252742.
Cf. A275717 (a(n) > a(n-1)), A275718 (a(n) < a(n-1)).
Cf. A003972 (Möbius transform), A003973 (Inverse Möbius transform), A318321.
Cf. A300841, A305421, A322991, A250469, A269379 for analogous shift-operators in other factorization and quasi-factorization systems.
Cf. also following permutations and other sequences that can be defined with the help of this sequence: A005940, A163511, A122111, A260443, A206296, A265408, A265750, A275733, A275735, A297845, A091202 & A091203, A250245 & A250246, A302023 & A302024, A302025 & A302026.
A version for partition numbers is A003964, strict A357853.
A permutation of A005408.
Applying the same transformation again gives A357852.
Other multiplicative sequences: A064988, A357977, A357978, A357980, A357983.
A056239 adds up prime indices, row-sums of A112798.

Programs

  • Haskell
    a003961 1 = 1
    a003961 n = product $ map (a000040 . (+ 1) . a049084) $ a027746_row n
    -- Reinhard Zumkeller, Apr 09 2012, Oct 09 2011
    (MIT/GNU Scheme, with Aubrey Jaffer's SLIB Scheme library)
    (require 'factor)
    (define (A003961 n) (apply * (map A000040 (map 1+ (map A049084 (factor n))))))
    ;; Antti Karttunen, May 20 2014
    
  • Maple
    a:= n-> mul(nextprime(i[1])^i[2], i=ifactors(n)[2]):
    seq(a(n), n=1..80);  # Alois P. Heinz, Sep 13 2017
  • Mathematica
    a[p_?PrimeQ] := a[p] = Prime[ PrimePi[p] + 1]; a[1] = 1; a[n_] := a[n] = Times @@ (a[#1]^#2& @@@ FactorInteger[n]); Table[a[n], {n, 1, 65}] (* Jean-François Alcover, Dec 01 2011, updated Sep 20 2019 *)
    Table[Times @@ Map[#1^#2 & @@ # &, FactorInteger[n] /. {p_, e_} /; e > 0 :> {Prime[PrimePi@ p + 1], e}] - Boole[n == 1], {n, 65}] (* Michael De Vlieger, Mar 24 2017 *)
  • PARI
    a(n)=local(f); if(n<1,0,f=factor(n); prod(k=1,matsize(f)[1],nextprime(1+f[k,1])^f[k,2]))
    
  • PARI
    a(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ Michel Marcus, May 17 2014
    
  • Perl
    use ntheory ":all";  sub a003961 { vecprod(map { next_prime($) } factor(shift)); }  # _Dana Jacobsen, Mar 06 2016
    
  • Python
    from sympy import factorint, prime, primepi, prod
    def a(n):
        f=factorint(n)
        return 1 if n==1 else prod(prime(primepi(i) + 1)**f[i] for i in f)
    [a(n) for n in range(1, 11)] # Indranil Ghosh, May 13 2017

Formula

If n = Product p(k)^e(k) then a(n) = Product p(k+1)^e(k).
Multiplicative with a(p^e) = A000040(A000720(p)+1)^e. - David W. Wilson, Aug 01 2001
a(n) = Product_{k=1..A001221(n)} A000040(A049084(A027748(n,k))+1)^A124010(n,k). - Reinhard Zumkeller, Oct 09 2011 [Corrected by Peter Munn, Nov 11 2019]
A064989(a(n)) = n and a(A064989(n)) = A000265(n). - Antti Karttunen, May 20 2014 & Nov 01 2019
A001221(a(n)) = A001221(n) and A001222(a(n)) = A001222(n). - Michel Marcus, Jun 13 2014
From Peter Munn, Oct 31 2019: (Start)
a(n) = A225546((A225546(n))^2).
a(A225546(n)) = A225546(n^2).
(End)
Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Product_{p prime} ((p^2-p)/(p^2-nextprime(p))) = 2.06399637... . - Amiram Eldar, Nov 18 2022

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
Showing 1-10 of 300 results. Next