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

A064916 a(n) = n/lpf(n) + lpf(n) - 1, where lpf = A020639 = least prime factor.

Original entry on oeis.org

2, 3, 3, 5, 4, 7, 5, 5, 6, 11, 7, 13, 8, 7, 9, 17, 10, 19, 11, 9, 12, 23, 13, 9, 14, 11, 15, 29, 16, 31, 17, 13, 18, 11, 19, 37, 20, 15, 21, 41, 22, 43, 23, 17, 24, 47, 25, 13, 26, 19, 27, 53, 28, 15, 29, 21, 30, 59, 31, 61, 32, 23, 33, 17, 34, 67, 35, 25, 36, 71, 37, 73, 38, 27
Offset: 2

Views

Author

Reinhard Zumkeller, Oct 14 2001

Keywords

Comments

a(n) = A032742(n) + A020639(n) - 1; a(n) <= n and for n > 1 a(n) = n iff n is prime.

Examples

			a(18) = 18/2 + 2 - 1 = 10;
a(19) = 19/19 + 19 - 1 = 19.
		

Crossrefs

Programs

  • Mathematica
    lpf[n_]:=Module[{lp=FactorInteger[n][[1,1]]},n/lp+lp-1]; Array[lpf, 80, 2] (* Harvey P. Dale, Sep 25 2011 *)
  • PARI
    lpf(n)= { local(f); f=factor(n); return(f[1, 1]) } { for (n=2, 1000, L=lpf(n); a=n / L + L - 1; write("b064916.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 28 2009
    
  • PARI
    a(n) = my(p = vecmin(factor(n)[,1])); n/p + p - 1; \\ Michel Marcus, Jun 19 2018

A323076 Number of iterations of map x -> 1+(x-(largest divisor d < x)), starting from x=n, needed to reach a fixed point, which is always either a prime or 1.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 04 2019

Keywords

Comments

Differs from A064918 at n = 25, 48, 51, 69, 75, 81, 85, 94, 95, 99, 100, 111, 115, 121, ...

Crossrefs

Cf. A060681, A064918, A323075 (the fixed points reached), A323077, A323079.
Cf. also A039651.

Programs

  • Mathematica
    {0}~Join~Array[-2 + Length@ NestWhileList[1 + (# - Divisors[#][[-2]]) &, #, UnsameQ, All] &, 104, 2] (* Michael De Vlieger, Jan 04 2019 *)
  • PARI
    A060681(n) = (n-if(1==n,n,n/vecmin(factor(n)[,1])));
    A323076(n) = { my(nn = 1+A060681(n)); if(nn==n,0,1+A323076(nn)); };

Formula

If n == (1+A060681(n)), then a(n) = 0, otherwise a(n) = 1 + a(1+A060681(n)).

A064917 a(n) is the result of beginning with n and iterating k -> A064916(k) until a prime is reached.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Oct 14 2001

Keywords

Comments

Well-defined since A064916(n) < n for nonprimes.
a(p) = p for all primes p.

Examples

			a(6) = 3 as A064916(6) = 4 and A064916(4) = 3.
		

Crossrefs

Programs

  • PARI
    lpf(n)= { local(f); f=factor(n); return(f[1, 1]) } { for (n=2, 1000, m=n; while (!isprime(m), L=lpf(m); m=m / L + L - 1); write("b064917.txt", n, " ", m) ) } \\ Harry J. Smith, Sep 29 2009

A064922 Number of iterations in A064920 to reach a prime.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Oct 14 2001

Keywords

Comments

a(p) = 0 for all primes p.

Examples

			a(18) = 2 as A064920(A064920(18)) = A064920(8) = 5 = A064921(18).
		

Crossrefs

Programs

  • PARI
    gpf(n)= { local(f); f=factor(n)~; return(f[1, length(f)]) } { for (n=2, 1000, m=n; a=0; while (!isprime(m), g=gpf(m); m=m / g + g - 1; a++); write("b064922.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 29 2009
Showing 1-4 of 4 results.