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 21-30 of 133 results. Next

A249151 Largest m such that m! divides the product of elements on row n of Pascal's triangle: a(n) = A055881(A001142(n)).

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 6, 1, 2, 4, 10, 7, 12, 6, 4, 1, 16, 2, 18, 4, 6, 10, 22, 11, 4, 12, 2, 6, 28, 25, 30, 1, 10, 16, 6, 36, 36, 18, 12, 40, 40, 6, 42, 10, 23, 22, 46, 19, 6, 4, 16, 12, 52, 2, 10, 35, 18, 28, 58, 47, 60, 30, 63, 1, 12, 10, 66, 16, 22, 49, 70, 41, 72, 36, 4, 18, 10, 12, 78, 80, 2
Offset: 0

Views

Author

Antti Karttunen, Oct 25 2014

Keywords

Comments

A000225 gives the positions of ones.
A006093 seems to give all such k, that a(k) = k.

Examples

			              Binomial coeff.   Their product  Largest k!
                 A007318          A001142(n)   which divides
Row 0                1                    1        1!
Row 1              1   1                  1        1!
Row 2            1   2   1                2        2!
Row 3          1   3   3   1              9        1!
Row 4        1   4   6   4   1           96        4! (96 = 4*24)
Row 5      1   5  10  10   5   1       2500        2! (2500 = 1250*2)
Row 6    1   6  15  20  15   6   1   162000        6! (162000 = 225*720)
		

Crossrefs

One more than A249150.
Cf. A249423 (numbers k such that a(k) = k+1).
Cf. A249429 (numbers k such that a(k) > k).
Cf. A249433 (numbers k such that a(k) < k).
Cf. A249434 (numbers k such that a(k) >= k).
Cf. A249424 (numbers k such that a(k) = (k-1)/2).
Cf. A249428 (and the corresponding values, i.e. numbers n such that A249151(2n+1) = n).
Cf. A249425 (record positions).
Cf. A249427 (record values).

Programs

  • PARI
    A249151(n) = { my(uplim,padicvals,b); uplim = (n+3); padicvals = vector(uplim); for(k=0, n, b = binomial(n, k); for(i=1, uplim, padicvals[i] += valuation(b, prime(i)))); k = 1; while(k>0, for(i=1, uplim, if((padicvals[i] -= valuation(k, prime(i))) < 0, return(k-1))); k++); };
    \\ Alternative implementation:
    A001142(n) = prod(k=1, n, k^((k+k)-1-n));
    A055881(n) = { my(i); i=2; while((0 == (n%i)), n = n/i; i++); return(i-1); }
    A249151(n) = A055881(A001142(n));
    for(n=0, 4096, write("b249151.txt", n, " ", A249151(n)));
    
  • Python
    from itertools import count
    from collections import Counter
    from math import comb
    from sympy import factorint
    def A249151(n):
        p = sum((Counter(factorint(comb(n,i))) for i in range(n+1)),start=Counter())
        for m in count(1):
            f = Counter(factorint(m))
            if not f<=p:
                return m-1
            p -= f # Chai Wah Wu, Aug 19 2025
  • Scheme
    (define (A249151 n) (A055881 (A001142 n)))
    

Formula

a(n) = A055881(A001142(n)).

A064722 a(1) = 0; for n >= 2, a(n) = n - (largest prime <= n).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Oct 13 2001

Keywords

Examples

			a(26) = 26 - 23 = 3, a(37) = 37 - 37 = 0.
		

Crossrefs

Programs

  • Maple
    0, seq(n - prevprime(n+1), n=2..100); # Robert Israel, Aug 25 2014
  • Mathematica
    Join[{0},Table[n-NextPrime[n+1,-1],{n,2,110}]] (* Harvey P. Dale, Aug 23 2011 *)
  • PARI
    { for (n = 1, 1000, if (n>1, a=n - precprime(n), a=0); write("b064722.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 23 2009

Formula

a(n) = n - A007917(n).
a(n) = 0 iff n is 1 or a prime.
Computable also as a "commutator": pi(prime(m)) - prime(pi(m)) = A000720(A000040(m))-A000040(A000720(m)). Labels position of composites between 2 consecutive primes. - Labos Elemer, Oct 19 2001
a(n) = a(n-1)*0^A010051(n) + 1 - A010051(n), a(1) = 0. - Reinhard Zumkeller, Mar 23 2006
a(n) = n mod A007917(n). - Michel Marcus, Aug 22 2014
a(n) = A049711(n+1) - 1 for n >= 2. - Pontus von Brömssen, Jul 31 2022

A006990 Largest prime <= n!.

Original entry on oeis.org

2, 5, 23, 113, 719, 5039, 40289, 362867, 3628789, 39916787, 479001599, 6227020777, 87178291199, 1307674367953, 20922789887947, 355687428095941, 6402373705727959, 121645100408831899, 2432902008176639969, 51090942171709439969, 1124000727777607679927
Offset: 2

Views

Author

Keywords

Comments

Conjecture: For n >= 2, n! - a(n) is 1 or a prime, see A033933. - Amarnath Murthy, Mar 19 2002
a(n) is the largest prime divisor of (n!)! of the sequence A000197. - Stanislav Sykora, Jul 14 2014

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    PrevPrime[ n_Integer ] := Module[ {k = n - 1}, While[ ! PrimeQ[ k ], k-- ]; k ]; Table[ PrevPrime[ n! ], {n, 3, 25} ]
    Join[{2},NextPrime[Range[3,30]!,-1]] (* Harvey P. Dale, Jan 24 2014 *)

Extensions

More terms from Jud McCranie; also from Robert G. Wilson v, Jan 03 2001

A060265 Largest prime less than 2n.

Original entry on oeis.org

3, 5, 7, 7, 11, 13, 13, 17, 19, 19, 23, 23, 23, 29, 31, 31, 31, 37, 37, 41, 43, 43, 47, 47, 47, 53, 53, 53, 59, 61, 61, 61, 67, 67, 71, 73, 73, 73, 79, 79, 83, 83, 83, 89, 89, 89, 89, 97, 97, 101, 103, 103, 107, 109, 109, 113, 113, 113, 113, 113, 113, 113, 127, 127, 131
Offset: 2

Views

Author

Labos Elemer, Mar 23 2001

Keywords

Comments

a(n) = A007917(2*n) = A255313(n-1,1) = A255316(n-1,1) = A006530(A255427(n)). - Reinhard Zumkeller, Feb 22 2015

Crossrefs

Apart from initial term, same as A060308.

Programs

  • Haskell
    a060265 = a007917 . (* 2)  -- Reinhard Zumkeller, Feb 22 2015
  • Maple
    seq (prevprime(2*i+1), i=2..256);
  • Mathematica
    Table[NextPrime[2 n, -1], {n, 2, 66}] (* Michael De Vlieger, Jul 04 2016 *)
  • PARI
    a(n) = precprime(2*n-1) \\ Harry J. Smith, Jul 03 2009
    

A007409 Denominators of Sum_{k=1..n} 1/k^3.

Original entry on oeis.org

1, 8, 216, 1728, 216000, 24000, 8232000, 65856000, 16003008000, 16003008000, 21300003648000, 21300003648000, 46796108014656000, 46796108014656000, 46796108014656000, 374368864117248000, 1839274229408039424000
Offset: 1

Views

Author

Keywords

Comments

Largest prime factor in A007409(n) (n > 1) is A007917(n), occurring always to the power 3. - M. F. Hasler, Nov 10 2006

References

  • D. Y. Savio, E. A. Lamagna and S.-M. Liu, Summation of harmonic numbers, pp. 12-20 of E. Kaltofen and S. M. Watt, editors, Computers and Mathematics, Springer-Verlag, NY, 1989.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

A034808 Concatenation of 'prevprime(k) and k' is a prime.

Original entry on oeis.org

3, 9, 37, 39, 51, 63, 87, 89, 111, 117, 123, 153, 157, 163, 173, 177, 183, 207, 211, 213, 217, 219, 239, 249, 257, 263, 267, 269, 273, 277, 279, 289, 321, 323, 327, 333, 337, 339, 343, 359, 369, 379, 407, 423, 439, 441, 459, 471, 473, 477, 479, 489, 497, 513
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Comments

Since there are primes in the sequence, and concat(p,p) = p*(10^x+1) is always composite, it is clear that here the variant 2 (A151799(n) < n) of the prevprime function is used, rather than the variant 1 (A007917(n) <= n). - M. F. Hasler, Sep 09 2015

Examples

			n=333 -> previous prime is 331, thus '331333' is a prime.
		

Crossrefs

Programs

  • Mathematica
    coQ[n_]:=PrimeQ[FromDigits[Flatten[IntegerDigits[{NextPrime[n,-1],n}]]]]; Select[Range[3,513],coQ[#]&] (* Jayanta Basu, May 30 2013 *)
    Select[Range[2,550],PrimeQ[NextPrime[#,-1]*10^IntegerLength[#]+#]&] (* Harvey P. Dale, Nov 22 2020 *)
  • PARI
    isok(n)=n>2 && isprime(fromdigits(concat(digits(precprime(n-1)), digits(n)))) \\ Andrew Howroyd, Aug 13 2024
  • Python
    from sympy import isprime, prevprime
    def aupto(m):
      return [k for k in range(3, m+1) if isprime(int(str(prevprime(k))+str(k)))]
    print(aupto(513)) # Michael S. Branicky, Mar 09 2021
    

Extensions

Offset changed by Andrew Howroyd, Aug 13 2024

A055500 a(0)=1, a(1)=1, a(n) = largest prime <= a(n-1) + a(n-2).

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 11, 17, 23, 37, 59, 89, 139, 227, 359, 577, 929, 1499, 2423, 3919, 6337, 10253, 16573, 26821, 43391, 70207, 113591, 183797, 297377, 481171, 778541, 1259701, 2038217, 3297913, 5336129, 8633983, 13970093, 22604069, 36574151, 59178199, 95752333
Offset: 0

Views

Author

N. J. A. Sloane, Jul 08 2000

Keywords

Comments

Or might be called Ishikawa primes, as he proved that prime(n+2) < prime(n) + prime(n+1) for n > 1. This improves on Bertrand's Postulate (Chebyshev's theorem), which says prime(n+2) < prime(n+1) + prime(n+1). - Jonathan Sondow, Sep 21 2013

Examples

			a(8) = 23 because 23 is largest prime <= a(7) + a(6) = 17 + 11 = 28.
		

Crossrefs

Programs

  • Haskell
    a055500 n = a055500_list !! n
    a055500_list = 1 : 1 : map a007917
                   (zipWith (+) a055500_list $ tail a055500_list)
    -- Reinhard Zumkeller, May 01 2013
    
  • Mathematica
    PrevPrim[n_] := Block[ {k = n}, While[ !PrimeQ[k], k-- ]; Return[k]]; a[1] = a[2] = 1; a[n_] := a[n] = PrevPrim[ a[n - 1] + a[n - 2]]; Table[ a[n], {n, 1, 42} ]
    (* Or, if version >= 6 : *)a[0] = a[1] = 1; a[n_] := a[n] = NextPrime[ a[n-1] + a[n-2] + 1, -1]; Table[a[n], {n, 0, 100}](* Jean-François Alcover, Jan 12 2012 *)
    nxt[{a_,b_}]:={b,NextPrime[a+b+1,-1]}; Transpose[NestList[nxt,{1,1},40]] [[1]] (* Harvey P. Dale, Jul 15 2013 *)
  • Python
    from sympy import prevprime; L = [1, 1]
    for _ in range(36): L.append(prevprime(L[-2] + L[-1] + 1))
    print(*L, sep = ", ")  # Ya-Ping Lu, May 05 2023

Formula

a(n) is asymptotic to C*phi^n where phi = (1+sqrt(5))/2 and C = 0.41845009129953131631777132510164822489... - Benoit Cloitre, Apr 21 2003
a(n) = A007917(a(n-1) + a(n-2)) for n > 1. - Reinhard Zumkeller, May 01 2013
a(n) >= prime(n-1) for n > 1, by Ishikawa's theorem. - Jonathan Sondow, Sep 21 2013

A175851 a(n) = 1 for noncomposite n, a(n) = n - previousprime(n) + 1 for composite n.

Original entry on oeis.org

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

Views

Author

Jaroslav Krizek, Sep 29 2010

Keywords

Comments

Sequence is cardinal and not fractal. Cardinal sequence is sequence with infinitely many times occurring all natural numbers. Fractal sequence is sequence such that when the first instance of each number in the sequence is erased, the original sequence remains.
Ordinal transform of the nextprime function, A151800(1..) = 2, 3, 5, 5, 7, 7, 11, 11, 11, 11, ..., also ordinal transform of A304106. - Antti Karttunen, Jun 09 2018

Crossrefs

Cf. A065358 for another way of visualizing prime gaps.
Cf. A304106 (ordinal transform of this sequence).
Cf. A049711.

Programs

Formula

a(1) = 1, a(n) = n - A007917(n) + 1 for n >= 2. a(1) = 1, a(2) = 1, a(n) = n - A151799(n+1) + 1 for n >= 3.
a(n) = Sum_{i=1..n} floor(pi(i)/pi(n)), for n>1 with pi(n) = A000720(n). - Ridouane Oudra, Jun 24 2024
a(n) = A049711(n+1), for n>1. - Ridouane Oudra, Jul 16 2024

A059788 a(n) = largest prime < 2*prime(n).

Original entry on oeis.org

3, 5, 7, 13, 19, 23, 31, 37, 43, 53, 61, 73, 79, 83, 89, 103, 113, 113, 131, 139, 139, 157, 163, 173, 193, 199, 199, 211, 211, 223, 251, 257, 271, 277, 293, 293, 313, 317, 331, 337, 353, 359, 379, 383, 389, 397, 421, 443, 449, 457, 463, 467, 479, 499, 509, 523
Offset: 1

Views

Author

Labos Elemer, Feb 22 2001

Keywords

Comments

Also, smallest member of the first pair of consecutive primes such that between them is a composite number divisible by the n-th prime. - Amarnath Murthy, Sep 25 2002
Except for its initial term, A006992 is a subsequence based on iteration of n -> A151799(2n). The range of this sequence is a subset of A065091. - M. F. Hasler, May 08 2016

Examples

			n=18: p(18)=61, so a(18) is the largest prime below 2*61=122, which is 113.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    A059788 := proc(n)
        prevprime(2*ithprime(n)) ;
    end proc:
    seq(A059788(n),n=1..50) ; # R. J. Mathar, May 08 2016
  • Mathematica
    a[n_] := Prime[PrimePi[2Prime[n]]]
    NextPrime[2*Prime[Range[100]], -1] (* Zak Seidov, May 08 2016 *)
  • PARI
    a(n) = precprime(2*prime(n)); \\ Michel Marcus, May 08 2016

Formula

a(n) = A007917(A100484(n)). - R. J. Mathar, May 08 2016

A013633 nextprime(n) - prevprime(n).

Original entry on oeis.org

3, 2, 4, 2, 6, 4, 4, 4, 6, 2, 6, 4, 4, 4, 6, 2, 6, 4, 4, 4, 10, 6, 6, 6, 6, 6, 8, 2, 8, 6, 6, 6, 6, 6, 10, 4, 4, 4, 6, 2, 6, 4, 4, 4, 10, 6, 6, 6, 6, 6, 12, 6, 6, 6, 6, 6, 8, 2, 8, 6, 6, 6, 6, 6, 10, 4, 4, 4, 6, 2, 8, 6, 6, 6, 6, 6, 10, 4, 4
Offset: 3

Views

Author

Keywords

Examples

			a(3) = nextprime(3) - prevprime(3) = 5 - 2 = 3: This shows that here the variants 2 (A151800 and A151799) of the nextprime and precprime functions are used, rather than the variants A007918 and A007917. - _M. F. Hasler_, Sep 09 2015
		

Crossrefs

Programs

  • Maple
    [ seq(nextprime(i)-prevprime(i),i=3..100) ];
  • PARI
    A013633(n)=nextprime(n+1)-precprime(n-1) \\ M. F. Hasler, Sep 09 2015

Formula

a(n) = A151800(n) - A151799(n) = A007918(n+1) - A007917(n-1). - M. F. Hasler, Sep 09 2015
Previous Showing 21-30 of 133 results. Next