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.

Previous Showing 41-50 of 133 results. Next

A083722 Product of primes greater than the greatest prime factor of n but not greater than n.

Original entry on oeis.org

1, 1, 1, 3, 1, 5, 1, 105, 35, 7, 1, 385, 1, 143, 1001, 15015, 1, 85085, 1, 323323, 46189, 4199, 1, 37182145, 7436429, 7429, 37182145, 1062347, 1, 215656441, 1, 100280245065, 86822723, 392863, 955049953, 33426748355, 1, 765049, 247110827, 247357937827, 1, 1448810778701, 1
Offset: 1

Views

Author

Reinhard Zumkeller, May 04 2003

Keywords

Comments

a(n) = 1 iff n is prime or n is 1.
Apart from 1-terms, the other duplicated terms are: a(24) = a(27), a(120) = a(125), a(140) = a(147), a(528) = a(539), etc, whose positions are listed by A293893 and A293894. - Antti Karttunen, Nov 01 2017

Crossrefs

Cf. A293892 (restricted growth sequence transform), A293893, A293894.

Programs

  • Mathematica
    Array[Times @@ Select[Prime@ Range[#1, #1 + #2], Function[p, p <= #3]] & @@ {PrimePi@ NextPrime[FactorInteger[#][[-1, 1]]], PrimePi@ #, #} &, 43] (* Michael De Vlieger, Nov 01 2017 *)
  • PARI
    a(n) = {if (n==1, return (1)); my(gpf = vecmax(factor(n)[,1])); my(pp = 1); forprime(p=gpf+1, n, pp *= p;); pp;} \\ Michel Marcus, Jun 26 2016

Formula

Extensions

More terms from Michel Marcus, Jun 26 2016

A126990 Largest prime preceding geometric mean of prime(n) and prime(n+2).

Original entry on oeis.org

3, 3, 7, 7, 13, 13, 19, 23, 23, 31, 31, 37, 43, 47, 47, 53, 61, 61, 67, 73, 73, 83, 89, 89, 97, 103, 103, 109, 113, 113, 131, 131, 139, 139, 151, 151, 157, 167, 167, 173, 181, 181, 193, 193, 199, 199, 211, 223, 229, 233, 233, 241, 241, 251, 257, 263, 271, 271, 277
Offset: 1

Views

Author

Artur Jasinski, Jan 01 2007

Keywords

Comments

With duplicates removed, seems to be a subsequence of A105399 and A105792. - M. F. Hasler, Jun 14 2007

References

  • P. Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004.

Crossrefs

Programs

  • Mathematica
    << NumberTheory`NumberTheoryFunctions` a = {}; Do[AppendTo[a,PreviousPrime[Sqrt[(Prime[x])*(Prime[x + 2])]]], {x, 1, 100}]; a
  • PARI
    A126990(n)={ n=sqrtint(prime(n)*prime(n+2)); if( 0==n%2, n--); while(!isprime(n), n-=2); n } /* then vector(50,n,A126990(n)) displays a list of values, M. F. Hasler, Jun 14 2007 */
    
  • PARI
    a(n)= precprime(sqrtint(prime(n)*prime(n+2))); \\ Michel Marcus, Nov 07 2013

Formula

a(n) = A007917(A073273(n)). - Michel Marcus, Nov 07 2013

Extensions

Edited by M. F. Hasler, Jun 14 2007
Definition changed so that offset is now 1 by Michel Marcus, Nov 07 2013

A245396 Largest prime not exceeding prime(n)^(1 + 1/n).

Original entry on oeis.org

3, 5, 7, 11, 17, 19, 23, 23, 31, 37, 41, 47, 53, 53, 59, 67, 73, 73, 83, 83, 89, 89, 97, 107, 113, 113, 113, 113, 127, 131, 139, 151, 157, 157, 167, 173, 179, 181, 181, 193, 199, 199, 211, 211, 211, 223, 233, 241, 251, 251, 257, 263, 263, 277, 283, 283, 293, 293, 293, 307, 307, 317, 331, 337
Offset: 1

Views

Author

M. F. Hasler, Nov 03 2014

Keywords

Comments

Firoozbakht's conjecture, prime(n+1) < prime(n)^(1 + 1/n), is equivalent to a(n) > prime(n). See also A182134.
Here prime(n) = A000040(n). The conjecture is also equivalent to a(n) - prime(n) >= A001223(n), the n-th gap between primes. See also A246778(n) = floor(prime(n)^(1 + 1/n)) - prime(n).
It is also conjectured that the equality a(n) - prime(n) = A001223(n) holds only for n in the set {1, 2, 3, 4, 8}, see A246782. a(n) is also largest prime less than prime(n)^(1 + 1/n), since prime(n)^(1 + 1/n) is never prime. - Farideh Firoozbakht, Nov 03 2014
a(n) = A007917(A249669(n)) = A244365(n,A182134(n)) = A006530(A245722(n)). - Reinhard Zumkeller, Nov 18 2014

Crossrefs

Programs

  • Haskell
    a245396 n = a244365 n (a182134 n)  -- Reinhard Zumkeller, Nov 16 2014
  • Maple
    seq(prevprime(ceil(ithprime(n)^(1+1/n))),n=1..100); # Robert Israel, Nov 03 2014
  • Mathematica
    Table[NextPrime[Prime[n]^(1 + 1/n), -1], {n, 64}] (* Farideh Firoozbakht, Nov 03 2014 *)
  • PARI
    a(n)=precprime(prime(n)^(1+1/n))
    
  • PARI
    a(n)=precprime(sqrtnint(prime(n)^(n+1),n)) \\ Charles R Greathouse IV, Oct 29 2018
    

Formula

A245396 = A007917 o A249669, i.e., a(n) = A007917(A249669(n)). Although one could say "less than" in the definition of this sequence, one cannot use A151799 in this formula because for n = 2 and n = 4, one has a(n) = A249669(n).

A378457 Difference between n and the greatest prime power <= n, allowing 1.

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, 2, 3, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 2, 3, 4, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 4, 5, 0, 1, 0, 1, 0, 1, 2, 3, 4
Offset: 1

Views

Author

Gus Wiseman, Nov 29 2024

Keywords

Comments

Prime powers allowing 1 are listed by A000961.

Examples

			The greatest prime power <= 6 is 5, so a(6) = 1.
		

Crossrefs

Sequences obtained by subtracting each term from n are placed in parentheses below.
For nonprime we have A010051 (almost) (A179278).
Subtracting from n gives (A031218).
For prime we have A064722 (A007917).
For perfect power we have A069584 (A081676).
For squarefree we have (A070321).
Adding one gives A276781.
For nonsquarefree we have (A378033).
For non perfect power we have (A378363).
For non prime power we have A378366 (A378367).
The opposite is A378370 = A377282-1.
A000015 gives the least prime power >= n.
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
A151800 gives the least prime > n, weak version A007918.
Prime powers between primes: A053607, A080101, A304521, A366833, A377057.

Programs

  • Mathematica
    Table[n-NestWhile[#-1&,n,#>1&&!PrimePowerQ[#]&],{n,100}]

Formula

a(n) = n - A031218(n).
a(n) = A276781(n) - 1.

A083716 a(n) = integer part of (greatest prime <= n)/(greatest prime factor of n); a(1) = 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 3, 1, 1, 2, 6, 1, 5, 1, 3, 2, 1, 1, 7, 4, 1, 7, 3, 1, 5, 1, 15, 2, 1, 4, 10, 1, 1, 2, 7, 1, 5, 1, 3, 8, 1, 1, 15, 6, 9, 2, 3, 1, 17, 4, 7, 2, 1, 1, 11, 1, 1, 8, 30, 4, 5, 1, 3, 2, 9, 1, 23, 1, 1, 14, 3, 6, 5, 1, 15, 26, 1, 1, 11, 4, 1, 2, 7, 1, 17, 6, 3, 2, 1, 4, 29, 1, 13, 8
Offset: 1

Views

Author

Reinhard Zumkeller, May 04 2003

Keywords

Comments

a(n) = floor(A007917(n)/A006530(n));
a(p) = 1 for primes p.

Crossrefs

Programs

  • Maple
    1,seq(floor(prevprime(n+1)/max(numtheory:-factorset(n))), n=2..100); # Robert Israel, Jun 13 2017
  • Mathematica
    a[n_] := If[n == 1 || PrimeQ[n], 1, Floor[NextPrime[n, -1]/ FactorInteger[n][[-1, 1]]]];
    Array[a, 100] (* Jean-François Alcover, Mar 04 2019 *)

A088631 Largest number m < n such that m+n is a prime.

Original entry on oeis.org

1, 2, 3, 2, 5, 6, 5, 8, 9, 8, 11, 10, 9, 14, 15, 14, 13, 18, 17, 20, 21, 20, 23, 22, 21, 26, 25, 24, 29, 30, 29, 28, 33, 32, 35, 36, 35, 34, 39, 38, 41, 40, 39, 44, 43, 42, 41, 48, 47, 50, 51, 50, 53, 54, 53, 56, 55, 54, 53, 52, 51, 50, 63, 62, 65, 64, 63, 68, 69, 68, 67, 66, 65, 74, 75
Offset: 2

Views

Author

N. J. A. Sloane, Nov 24 2003

Keywords

Examples

			Adding 1,2,3,2,5 to 2,3,4,5,6 we get the primes 3,5,7,7,11.
		

Crossrefs

Cf. A088633. Second column of A088643.

Programs

  • Haskell
    a088631 n = a060265 n - n  -- Reinhard Zumkeller, Feb 22 2015
  • Maple
    with(numtheory); A088631 := n->prevprime(2*n)-n;

Formula

a(n) = p-n where p = largest prime <= 2n-1.
a(n) = A060265(n) - n. - Reinhard Zumkeller, Feb 22 2015

A113523 a(n) = largest composite nonnegative integer <= n.

Original entry on oeis.org

0, 0, 0, 4, 4, 6, 6, 8, 9, 10, 10, 12, 12, 14, 15, 16, 16, 18, 18, 20, 21, 22, 22, 24, 25, 26, 27, 28, 28, 30, 30, 32, 33, 34, 35, 36, 36, 38, 39, 40, 40, 42, 42, 44, 45, 46, 46, 48, 49, 50, 51, 52, 52, 54, 55, 56, 57, 58, 58, 60, 60, 62, 63, 64, 65, 66, 66, 68, 69, 70, 70, 72
Offset: 1

Views

Author

Leroy Quet, Jan 12 2006

Keywords

Comments

For n > 3: a(n) = A179278(n). [From Reinhard Zumkeller, Jul 08 2010]

Crossrefs

Programs

  • Mathematica
    nnci[n_]:=Module[{k=0},While[PrimeQ[n-k],k++];n-k]/.{1->0}; Array[nnci,80] (* Harvey P. Dale, Jul 19 2012 *)

Formula

a(1)=a(2)=a(3) = 0. For n >= 4, a(n) = A014684(n).

A284374 a(1) = a(2) = 1; a(n) is the largest prime <= (a(n-a(n-1)) + a(n-a(n-2))) for n > 2.

Original entry on oeis.org

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

Views

Author

Altug Alkan, Mar 25 2017

Keywords

Examples

			a(4) = 3 because a(4 - a(3)) + a(4 - a(2)) = a(2) + a(3) = 1 + 2 = 3 and A007917(3) = 3.
		

Crossrefs

Programs

  • Mathematica
    a[1] = a[2] = 1; a[n_] := a[n] = Prime@ PrimePi[a[n - a[n - 1]] + a[n - a[n - 2]]]; Array[a, 73] (* Michael De Vlieger, Mar 25 2017 *)
  • PARI
    a=vector(1000); a[1]=a[2]=1; for(n=3, #a, a[n] = precprime(a[n-a[n-1]]+a[n-a[n-2]])); a

Formula

a(1) = a(2) = 1; a(n) = A007917(a(n-a(n-1)) + a(n-a(n-2))) for n > 2.

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)

A072680 Difference between (least prime >= n) and (largest prime <= n).

Original entry on oeis.org

0, 0, 2, 0, 2, 0, 4, 4, 4, 0, 2, 0, 4, 4, 4, 0, 2, 0, 4, 4, 4, 0, 6, 6, 6, 6, 6, 0, 2, 0, 6, 6, 6, 6, 6, 0, 4, 4, 4, 0, 2, 0, 4, 4, 4, 0, 6, 6, 6, 6, 6, 0, 6, 6, 6, 6, 6, 0, 2, 0, 6, 6, 6, 6, 6, 0, 4, 4, 4, 0, 2, 0, 6, 6, 6, 6, 6, 0, 4, 4, 4, 0, 6, 6, 6, 6, 6, 0, 8, 8, 8, 8, 8, 8, 8, 0, 4, 4, 4, 0, 2, 0, 4, 4, 4
Offset: 2

Views

Author

Reinhard Zumkeller, Jul 01 2002

Keywords

Comments

a(n) = 0 iff n is prime.

Crossrefs

Programs

  • Mathematica
    f[n_]:=If[PrimeQ[n],0,NextPrime[n]-NextPrime[n,-1]];Array[f,110,2] (* Harvey P. Dale, Sep 22 2011 *)
  • MuPAD
    numlib::prevprime(i)*(-1)-nextprime(i)*(-1)$ i = 2..106 // Zerinvary Lajos, Feb 26 2007
    
  • PARI
    A072680(n) = (nextprime(n) - precprime(n)); \\ Antti Karttunen, Sep 23 2018

Formula

a(n) = A007918(n) - A007917(n).
a(n) = A057427(n - A007917(n)) * A001223(A049084(A007917(n))).
Previous Showing 41-50 of 133 results. Next