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

A339306 Continued fraction expansion of the constant defined in A249270.

Original entry on oeis.org

2, 1, 11, 1, 1, 30, 1, 6, 2, 27, 1, 3, 41, 1, 4, 19, 2, 1, 3, 2, 1, 3, 3, 12, 1, 1, 12, 1, 60, 1, 3, 1, 1, 3, 4, 1, 5, 3, 1, 4, 4, 6, 1, 3, 5, 1, 1, 1, 17, 1, 1, 1, 1, 3, 1, 2, 6, 8, 1, 11, 1, 1, 80, 1, 7, 3, 11, 1, 1, 2, 1, 105, 1, 3, 14, 1, 10, 1, 22, 5, 2
Offset: 0

Views

Author

Michael Reilly, Nov 29 2020

Keywords

Crossrefs

Programs

  • Mathematica
    q[x_] := Apply[Times, Table[Prime[w], {w, 1, PrimePi[x]}]];
    ContinuedFraction[Sum[1/q[n], {n, 0, 100}]]

A341930 Decimal expansion of (A249270 + A340469)/2.

Original entry on oeis.org

2, 0, 6, 7, 4, 3, 5, 8, 9, 1, 4, 2, 0, 2, 3, 4, 2, 2, 9, 5, 1, 8, 8, 4, 7, 0, 7, 5, 6, 6, 7, 8, 9, 5, 2, 1, 1, 1, 3, 0, 9, 3, 9, 0, 7, 9, 7, 6, 6, 8, 4, 9, 5, 5, 5, 6, 7, 6, 5, 4, 8, 5, 7, 6, 2, 0, 0, 7, 7, 3, 8, 8, 1, 5, 5, 3, 7, 6, 4, 6, 9, 2, 3, 9, 7, 1, 1, 8, 5, 8, 6, 3, 2, 5, 5, 7, 0, 0, 0, 3, 9, 6, 8
Offset: 1

Views

Author

Davide Rotondo, Feb 23 2021

Keywords

Comments

With this constant r(1) and using the formula r(n+1) = round(r(n))*(r(n) - round(r(n)) + 1.5) it is possible to obtain the sequence of prime numbers because round(r(n)) = prime(n).

Examples

			2.06743589142023422951884707566789...
		

Crossrefs

Programs

  • PARI
    suminf(k=1, (prime(k)-1.5)/prod(i=1, k-1, prime(i))) \\ Michel Marcus, Feb 23 2021

Formula

r(1) = Sum_{k>=1} (prime(k)-1.5)/Product_{i=1..k-1} prime(i).

A346801 Engel expansion of A249270 = lim_{n->oo} (1/n)*Sum_{k=1..n} smallest prime not dividing k.

Original entry on oeis.org

1, 1, 2, 2, 2, 3, 13, 18, 160, 162, 1421, 1745, 6097, 6348, 15474, 65948, 103608, 366088, 573005, 1048188, 1138953, 3410520, 6376825, 279823002, 306445433, 1082288597, 1489247033, 2533043524, 5591690612, 8082600305, 22159965172, 62442143259, 70275959860
Offset: 1

Views

Author

Corey Clemons, Aug 04 2021

Keywords

Comments

Cf. A006784 for definition of Engel expansion.

Crossrefs

Extensions

More terms from Alois P. Heinz, Aug 04 2021

A034386 Primorial numbers (second definition): n# = product of primes <= n.

Original entry on oeis.org

1, 1, 2, 6, 6, 30, 30, 210, 210, 210, 210, 2310, 2310, 30030, 30030, 30030, 30030, 510510, 510510, 9699690, 9699690, 9699690, 9699690, 223092870, 223092870, 223092870, 223092870, 223092870, 223092870, 6469693230, 6469693230, 200560490130, 200560490130
Offset: 0

Views

Author

Keywords

Comments

Squarefree kernel of both n! and lcm(1, 2, 3, ..., n).
a(n) = lcm(core(1), core(2), core(3), ..., core(n)) where core(x) denotes the squarefree part of x, the smallest integer such that x*core(x) is a square. - Benoit Cloitre, May 31 2002
The sequence can also be obtained by taking a(1) = 1 and then multiplying the previous term by n if n is coprime to the previous term a(n-1) and taking a(n) = a(n-1) otherwise. - Amarnath Murthy, Oct 30 2002; corrected by Franklin T. Adams-Watters, Dec 13 2006

Examples

			a(5) = a(6) = 2*3*5 = 30;
a(7) = 2*3*5*7 = 210.
		

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, Section 1.3, p. 14, "n?".
  • József Sándor, Dragoslav S. Mitrinovic, Borislav Crstici, Handbook of Number Theory I, Springer Science & Business Media, 2005, Section VII.35, p. 268.

Crossrefs

Cf. A073838, A034387. - Reinhard Zumkeller, Jul 05 2010
The following fractions are all related to each other: Sum 1/n: A001008/A002805, Sum 1/prime(n): A024451/A002110 and A106830/A034386, Sum 1/nonprime(n): A282511/A282512, Sum 1/composite(n): A250133/A296358.

Programs

  • Magma
    [n eq 0 select 1 else LCM(PrimesInInterval(1, n)) : n in [0..50]]; // G. C. Greubel, Jul 21 2023
  • Maple
    A034386 := n -> mul(k,k=select(isprime,[$1..n])); # Peter Luschny, Jun 19 2009
    # second Maple program:
    a:= proc(n) option remember; `if`(n=0, 1,
          `if`(isprime(n), n, 1)*a(n-1))
        end:
    seq(a(n), n=0..36);  # Alois P. Heinz, Nov 26 2020
  • Mathematica
    q[x_]:=Apply[Times,Table[Prime[w],{w,1,PrimePi[x]}]]; Table[q[w],{w,1,30}]
    With[{pr=FoldList[Times,1,Prime[Range[20]]]},Table[pr[[PrimePi[n]+1]],{n,0,40}]] (* Harvey P. Dale, Apr 05 2012 *)
    Table[ResourceFunction["Primorial"][i], {i,1,40}] (* Navvye Anand, May 22 2024 *)
  • PARI
    a(n)=my(v=primes(primepi(n)));prod(i=1,#v,v[i]) \\ Charles R Greathouse IV, Jun 15 2011
    
  • PARI
    a(n)=lcm(primes([2,n])) \\ Jeppe Stig Nielsen, Mar 10 2019
    
  • Python
    from sympy import primorial
    def A034386(n): return 1 if n == 0 else primorial(n,nth=False) # Chai Wah Wu, Jan 11 2022
    
  • SageMath
    def sharp_primorial(n): return sloane.A002110(prime_pi(n))
    [sharp_primorial(n) for n in (0..30)] # Giuseppe Coppoletta, Jan 26 2015
    

Formula

a(n) = n# = A002110(A000720(n)) = A007947(A003418(n)) = A007947(A000142(n)).
Asymptotic expression for a(n): exp((1 + o(1)) * n) where o(1) is the "little o" notation. - Dan Fux (dan.fux(AT)OpenGaia.com or danfux(AT)OpenGaia.com), Apr 08 2001
For n > 0, log(a(n)) < 1.01624*n. [Rosser and Schoenfeld, 1962; Sándor et al., 2005] - N. J. A. Sloane, Apr 04 2017
a(n) <= A179215(n). - Reinhard Zumkeller, Jul 05 2010
a(n) = lcm(A006530(n), a(n-1)). - Jon Maiga, Nov 10 2018
Sum_{n>=0} 1/a(n) = A249270. - Amiram Eldar, Nov 08 2020

Extensions

Offset changed and initial term added by Arkadiusz Wesolowski, Jun 04 2011

A053669 Smallest prime not dividing n.

Original entry on oeis.org

2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2
Offset: 1

Views

Author

Henry Bottomley, Feb 15 2000

Keywords

Comments

Smallest prime coprime to n.
Smallest k >= 2 coprime to n.
a(#(p-1)) = a(A034386(p-1)) = p is the first appearance of prime p in sequence.
a(A005408(n)) = 2; for n > 2: a(n) = A112484(n,1). - Reinhard Zumkeller, Sep 23 2011
Average value is 2.920050977316134... = A249270. - Charles R Greathouse IV, Nov 02 2013
Differs from A236454, "smallest number not dividing n^2", for the first time at n=210, where a(210)=11 while A236454(210)=8. A235921 lists all n for which a(n) differs from A236454. - Antti Karttunen, Jan 26 2014
For k >= 0, a(A002110(k)) is the first occurrence of p = prime(k+1). Thereafter p occurs whenever A007947(n) = A002110(k). Thus every prime appears in this sequence infinitely many times. - David James Sycamore, Dec 04 2024

Examples

			a(60) = 7, since all primes smaller than 7 divide 60 but 7 does not.
a(90) = a(120) = a(150) = a(180) = 7 because 90,120,150,180 all have same squarefree kernel = 30 = A002110(3), and 7 is the smallest prime which does not divide 30. - _David James Sycamore_, Dec 04 2024
		

Crossrefs

Programs

  • Haskell
    a053669 n = head $ dropWhile ((== 0) . (mod n)) a000040_list
    -- Reinhard Zumkeller, Nov 11 2012
    
  • Maple
    f:= proc(n) local p;
    p:= 2;
    while n mod p = 0 do p:= nextprime(p) od:
    p
    end proc:
    map(f, [$1..100]); # Robert Israel, May 18 2016
  • Mathematica
    Table[k := 1; While[Not[GCD[n, Prime[k]] == 1], k++ ]; Prime[k], {n, 1, 60}] (* Stefan Steinerberger, Apr 01 2006 *)
    With[{prs=Prime[Range[10]]},Flatten[Table[Select[prs,!Divisible[ n,#]&,1],{n,110}]]] (* Harvey P. Dale, May 03 2012 *)
  • PARI
    a(n)=forprime(p=2,,if(n%p,return(p))) \\ Charles R Greathouse IV, Nov 20 2012
    
  • Python
    from sympy import nextprime
    def a(n):
        p = 2
        while True:
            if n%p: return p
            else: p=nextprime(p) # Indranil Ghosh, May 12 2017
    
  • Python
    # using standard library functions only
    import math
    def a(n):
        k = 2
        while math.gcd(n,k) > 1: k += 1
        return k # Ely Golden, Nov 26 2020
  • Scheme
    (define (A053669 n) (let loop ((i 1)) (cond ((zero? (modulo n (A000040 i))) (loop (+ i 1))) (else (A000040 i))))) ;; Antti Karttunen, Jan 26 2014
    

Formula

a(n) = A071222(n-1)+1. [Because the right hand side computes the smallest k >= 2 such that gcd(n,k) = gcd(n-1,k-1) which is equal to the smallest k >= 2 coprime to n] - Antti Karttunen, Jan 26 2014
a(n) = 1 + Sum_{k=1..n}(floor((n^k)/k!)-floor(((n^k)-1)/k!)) = 2 + Sum_{k=1..n} A001223(k)*( floor(n/A002110(k))-floor((n-1)/A002110(k)) ). - Anthony Browne, May 11 2016
a(n!) = A151800(n). - Anthony Browne, May 11 2016
a(2k+1) = 2. - Bernard Schott, Jun 03 2019
Asymptotic mean: lim_{n->oo} (1/n) * Sum_{k=1..n} a(k) = A249270. - Amiram Eldar, Oct 29 2020
a(n) = A000040(A257993(n)) = A020639(A276086(n)) = A276086(n) / A324895(n). - Antti Karttunen, Apr 24 2022
a(n) << log n. For every e > 0, there is some N such that for all n > N, a(n) < (1 + e)*log n. - Charles R Greathouse IV, Dec 03 2022
A007947(n) = A002110(k) ==> a(n) = prime(k+1). - David James Sycamore, Dec 04 2024

Extensions

More terms from Andrew Gacek (andrew(AT)dgi.net), Feb 21 2000 and James Sellers, Feb 22 2000
Entry revised by David W. Wilson, Nov 25 2006

A064648 Decimal expansion of sum of reciprocals of primorial numbers: 1/2 + 1/6 + 1/30 + 1/210 + ...

Original entry on oeis.org

7, 0, 5, 2, 3, 0, 1, 7, 1, 7, 9, 1, 8, 0, 0, 9, 6, 5, 1, 4, 7, 4, 3, 1, 6, 8, 2, 8, 8, 8, 2, 4, 8, 5, 1, 3, 7, 4, 3, 5, 7, 7, 6, 3, 9, 1, 0, 9, 1, 5, 4, 3, 2, 8, 1, 9, 2, 2, 6, 7, 9, 1, 3, 8, 1, 3, 9, 1, 9, 7, 8, 1, 1, 4, 8, 0, 0, 2, 8, 6, 3, 5, 8, 6, 1, 1, 9, 0, 5, 1, 9, 8, 4, 0, 2, 7, 4, 7, 6, 6, 5, 9, 2, 5, 6
Offset: 0

Views

Author

Labos Elemer, Oct 04 2001

Keywords

Comments

The Engel expansion of this constant is the sequence of primes. - Jonathan Vos Post, May 04 2005
Let S be the operator over the space omega of infinite sequences of numbers, defined to be the Engel expansion of the sum of reciprocals of primorials of a sequence p of numbers; than the eigenvalue-equation S p = p is satisfied by the sequence of prime numbers. - Ralf Steiner, Dec 31 2016
This constant is irrational (Griffiths, 2015). - Amiram Eldar, Oct 27 2020

Examples

			0.705230171791800965147431682888248513743577639109154328192267913813919...
		

References

  • Friedrich Engel, "Entwicklung der Zahlen nach Stammbruechen" Verhandlungen der 52. Versammlung deutscher Philologen und Schulmaenner in Marburg. pp. 190-191, 1913.

Crossrefs

Cf. A002110, A054543, A000027, A053977, A006784, A028259, A165509 (continued fraction).

Programs

  • Mathematica
    RealDigits[ Sum[1/Product[ Prime[i], {i, n}], {n, 58}], 10, 111][[1]] (* Robert G. Wilson v, Aug 05 2005 *)
    RealDigits[Total[1/#&/@FoldList[Times,Prime[Range[100]]]],10,120][[1]] (* Harvey P. Dale, Aug 27 2019 *)
  • PARI
    default(realprecision, 20080); p=1; s=x=0; for (k=1, 10^9, p*=prime(k); s+=1.0/p; if (s==x, break); x=s ); x*=10; for (n=0, 20000, d=floor(x); x=(x-d)*10; write("b064648.txt", n, " ", d)) \\ Harry J. Smith, Sep 21 2009
    
  • Sage
    @CachedFunction
    def pv(n):
        a = 1
        b = 0
        for i in (1..n):
            a *= nth_prime(i)
            b += 1/a
        return b
    N(pv(100),digits=108) # From Maple code Jani Melik, Jul 22 2015

Formula

(1/2)*(1 + (1/3)*(1 + (1/5)*(1 + (1/7)*(1 + (1/11)*(1 + (1/13)*(1 + ...)))))). - Jonathan Sondow, Aug 04 2014
Equals Sum_{n>=1} 1/A002110(n). - Amiram Eldar, Oct 27 2020

A232927 a(n) is the smallest k such that the first k primes generate the multiplicative group modulo n.

Original entry on oeis.org

1, 2, 1, 3, 2, 3, 1, 2, 1, 4, 1, 2, 4, 3, 2, 3, 1, 5, 3, 4, 3, 6, 1, 3, 1, 3, 1, 5, 2, 3, 3, 2, 2, 4, 1, 2, 4, 5, 2, 5, 2, 4, 4, 3, 3, 6, 2, 2, 3, 3, 1, 3, 2, 5, 3, 2, 1, 6, 1, 2, 3, 3, 2, 4, 1, 3, 3, 8, 4, 6, 3, 3, 4, 4, 2, 4, 2, 5, 1, 3, 1, 6, 2, 2, 3, 4, 2, 5, 2, 3, 5, 3, 4, 6, 3, 2, 3, 5, 1, 4, 2, 5, 6, 2, 1, 4, 2, 4, 5, 5, 2, 6, 4, 4, 4, 5, 5, 7
Offset: 3

Views

Author

Steven Finch, Dec 02 2013

Keywords

Crossrefs

A260188 Greatest primorial less than or equal to n.

Original entry on oeis.org

1, 2, 2, 2, 2, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30
Offset: 1

Views

Author

Jean-Marc Rebert, Jul 18 2015

Keywords

Examples

			a(5) = 2 because 2 is the greatest primorial less than or equal to 5.
a(31) = 30 because 30 is the greatest primorial less than or equal to 31.
		

Crossrefs

Cf. A034386 (primorials), A048764, A249270.

Programs

  • Mathematica
    Table[k = 0; While[Times @@ Prime@ Range[k + 1] <= n, k++]; Times @@ Prime@ Range@ k, {n, 120}] (* Michael De Vlieger, Aug 30 2016 *)
  • PARI
    a(n)=my(t=1,k); forprime(p=2,, k=t*p; if(k>n, return(t), t=k)) \\ Charles R Greathouse IV, Jul 20 2015

Formula

a(n) = max_{A034386(i) <= n} A034386(i).
a(n) >> n/log n. - Charles R Greathouse IV, Jul 20 2015
Sum_{n>=1} 1/a(n)^2 = A249270. - Amiram Eldar, Aug 09 2022

A071222 Smallest k such that gcd(n,k) = gcd(n+1,k+1).

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Jun 10 2002

Keywords

Comments

a(n) = least m>0 such that gcd(n!+1+m,n-m) = 1. [Clark Kimberling, Jul 21 2012]
From Antti Karttunen, Jan 26 2014: (Start)
a(n-1)+1 = A053669(n) = Smallest k >= 2 coprime to n = Smallest prime not dividing n.
Note that a(n) is equal to A235918(n+1) for the first 209 values of n. The first difference occurs at n=210 and A235921 lists the integers n for which a(n) differs from A235918(n+1).
(End)

Crossrefs

One less than A053669(n+1).

Programs

  • Haskell
    a071222 n = head [k | k <- [1..], gcd (n + 1) (k + 1) == gcd n k]
    -- Reinhard Zumkeller, Oct 01 2014
  • Mathematica
    sgcd[n_]:=Module[{k=1},While[GCD[n,k]!=GCD[n+1,k+1],k++];k]; Array[sgcd,110] (* Harvey P. Dale, Jul 13 2012 *)
  • PARI
    for(n=1,140,s=1; while(gcd(s,n)
    				
  • Scheme
    (define (A071222 n) (let loop ((k 1)) (cond ((= (gcd n k) (gcd (+ n 1) (+ k 1))) k) (else (loop (+ 1 k)))))) ;; Antti Karttunen, Jan 26 2014
    

Formula

Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A249270 - 1. - Amiram Eldar, Jul 26 2022

Extensions

Added a(0)=1. - N. J. A. Sloane, Jan 19 2014

A079578 Least number coprime to n and greater than n+1.

Original entry on oeis.org

3, 5, 5, 7, 7, 11, 9, 11, 11, 13, 13, 17, 15, 17, 17, 19, 19, 23, 21, 23, 23, 25, 25, 29, 27, 29, 29, 31, 31, 37, 33, 35, 35, 37, 37, 41, 39, 41, 41, 43, 43, 47, 45, 47, 47, 49, 49, 53, 51, 53, 53, 55, 55, 59, 57, 59, 59, 61, 61, 67, 63, 65, 65, 67, 67, 71, 69, 71, 71, 73, 73
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 24 2003

Keywords

Crossrefs

Programs

  • Haskell
    a079578 n = head [m | m <- [n + 2 ..], gcd m n == 1]
    -- Reinhard Zumkeller, Oct 01 2014
  • Mathematica
    a[n_] := Module[{p = 2}, While[Divisible[n, p], p = NextPrime[p]]; n + p]; Array[a, 100] (* Amiram Eldar, Apr 13 2025 *)

Formula

a(n) = n + A053669(n).
a(n) = (A116934(n) - n)/A116933(n). - Reinhard Zumkeller, Feb 27 2006
Sum_{k=1..n} a(k) ~ n^2 / 2 + c * n, where c = A249270. - Amiram Eldar, Apr 13 2025
Showing 1-10 of 23 results. Next