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 18 results. Next

A231813 Number of iterations of A046665(n) = (greatest prime divisor of n) - (least prime divisor of n) [with A046665(1) = 0] required to reach zero.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Dec 11 2013

Keywords

Examples

			A046665(6) = 3 - 2, and A046665(1) = 0, so a(6) = 2.
		

Crossrefs

Programs

  • Mathematica
    z = 400; h[n_] := h[n] = FactorInteger[n][[-1, 1]] - FactorInteger[n][[1, 1]]; t[n_] := Drop[FixedPointList[h, n], -2]; Table[t[n], {n, 1, z}]; a = Table[Length[t[n]], {n, 1, z}]
  • PARI
    A046665(n) = if(1==n,0, my(f = factor(n), lpf = f[1, 1], gpf = f[#f~, 1]); (gpf-lpf));
    A231813(n) = if(0==n,0, 1+A231813(A046665(n))); \\ Antti Karttunen, Jan 03 2019

Formula

a(0) = 0; for n > 0, a(n) = 1 + a(A046665(n)). - Antti Karttunen, Jan 03 2019

Extensions

Name edited, term a(0)=0 prepended and more terms added by Antti Karttunen, Jan 03 2019

A074320 a(n) = sum of smallest and largest prime factors of n, for n>1; a(1)=2.

Original entry on oeis.org

2, 4, 6, 4, 10, 5, 14, 4, 6, 7, 22, 5, 26, 9, 8, 4, 34, 5, 38, 7, 10, 13, 46, 5, 10, 15, 6, 9, 58, 7, 62, 4, 14, 19, 12, 5, 74, 21, 16, 7, 82, 9, 86, 13, 8, 25, 94, 5, 14, 7, 20, 15, 106, 5, 16, 9, 22, 31, 118, 7, 122, 33, 10, 4, 18, 13, 134, 19, 26, 9, 142, 5, 146, 39, 8, 21, 18, 15
Offset: 1

Views

Author

Jason Earls, Sep 26 2002

Keywords

Comments

If n is prime, a(n) = 2n; the only prime factor, n itself, is taken as both the "smallest" and "largest" prime factor of n. - Jon E. Schoenfield, Jan 14 2015

Crossrefs

Programs

  • Mathematica
    f[n_]:=Transpose[FactorInteger[n]][[1]];Table[First[f[n]]+Last[f[n]],{n,200}] (* Vladimir Joseph Stephan Orlovsky, Apr 08 2011 *)
  • PARI
    a(n) = if (n==1, 2, my(f=factor(n)); f[1,1] + f[#f~,1]); \\ Michel Marcus, Jan 14 2015

Formula

a(n) = A020639(n) + A006530(n).

A130064 a(n) = (n / SmallestPrimeFactor(n)) * GreatestPrimeFactor(n).

Original entry on oeis.org

1, 2, 3, 4, 5, 9, 7, 8, 9, 25, 11, 18, 13, 49, 25, 16, 17, 27, 19, 50, 49, 121, 23, 36, 25, 169, 27, 98, 29, 75, 31, 32, 121, 289, 49, 54, 37, 361, 169, 100, 41, 147, 43, 242, 75, 529, 47, 72, 49, 125, 289, 338, 53, 81, 121, 196, 361, 841, 59, 150, 61, 961, 147, 64, 169, 363
Offset: 1

Views

Author

Reinhard Zumkeller, May 05 2007

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := With[{pp = FactorInteger[n][[All, 1]]}, n*pp[[-1]]/pp[[1]]];
    Array[a, 100] (* Jean-François Alcover, Nov 18 2021 *)
  • PARI
    a(n) = if (n==1, 1, my(f=factor(n)[, 1]~); n*vecmax(f)/vecmin(f)); \\ Michel Marcus, Sep 24 2022
    
  • Python
    from sympy import factorint
    def a(n): f = factorint(n); return 1 if n == 1 else n//min(f)*max(f)
    print([a(n) for n in range(1, 67)]) # Michael S. Branicky, Sep 24 2022

Formula

a(n) = n*A006530(n)/A020639(n) = A032742(n)*A006530(n);
a(n) >= n.
a(n) = n iff n is a prime power: a(A000961(n)) = A000961(n);
a(A001221(n)) <= A001221(n); a(A001222(n)) = A001222(n);
a(n) = A130065(n)+n*A046665(n)*A074320(n)/A066048(n) = A000290(n)/A130065(n).
Sum_{k=1..n} k/a(k) ~ n/log(n) + 3*n/log(n)^2 + o(n/log(n)^2) (Erdős and van Lint, 1982). - Amiram Eldar, Oct 14 2022

A130065 a(n) = (n / GreatestPrimeFactor(n)) * SmallestPrimeFactor(n).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, May 05 2007

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{ps = First /@ FactorInteger[n]}, n * First[ps] / Last[ps]]; Array[a, 100] (* Amiram Eldar, Nov 27 2020 *)
  • PARI
    a(n) = if (n==1, 1, my(f=factor(n)[,1]~); n*vecmin(f)/vecmax(f)); \\ Michel Marcus, Nov 27 2020

Formula

a(n) = n*A020639(n)/A006530(n) = A052126(n)*A020639(n);
a(n) <= n; a(n) = n iff n is a prime power: a(A000961(n)) = A000961(n);
a(A001221(n)) <= A001221(n); a(A001222(n)) = A001222(n);
a(n) = A130064(n) - n*A046665(n)*A074320(n)/A066048(n) = A000290(n)/A130064(n).

A069897 Integer quotient of the largest and the smallest prime factors of n, with a(1) = 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 2, 2, 5, 1, 1, 1, 6, 1, 3, 1, 2, 1, 1, 3, 8, 1, 1, 1, 9, 4, 2, 1, 3, 1, 5, 1, 11, 1, 1, 1, 2, 5, 6, 1, 1, 2, 3, 6, 14, 1, 2, 1, 15, 2, 1, 2, 5, 1, 8, 7, 3, 1, 1, 1, 18, 1, 9, 1, 6, 1, 2, 1, 20, 1, 3, 3, 21, 9, 5, 1, 2, 1, 11, 10, 23, 3, 1, 1, 3, 3, 2, 1
Offset: 1

Views

Author

Labos Elemer, Apr 10 2002

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{p = FactorInteger[n][[;;, 1]]}, Floor[p[[-1]] / p[[1]]]]; Array[a, 100] (* Amiram Eldar, Oct 24 2024 *)
  • PARI
    A069897(n) = if(1==n,1, my(f = factor(n), lpf = f[1, 1], gpf = f[#f~, 1]); (gpf\lpf)); \\ Antti Karttunen, Sep 07 2018

Formula

a(n) = floor(A006530(n)/A020639(n)).

Extensions

Term a(1) = 1 prepended by Antti Karttunen, Sep 07 2018

A081303 gpf(m) - 2*spf(m), where gpf(m) is the greatest and spf(m) is the smallest prime factor of m (A006530, A020639).

Original entry on oeis.org

-1, -2, -3, -2, -5, -1, -7, -2, -3, 1, -11, -1, -13, 3, -1, -2, -17, -1, -19, 1, 1, 7, -23, -1, -5, 9, -3, 3, -29, 1, -31, -2, 5, 13, -3, -1, -37, 15, 7, 1, -41, 3, -43, 7, -1, 19, -47, -1, -7, 1, 11, 9, -53, -1, 1, 3, 13, 25, -59, 1, -61, 27, 1, -2, 3, 7, -67, 13, 17, 3, -71, -1, -73, 33, -1, 15
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 17 2003

Keywords

Crossrefs

A111426 Difference between largest and smallest prime factor of the n-th composite number.

Original entry on oeis.org

0, 1, 0, 0, 3, 1, 5, 2, 0, 1, 3, 4, 9, 1, 0, 11, 0, 5, 3, 0, 8, 15, 2, 1, 17, 10, 3, 5, 9, 2, 21, 1, 0, 3, 14, 11, 1, 6, 5, 16, 27, 3, 29, 4, 0, 8, 9, 15, 20, 5, 1, 35, 2, 17, 4, 11, 3, 0, 39, 5, 12, 41, 26, 9, 3, 6, 21, 28, 45, 14, 1, 5, 8, 3, 15, 11, 4, 51, 1, 9, 34, 5, 17, 18, 27, 10, 57, 10, 3, 0
Offset: 1

Views

Author

Giovanni Teofilatto, Nov 13 2005

Keywords

Comments

a(n) = 0 iff the n-th composite number is a perfect power.
First occurrence of k or 0 if impossible: 2,8,5,12,7,38,0,21,13,26,16,61,0,35,22,40,25,84,0,49,31,156,0,111,0...,.

Programs

  • Mathematica
    Composite[n_] := FixedPoint[n + 1 + PrimePi[ # ] &, n]; f[n_] := Block[{a = First@Transpose@FactorInteger@n}, a[[ -1]] - a[[1]]]; f[n_] := Block[{a = First@Transpose@FactorInteger@n}, a[[ -1]] - a[[1]]] (* Robert G. Wilson v *)
    dif[n_]:=Module[{f=Transpose[FactorInteger[n]][[1]]},If[PrimeQ[n],{},Last[ f]- First[f]]]; Flatten[Table[dif[n],{n,4,200}]] (* Harvey P. Dale, May 12 2014 *)

Formula

a(n) = A046665(A002808(n)). - R. J. Mathar, Feb 19 2008

Extensions

More terms from Robert G. Wilson v, Nov 17 2005
Corrected a(19). - Juri-Stepan Gerasimov, Jun 16 2009
a(19)=3 inserted by Klaus Brockhaus, Jun 25 2009

A069859 (Largest prime factor of n) modulo (smallest prime factor of n).

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 2, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 2, 1, 2, 1, 0, 1, 1, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 3, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 4, 1, 0, 1, 0, 1, 0, 1, 2, 1, 2, 1, 0, 1, 6, 1, 1, 1, 4, 1, 0, 1, 2, 1, 0, 1, 0, 1, 1
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 23 2002

Keywords

Comments

a(n) = A006530(n) - A069897(n)*A020639(n).

Crossrefs

Programs

  • Mathematica
    lpfmspf[n_]:=Module[{fs=Transpose[FactorInteger[n]][[1]]},Mod[Last[fs], First[fs]]]; Array[lpfmspf,100] (* Harvey P. Dale, Jul 10 2015 *)
  • PARI
    A069859(n) = if(1==n,0, my(f = factor(n), lpf = f[1, 1], gpf = f[#f~, 1]); (gpf%lpf)); \\ Antti Karttunen, Sep 25 2018

Formula

a(n) = A006530(n) mod A020639(n).

Extensions

More terms from Antti Karttunen, Sep 25 2018

A115090 a(n) = A115074(n) - A117183(n).

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 3, 1, 0, 0, 5, 0, 1, 3, 9, 2, 1, 0, 3, 11, 1, 5, 3, 4, 0, 15, 1, 2, 17, 3, 0, 5, 9, 3, 21, 1, 5, 8, 3, 11, 1, 5, 27, 10, 3, 0, 29, 0, 5, 0, 9, 2, 15, 5, 1, 4, 35, 3, 17, 14, 11, 3, 1, 39, 5, 0, 16, 41, 2, 9, 3, 21, 45, 4, 1, 5, 9, 3, 15, 20, 11, 51, 1, 9, 5, 2, 17, 27, 11, 57, 3, 9, 0
Offset: 1

Views

Author

Leroy Quet, Mar 01 2006

Keywords

Comments

The union of A115090 is the complement of A007921: numbers that are not the difference of two primes. - Robert G. Wilson v, Mar 09 2006

Examples

			12, the 4th nonsquarefree positive integer, is 2^2 * 3. 3 is the largest prime dividing 12. 2 is the smallest prime dividing 12. So a(4) = 3 - 2 = 1.
		

Crossrefs

Programs

  • Mathematica
    (Max@# - Min@#) & /@ (First /@ FactorInteger@# & /@ Select[ Range@243, !SquareFreeQ@# &]) (* Robert G. Wilson v, Mar 09 2006 *)

Formula

a(n) = A046665(A013929(n)). - Amiram Eldar, Jan 06 2024

Extensions

More terms from Robert G. Wilson v, Mar 09 2006

A135093 Least composite number k for each possible difference gpf(k)-lpf(k).

Original entry on oeis.org

4, 6, 15, 10, 21, 14, 55, 33, 22, 39, 26, 85, 51, 34, 57, 38, 115, 69, 46, 203, 145, 87, 58, 93, 62, 259, 185, 111, 74, 205, 123, 82, 129, 86, 235, 141, 94, 371, 265, 159, 106, 413, 295, 177, 118, 183, 122, 469, 335, 201, 134, 355, 213, 142, 219, 146, 553, 395, 237
Offset: 0

Views

Author

Rick L. Shepherd, Nov 18 2007

Keywords

Comments

Clearly all terms are semiprimes. a(0)=prime(1)^2=4. For n>=1, a(n)=k, a squarefree semiprime, where gpf(k)-lpf(k)=A006530(k)-A020639(k)=A030173(k).
For n > 0: first occurrences of A030173(n) in A046665. - Reinhard Zumkeller, Jul 03 2015

Examples

			a(3)=2*5=10 because 5-2=3=A030173(3), where the latter terms are ordered by the increasing possible differences between two distinct primes and no smaller composite number has a difference of 3 between its least and greatest prime factors.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a135093 0 = 4
    a135093 n = (+ 1) $ fromJust $ (`elemIndex` a046665_list) $ a030173 n
    -- Reinhard Zumkeller, Jul 03 2015
Showing 1-10 of 18 results. Next