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.

A064921 Iterate A064920 until a prime is reached.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Oct 14 2001

Keywords

Comments

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

Examples

			a(18) = 5 as A064920(18) = 8 and A064920(8) = 5.
		

Crossrefs

Programs

  • PARI
    gpf(n)= { local(f); f=factor(n)~; return(f[1, length(f)]) } { for (n=2, 1000, m=n; while (!isprime(m), g=gpf(m); m=m / g + g - 1); write("b064921.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

A064923 a(n) = Min { k | A064920(k) = n }.

Original entry on oeis.org

2, 3, 6, 5, 10, 7, 14, 16, 24, 11, 22, 13, 26, 39, 52, 17, 34, 19, 38, 57, 76, 23, 46, 69, 72, 115, 120, 29, 58, 31, 62, 64, 96, 155, 160, 37, 74, 111, 148, 41, 82, 43, 86, 129, 172, 47, 94, 141, 144, 235, 240, 53, 106, 159, 162, 265, 270, 59, 118, 61, 122, 183, 244
Offset: 2

Views

Author

Reinhard Zumkeller, Oct 14 2001

Keywords

Comments

A064920(a(n)) = n. a(n) = n iff n is prime.

Crossrefs

Programs

  • PARI
    gpf(n)= { local(f); f=factor(n)~; return(f[1, length(f)]) } { for (n=2, 1000, k=1; until (m==n, k++; g=gpf(k); m=k / g + g - 1); write("b064923.txt", n, " ", k) ) } \\ Harry J. Smith, Sep 29 2009

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

A064924 If n is prime then a(n) = n; for the subsequent nonprime positions a(n + k) = (k+1)*n; then at the next prime position a new subsequence begins.

Original entry on oeis.org

2, 3, 6, 5, 10, 7, 14, 21, 28, 11, 22, 13, 26, 39, 52, 17, 34, 19, 38, 57, 76, 23, 46, 69, 92, 115, 138, 29, 58, 31, 62, 93, 124, 155, 186, 37, 74, 111, 148, 41, 82, 43, 86, 129, 172, 47, 94, 141, 188, 235, 282, 53, 106, 159, 212, 265, 318, 59, 118, 61, 122, 183, 244
Offset: 2

Views

Author

Reinhard Zumkeller, Oct 14 2001

Keywords

Comments

A064920(a(n)) = n.

Examples

			a(7) = A007917(7) * (A064722(7) + 1) = 7 * (0 + 1) = 7; a(8) = A007917(8) * (A064722(8) + 1) = 7 * (1 + 1) = 14; a(9) = A007917(9) * (A064722(9) + 1) = 7 * (2 + 1) = 21; a(10) = A007917(10) * (A064722(10) + 1) = 7 * (3 + 1) = 28; a(11) = 11.
		

Crossrefs

Programs

  • Haskell
    import Data.List (genericTake)
    a064924 n = a064924_list !! (n-1)
    a064924_list = concat $ zipWith (\p g -> genericTake g [p, 2 * p ..])
       a000040_list $ zipWith (-) (tail a000040_list) a000040_list
    -- Reinhard Zumkeller, Jul 05 2013
  • Mathematica
    a[n_?PrimeQ] := n; a[n_] := NextPrime[n, -1]*(n - NextPrime[n, -1] + 1); Table[a[n], {n, 2, 64}] (* Jean-François Alcover, Sep 19 2011 *)
    Flatten[First[#]Range[Last[#]-First[#]]&/@Partition[Prime[Range[20]],2,1]] (* Harvey P. Dale, May 03 2012 *)
  • PARI
    { for (n=2, 10000, if (isprime(n), a=m=n; k=2, a=k*m; k++); write("b064924.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 29 2009
    

Formula

a(n) = A007917(n) * (A064722(n) + 1)
Showing 1-5 of 5 results.