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

A276782 Where record values occur in A276781, when starting from A276781(2)=1.

Original entry on oeis.org

2, 6, 15, 22, 36, 58, 95, 96, 147, 148, 209, 210, 305, 306, 901, 902, 903, 904, 905, 906, 1149, 1150, 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 5621, 5622, 8499, 8500, 9585, 9586, 15719, 15720, 15721, 15722, 15723, 15724, 15725, 15726, 19653, 19654, 19655, 19656, 19657, 19658, 19659, 19660, 31449
Offset: 1

Views

Author

N. J. A. Sloane, Sep 29 2016

Keywords

Comments

Terms at the end of each run, that is, terms k that are not followed by k+1 (i.e., this excludes terms like 95, 147, 209, 901 .. 905, 1149, ...) form a subsequence of A181062. - Antti Karttunen, Jan 20 2020

Crossrefs

Programs

  • Maple
    A276781 := proc(n)
        local b,k;
        for b from 0 to floor(n/2+1) do
            igcd(seq(binomial(n,k),k=b..n-b)) ;
            if % > 1 then
                return b ;
            end if;
        end do:
    end proc:
    am := -1 ;
    for n from 2 do
        an := A276781(n) ;
        if an > am then
            printf("%d,\n",n) ;
            am := an ;
        end if;
    end do: # R. J. Mathar, Sep 30 2016
  • Mathematica
    Function[t, First@ Position[t, #] & /@ Range@ Max@ t][{0}~Join~Table[b = 1; While[GCD @@ Map[Binomial[n, #] &, Range[b, n - b]] == 1, b++]; b, {n, 2, 1500}]] // Flatten (* Michael De Vlieger, Oct 03 2016 *)
  • PARI
    A276781(n) = if(1==n,1,forstep(k=n,1,-1,if(isprimepower(k),return(1+n-k))));
    m=0; k=0; n=1; while(k<210,n++; if((t=A276781(n))>m, m=t; k++; print1(n, ", "))); \\ Antti Karttunen, Jan 29 2020

Extensions

a(11)-a(30) from R. J. Mathar, Sep 30 2016
More terms from Chai Wah Wu, Oct 02 2016
Definition amended because of the changed definition of A276781, while keeping the terms same as before. - Antti Karttunen, Jan 29 2020

A003418 Least common multiple (or LCM) of {1, 2, ..., n} for n >= 1, a(0) = 1.

Original entry on oeis.org

1, 1, 2, 6, 12, 60, 60, 420, 840, 2520, 2520, 27720, 27720, 360360, 360360, 360360, 720720, 12252240, 12252240, 232792560, 232792560, 232792560, 232792560, 5354228880, 5354228880, 26771144400, 26771144400, 80313433200, 80313433200, 2329089562800, 2329089562800
Offset: 0

Views

Author

Roland Anderson (roland.anderson(AT)swipnet.se)

Keywords

Comments

The minimal exponent of the symmetric group S_n, i.e., the least positive integer for which x^a(n)=1 for all x in S_n. - Franz Vrabec, Dec 28 2008
Product over all primes of highest power of prime less than or equal to n. a(0) = 1 by convention.
Also smallest number whose set of divisors contains an n-term arithmetic progression. - Reinhard Zumkeller, Dec 09 2002
An assertion equivalent to the Riemann hypothesis is: | log(a(n)) - n | < sqrt(n) * log(n)^2. - Lekraj Beedassy, Aug 27 2006. (This is wrong for n = 1 and n = 2. Should "for n large enough" be added? - Georgi Guninski, Oct 22 2011)
Corollary 3 of Farhi gives a proof that a(n) >= 2^(n-1). - Jonathan Vos Post, Jun 15 2009
Appears to be row products of the triangle T(n,k) = b(A010766) where b = A130087/A130086. - Mats Granvik, Jul 08 2009
Greg Martin (see link) proved that "the product of the Gamma function sampled over the set of all rational numbers in the open interval (0,1) whose denominator in lowest terms is at most n" equals (2*Pi)^(1/2)*a(n)^(-1/2). - Jonathan Vos Post, Jul 28 2009
a(n) = lcm(A188666(n), A188666(n)+1, ..., n). - Reinhard Zumkeller, Apr 25 2011
a(n+1) is the smallest integer such that all polynomials a(n+1)*(1^i + 2^i + ... + m^i) in m, for i=0,1,...,n, are polynomials with integer coefficients. - Vladimir Shevelev, Dec 23 2011
It appears that A020500(n) = a(n)/a(n-1). - Asher Auel, corrected by Bill McEachen, Apr 05 2024
n-th distinct value = A051451(n). - Matthew Vandermast, Nov 27 2009
a(n+1) = least common multiple of n-th row in A213999. - Reinhard Zumkeller, Jul 03 2012
For n > 2, (n-1) = Sum_{k=2..n} exp(a(n)*2*i*Pi/k). - Eric Desbiaux, Sep 13 2012
First column minus second column of A027446. - Eric Desbiaux, Mar 29 2013
For n > 0, a(n) is the smallest number k such that n is the n-th divisor of k. - Michel Lagneau, Apr 24 2014
Slowest growing integer > 0 in Z converging to 0 in Z^ when considered as profinite integer. - Herbert Eberle, May 01 2016
What is the largest number of consecutive terms that are all equal? I found 112 equal terms from a(370261) to a(370372). - Dmitry Kamenetsky, May 05 2019
Answer: there exist arbitrarily long sequences of consecutive terms with the same value; also, the maximal run of consecutive terms with different values is 5 from a(1) to a(5) (see link Roger B. Eggleton). - Bernard Schott, Aug 07 2019
Related to the inequality (54) in Ramanujan's paper about highly composite numbers A002182, also used in A199337: a(A329570(m))^2 is a (not minimal) bound above which all highly composite numbers are divisible by m, according to the right part of that inequality. - M. F. Hasler, Jan 04 2020
For n > 2, a(n) is of the form 2^e_1 * p_2^e_2 * ... * p_m^e_m, where e_m = 1 and e = floor(log_2(p_m)) <= e_1. Therefore, 2^e * p_m^e_m is a primitive Zumkeler number (A180332). Therefore, 2^e_1 * p_m^e_m is a Zumkeller number (A083207). Therefore, for n > 2, a(n) = 2^e_1 * p_m^e_m * r, where r is relatively prime to 2*p_m, is a Zumkeller number (see my proof at A002182 for details). - Ivan N. Ianakiev, May 10 2020
For n > 1, 2|(a(n)+2) ... n|(a(n)+n), so a(n)+2 .. a(n)+n are all composite and (part of) a prime gap of at least n. (Compare n!+2 .. n!+n). - Stephen E. Witham, Oct 09 2021

Examples

			LCM of {1,2,3,4,5,6} = 60. The primes up to 6 are 2, 3 and 5. floor(log(6)/log(2)) = 2 so the exponent of 2 is 2.
floor(log(6)/log(3)) = 1 so the exponent of 3 is 1.
floor(log(6)/log(5)) = 1 so the exponent of 5 is 1. Therefore, a(6) = 2^2 * 3^1 * 5^1 = 60. - _David A. Corneth_, Jun 02 2017
		

References

  • J. M. Borwein and P. B. Borwein, Pi and the AGM, Wiley, 1987, p. 365.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Row products of A133233.
Cf. A025528 (number of prime factors of a(n) with multiplicity).
Cf. A275120 (lengths of runs of consecutive equal terms), A276781 (ordinal transform from term a(1)=1 onward).

Programs

  • Haskell
    a003418 = foldl lcm 1 . enumFromTo 2
    -- Reinhard Zumkeller, Apr 04 2012, Apr 25 2011
    
  • Magma
    [1] cat [Exponent(SymmetricGroup(n)) : n in [1..28]]; // Arkadiusz Wesolowski, Sep 10 2013
    
  • Magma
    [Lcm([1..n]): n in [0..30]]; // Bruno Berselli, Feb 06 2015
    
  • Maple
    A003418 := n-> lcm(seq(i,i=1..n));
    HalfFarey := proc(n) local a,b,c,d,k,s; a := 0; b := 1; c := 1; d := n; s := NULL; do k := iquo(n + b, d); a, b, c, d := c, d, k*c - a, k*d - b; if 2*a > b then break fi; s := s,(a/b); od: [s] end: LCM := proc(n) local i; (1/2)*mul(2*sin(Pi*i),i=HalfFarey(n))^2 end: # Peter Luschny
    # next Maple program:
    a:= proc(n) option remember; `if`(n=0, 1, ilcm(n, a(n-1))) end:
    seq(a(n), n=0..33);  # Alois P. Heinz, Jun 10 2021
  • Mathematica
    Table[LCM @@ Range[n], {n, 1, 40}] (* Stefan Steinerberger, Apr 01 2006 *)
    FoldList[ LCM, 1, Range@ 28]
    A003418[0] := 1; A003418[1] := 1; A003418[n_] := A003418[n] = LCM[n,A003418[n-1]]; (* Enrique Pérez Herrero, Jan 08 2011 *)
    Table[Product[Prime[i]^Floor[Log[Prime[i], n]], {i, PrimePi[n]}], {n, 0, 28}] (* Wei Zhou, Jun 25 2011 *)
    Table[Product[Cyclotomic[n, 1], {n, 2, m}], {m, 0, 28}] (* Fred Daniel Kline, May 22 2014 *)
    a1[n_] := 1/12 (Pi^2+3(-1)^n (PolyGamma[1,1+n/2] - PolyGamma[1,(1+n)/2])) // Simplify
    a[n_] := Denominator[Sqrt[a1[n]]];
    Table[If[IntegerQ[a[n]], a[n], a[n]*(a[n])[[2]]], {n, 0, 28}] (* Gerry Martens, Apr 07 2018 [Corrected by Vaclav Kotesovec, Jul 16 2021] *)
  • PARI
    a(n)=local(t); t=n>=0; forprime(p=2,n,t*=p^(log(n)\log(p))); t
    
  • PARI
    a(n)=if(n<1,n==0,1/content(vector(n,k,1/k)))
    
  • PARI
    a(n)=my(v=primes(primepi(n)),k=sqrtint(n),L=log(n+.5));prod(i=1,#v,if(v[i]>k,v[i],v[i]^(L\log(v[i])))) \\ Charles R Greathouse IV, Dec 21 2011
    
  • PARI
    a(n)=lcm(vector(n,i,i)) \\ Bill Allombert, Apr 18 2012 [via Charles R Greathouse IV]
    
  • PARI
    n=1; lim=100; i=1; j=1; until(n==lim, a=lcm(j,i+1); i++; j=a; n++; print(n" "a);); \\ Mike Winkler, Sep 07 2013
    
  • Python
    from functools import reduce
    from operator import mul
    from sympy import sieve
    def integerlog(n,b): # find largest integer k>=0 such that b^k <= n
        kmin, kmax = 0,1
        while b**kmax <= n:
            kmax *= 2
        while True:
            kmid = (kmax+kmin)//2
            if b**kmid > n:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return kmin
    def A003418(n):
        return reduce(mul,(p**integerlog(n,p) for p in sieve.primerange(1,n+1)),1) # Chai Wah Wu, Mar 13 2021
    
  • Python
    # generates initial segment of sequence
    from math import gcd
    from itertools import accumulate
    def lcm(a, b): return a * b // gcd(a, b)
    def aupton(nn): return [1] + list(accumulate(range(1, nn+1), lcm))
    print(aupton(30)) # Michael S. Branicky, Jun 10 2021
  • Sage
    [lcm(range(1,n)) for n in range(1, 30)] # Zerinvary Lajos, Jun 06 2009
    
  • Scheme
    (define (A003418 n) (let loop ((n n) (m 1)) (if (zero? n) m (loop (- n 1) (lcm m n))))) ;; Antti Karttunen, Jan 03 2018
    

Formula

The prime number theorem implies that lcm(1,2,...,n) = exp(n(1+o(1))) as n -> infinity. In other words, log(lcm(1,2,...,n))/n -> 1 as n -> infinity. - Jonathan Sondow, Jan 17 2005
a(n) = Product (p^(floor(log n/log p))), where p runs through primes not exceeding n (i.e., primes 2 through A007917(n)). - Lekraj Beedassy, Jul 27 2004
Greg Martin showed that a(n) = lcm(1,2,3,...,n) = Product_{i = Farey(n), 0 < i < 1} 2*Pi/Gamma(i)^2. This can be rewritten (for n > 1) as a(n) = (1/2)*(Product_{i = Farey(n), 0 < i <= 1/2} 2*sin(i*Pi))^2. - Peter Luschny, Aug 08 2009
Recursive formula useful for computations: a(0)=1; a(1)=1; a(n)=lcm(n,a(n-1)). - Enrique Pérez Herrero, Jan 08 2011
From Enrique Pérez Herrero, Jun 01 2011: (Start)
a(n)/a(n-1) = A014963(n).
if n is a prime power p^k then a(n)=a(p^k)=p*a(n-1), otherwise a(n)=a(n-1).
a(n) = Product_{k=2..n} (1 + (A007947(k)-1)*floor(1/A001221(k))), for n > 1. (End)
a(n) = A079542(n+1, 2) for n > 1.
a(n) = exp(Sum_{k=1..n} Sum_{d|k} moebius(d)*log(k/d)). - Peter Luschny, Sep 01 2012
a(n) = A025529(n) - A027457(n). - Eric Desbiaux, Mar 14 2013
a(n) = exp(Psi(n)) = 2 * Product_{k=2..A002088(n)} (1 - exp(2*Pi*i * A038566(k+1) / A038567(k))), where i is the imaginary unit, and Psi the second Chebyshev's function. - Eric Desbiaux, Aug 13 2014
a(n) = A064446(n)*A038610(n). - Anthony Browne, Jun 16 2016
a(n) = A000142(n) / A025527(n) = A000793(n) * A225558(n). - Antti Karttunen, Jun 02 2017
log(a(n)) = Sum_{k>=1} (A309229(n, k)/k - 1/k). - Mats Granvik, Aug 10 2019
From Petros Hadjicostas, Jul 24 2020: (Start)
Nair (1982) proved that 2^n <= a(n) <= 4^n for n >= 9. See also Farhi (2009). Nair also proved that
a(n) = lcm(m*binomial(n,m): 1 <= m <= n) and
a(n) = gcd(a(m)*binomial(n,m): n/2 <= m <= n). (End)
Sum_{n>=1} 1/a(n) = A064859. - Bernard Schott, Aug 24 2020

A065514 Largest power of a prime < prime(n).

Original entry on oeis.org

1, 2, 4, 5, 9, 11, 16, 17, 19, 27, 29, 32, 37, 41, 43, 49, 53, 59, 64, 67, 71, 73, 81, 83, 89, 97, 101, 103, 107, 109, 125, 128, 131, 137, 139, 149, 151, 157, 163, 169, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 243, 256, 257, 263, 269, 271
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 27 2001

Keywords

Crossrefs

Starting with n instead of prime(n) gives A031218 (A377282, A377782).
The squarefree version is A112925 (A070321, A378038).
The opposite squarefree version is A112926 (A378037, restriction of A067535).
Difference from prime(n) is A377289 (restriction of A276781, opposite A377281).
First differences are A377781.
The nonsquarefree version is A378032 (A377783 (restriction of A378033), A378034, A378040).
The perfect power version is A378035.
A000015 gives the least prime power >= n, differences A377780.
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.
A345531 gives the least prime power > prime(n), differences A377703.
Prime powers between primes: A053607, A080101, A304521, A366833, A377057, A377286.

Programs

  • Mathematica
    lpp[n_]:=Module[{k=n-1},While[!PrimePowerQ[k],k--];k]; Join[{1},Table[ lpp[ n],{n,Prime[Range[2,60]]}]] (* Harvey P. Dale, Nov 24 2018 *)
  • Python
    from sympy import factorint, prime
    def A065514(n): return next(filter(lambda m:len(factorint(m))<=1, range(prime(n)-1,0,-1))) # Chai Wah Wu, Oct 25 2024

Extensions

Name edited (1 is technically not a prime power even though it is a power of a prime) by Gus Wiseman, Dec 03 2024.

A080101 Number of prime powers in all composite numbers between n-th prime and next prime.

Original entry on oeis.org

0, 1, 0, 2, 0, 1, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 28 2003

Keywords

Comments

The maximum value of terms in the sequence, through the (10^5)th term, is 2. - Harvey P. Dale, Aug 24 2014
This is conjectured to be the maximum, see also A366833. - Gus Wiseman, Nov 06 2024

Examples

			There are two prime powers between 2179 = A000040(327) and 2203 = A000040(328): 2187 = 3^7 and 2197 = 13^3, therefore a(327) = 2, A080102(327) = 2187 and A080103(327) = 2197.
		

Crossrefs

For powers of 2 instead of primes we have A244508, see also A013597, A014210, A014234, A304521.
Adding one gives A366833.
For non-prime-powers instead of prime-powers we have A368748.
Positions of positive terms are A377057, primes A053607.
Positions of 0 are A377286.
Positions of 1 are A377287.
Positions of 2 are A377288, primes A053706.
For perfect-powers (instead of prime-powers) we have A377432.
A000015 gives the least prime-power >= n, difference A377282.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820, seconds A376596.
A031218 gives the greatest prime-power <= n, difference A276781.
A046933(n) counts the interval from A008864(n) to A006093(n+1).
A065514 gives the greatest prime-power < prime(n), difference A377289.
A246655 lists the prime-powers not including 1, complement A361102.
A345531 gives the least prime-power > prime(n), difference A377281.

Programs

  • Maple
    a := proc(n) local c, k, p: c, p := 0, ithprime(n): for k from p+1 to nextprime(p)-1 do if nops(numtheory:-factorset(k)) = 1 then c := c+1: fi: od: c: end:
    seq(a(n), n = 1 .. 105); # Lorenzo Sauras Altuzarra, Jul 08 2022
  • Mathematica
    prpwQ[n_]:=Module[{fi=FactorInteger[n]},Length[fi]==1&&fi[[1,2]]>1]; nn=600;With[{pwrs=Table[If[prpwQ[n],1,0],{n,nn}]},Table[Total[ Take[ pwrs,{Prime[n],Prime[n+1]}]],{n,PrimePi[nn]-1}]] (* Harvey P. Dale, Aug 24 2014 *)
    Table[Length[Select[Range[Prime[n]+1,Prime[n+1]-1],PrimePowerQ]],{n,30}] (* Gus Wiseman, Nov 06 2024 *)

Formula

a(n) = A366833(n) - 1. - Gus Wiseman, Nov 06 2024

A025528 Number of prime powers <= n with exponents > 0 (A246655).

Original entry on oeis.org

0, 1, 2, 3, 4, 4, 5, 6, 7, 7, 8, 8, 9, 9, 9, 10, 11, 11, 12, 12, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 21, 21, 21, 21, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 28, 29, 29, 30, 30
Offset: 1

Views

Author

Keywords

Comments

a(n) is the sum of the exponents in the prime factorization of lcm{1,2,...,n}.
Larger than but analogous to Pi(n).
Counts A000961 without 1=prime^0: a(n)=A065515(n)-1. - Reinhard Zumkeller, Jul 03 2003
Equally, number of finite fields of order <= n. - Neven Juric, Feb 05 2010

Examples

			Below 100 there are 25 primes and 25 + 10 = 35 prime powers.
		

References

  • G. Tenenbaum, Introduction à la théorie analytique et probabiliste des nombres, p. 203, Publications de l'Institut Cartan, 1990.

Crossrefs

Cf. A000961, A000040, A000720, A001221, A003418, A141228, A246655, A276781 (ordinal transform).
One less than A065515.

Programs

  • Mathematica
    primePowerPi[n_] := Sum[PrimePi[n^(1/k)], {k, Log[2, n]}]; Table[primePowerPi[n], {n, 75}] (* Geoffrey Critzer, Jan 07 2012 *) (* and modified by Robert G. Wilson v, Jan 07 2012 *)
    Table[Sum[Boole[1 < Cyclotomic[n, 1]], {n, 1, m}], {m, 1, 75}] (* Fred Daniel Kline, Oct 03 2016 *)
  • PARI
    for(n=1,100,print1(sum(k=1,n,logint(n,prime(k))),",")) \\ corrected by Luc Rousseau, Jan 04 2018
    
  • PARI
    a(n)=sum(i=1,n,if(omega(i)-1,0,1))
    
  • PARI
    a(n)=n+=.5;sum(e=1,log(n)\log(2),primepi(n^(1/e))) \\ Charles R Greathouse IV, Apr 30 2012
    
  • Python
    from sympy import primepi, integer_nthroot
    def A025528(n): return sum(primepi(integer_nthroot(n,k)[0]) for k in range(1,n.bit_length())) # Chai Wah Wu, Aug 15 2024
  • SageMath
    def A025528(n) : return sum([1 for k in (0..n) if is_prime_power(k)])
    print([A025528(n)  for n in (1..74)]) # Peter Luschny, Nov 18 2019
    

Formula

a(n) = Cardinality[{1..n}|A001221(i)=1].
a(n) = Sum_{p prime <= n} floor(log(n)/log(p)). - Benoit Cloitre, Apr 30 2002
a(n) ~ n/log(n). - Benoit Cloitre, May 30 2003
a(n) = A069637(n) + A000720(n). - Mohammed Bouayoun (bouyao(AT)wanadoo.fr), Feb 24 2004 [Corrected by Franklin T. Adams-Watters, Jun 08 2008]
a(n) = A000720(n) + A000720(floor(n^(1/2))) + A000720(floor(n^(1/3))) + ... - Max Alekseyev, May 11 2009
Partial sums of A069513. - Enrique Pérez Herrero, May 30 2011
a(n) = A001222(A003418(n)). - Luc Rousseau, Jan 05 2018
From Steven Foster Clark, Sep 26 2018: (Start)
a(n) = Sum_{m=1..n} A001222(m) * A002321(floor(n/m)) where A001222() is the Omega function and A002321() is the Mertens function.
a(n) = Sum_{m=1..floor(log_2(n))} A000010(m)/m * J(floor(n^(1/m))) where A000010() is Euler's totient function and J(n) = Sum_{m=1..floor(log_2(n))} 1/m * A000720(floor(n^(1/m))) is Riemann's prime-power counting function.
(End)

Extensions

New description from Labos Elemer, Nov 09 2000

A366833 Number of times n appears in A362965 (number of primes <= the n-th prime power).

Original entry on oeis.org

1, 2, 1, 3, 1, 2, 1, 1, 3, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Paolo Xausa, Oct 25 2023

Keywords

Comments

Conjecture: a(n) can be only 1, 2, or 3 (with the first occurrences of 3 appearing at n = 4, 9, 30, 327 and 3512).
One less than the number of prime powers between prime(n) and prime(n+1), inclusive. - Gus Wiseman, Jan 09 2025

Crossrefs

Run lengths of A362965.
Subtracting one gives A080101.
For non prime powers we have A368748.
Positions of terms > 1 are A377057.
Positions of 1 are A377286.
Positions of 2 are A377287.
For perfect powers we have A377432.
For squarefree we have A373198.
A000015 gives the least prime power >= n, difference A377282.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
A031218 gives the greatest prime power <= n, difference A276781.
A046933(n) counts the interval from A008864(n) to A006093(n+1).
A246655 lists the prime powers not including 1.
A366835 counts primes between prime powers.

Programs

  • Mathematica
    With[{upto=1000},Map[Length,Most[Split[PrimePi[Select[Range[upto],PrimePowerQ]]]]]] (* Considers prime powers up to 1000 *)

Formula

a(n) = A080101(n) + 1. - Gus Wiseman, Jan 09 2025

A377289 Difference between prime(n) and the previous prime-power (exclusive).

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 1, 2, 4, 2, 2, 5, 4, 2, 4, 4, 6, 2, 3, 4, 2, 6, 2, 6, 8, 4, 2, 4, 2, 4, 2, 3, 6, 2, 10, 2, 6, 6, 4, 4, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 8, 1, 6, 6, 2, 6, 4, 2, 4, 14, 4, 2, 4, 14, 6, 4, 2, 4, 6, 6, 6, 6, 4, 6, 8, 4, 8, 10, 2, 10, 2
Offset: 1

Views

Author

Gus Wiseman, Oct 23 2024

Keywords

Examples

			The twelfth prime is 37, with previous prime-power 32, so a(12) = 5.
		

Crossrefs

For powers of two see A013597, A014210, A014234, A244508, A304521.
For prime instead of prime-power we have A075526.
This is the restriction of A276781 (shifted right) to the primes.
For next instead of previous prime-power we have A377281, restriction of A377282.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820, complement A361102.
A031218 gives the greatest prime-power <= n.
A065514 gives the greatest prime-power < prime(n).
A080101 counts prime-powers between primes (exclusive), cf. A377286, A377287, A377288.
A246655 lists the prime-powers not including 1.

Programs

  • Mathematica
    Table[Prime[n]-NestWhile[#-1&, Prime[n]-1,#>1&&!PrimePowerQ[#]&],{n,100}]
  • Python
    from sympy import prime, factorint
    def A377289(n): return (p:=prime(n))-next(filter(lambda m:len(factorint(m))<=1, range(p-1,0,-1))) # Chai Wah Wu, Oct 25 2024

Formula

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

A377436 Numbers k such that there is no perfect-power x in the range prime(k) < x < prime(k+1).

Original entry on oeis.org

1, 3, 5, 7, 8, 10, 12, 13, 14, 16, 17, 19, 20, 21, 23, 24, 26, 27, 28, 29, 32, 33, 35, 36, 37, 38, 40, 41, 42, 43, 45, 46, 49, 50, 51, 52, 55, 56, 57, 58, 59, 60, 62, 63, 64, 65, 67, 69, 70, 71, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 86, 87, 88, 89, 90
Offset: 1

Views

Author

Gus Wiseman, Nov 02 2024

Keywords

Comments

Perfect-powers (A001597) are numbers with a proper integer root, complement A007916.

Examples

			Primes 8 and 9 are 19 and 23, and the interval (20,21,22) contains no prime-powers, so 8 is in the sequence.
		

Crossrefs

For powers of 2 instead of primes see A377467, A013597, A014210, A014234, A244508.
For squarefree instead of perfect-power we have A068360, see A061398, A377430, A377431.
For just squares (instead of all perfect-powers) we have A221056, primes A224363.
For prime-powers (instead of perfect-powers) we have A377286.
These are the positions of 0 in A377432.
For one instead of none we have A377434, for prime-powers A377287.
For two instead of none we have A377466, for prime-powers A377288, primes A053706.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A046933 counts the interval from A008864(n) to A006093(n+1).
A065514 gives the nearest prime-power before prime(n)-1, difference A377289.
A080101 and A366833 count prime-powers between primes, see A377057, A053607, A304521.
A081676 gives the nearest perfect-power up to n.
A246655 lists the prime-powers not including 1, complement A361102.
A377468 gives the nearest perfect-power after n.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Select[Range[100],Length[Select[Range[Prime[#]+1, Prime[#+1]-1],perpowQ]]==0&]

A377281 Difference between the n-th prime and the next prime-power (exclusive).

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 2, 4, 2, 2, 1, 4, 2, 4, 2, 6, 2, 3, 4, 2, 6, 2, 6, 8, 4, 2, 4, 2, 4, 8, 1, 6, 2, 10, 2, 6, 6, 4, 2, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 2, 5, 6, 6, 2, 6, 4, 2, 6, 14, 4, 2, 4, 14, 6, 6, 2, 4, 6, 2, 6, 6, 4, 6, 8, 4, 8, 10, 2, 10, 2, 6
Offset: 1

Views

Author

Gus Wiseman, Oct 23 2024

Keywords

Examples

			The twelfth prime is 37, with next prime-power 41, so a(12) = 4.
		

Crossrefs

For prime instead of prime-power we have A001223.
For powers of two instead of primes we have A013597, A014210, A014234, A244508, A304521.
This is the restriction of A377282 to the prime numbers.
For previous instead of next prime-power we have A377289, restriction of A276781.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820, complement A361102.
A031218 gives the greatest prime-power <= n.
A080101 counts prime-powers between primes (exclusive), cf. A377286, A377287, A377288.
A246655 lists the prime-powers not including 1.

Programs

  • Mathematica
    Table[NestWhile[#+1&,Prime[n]+1,!PrimePowerQ[#]&]-Prime[n],{n,100}]
  • Python
    from itertools import count
    from sympy import prime, factorint
    def A377281(n): return -(p:=prime(n))+next(filter(lambda m:len(factorint(m))<=1, count(p+1))) # Chai Wah Wu, Oct 25 2024

Formula

a(n) = A000015(prime(n)) - prime(n).
a(n) = A345531(n) - prime(n).
a(n) = A377282(prime(n)).

A377287 Numbers k such that there is exactly one prime-power between prime(k)+1 and prime(k+1)-1.

Original entry on oeis.org

2, 6, 11, 15, 18, 22, 31, 39, 53, 54, 61, 68, 72, 97, 99, 114, 129, 146, 162, 172, 217, 219, 263, 283, 309, 329, 357, 409, 445, 487, 519, 564, 609, 656, 675, 705, 811, 847, 882, 886, 1000, 1028, 1163, 1252, 1294, 1381, 1423, 1457, 1523, 1715, 1821, 1877, 1900
Offset: 1

Views

Author

Gus Wiseman, Oct 25 2024

Keywords

Examples

			Primes 18 and 19 are 61 and 67, and the interval (62, 63, 64, 65, 66) contains only the one prime-power 64, so 18 is in the sequence.
		

Crossrefs

The interval from A008864(n) to A006093(n+1) has A046933(n) elements.
For powers of 2 instead of primes see A013597, A014210, A014234, A244508, A304521.
The nearest prime-power before prime(n)-1 is A065514, difference A377289.
The nearest prime-power after prime(n)+1 is A345531, difference A377281.
These are the positions of 1 in A080101, or 2 in A366833.
For at least one prime-power we have A377057, primes A053607.
For no prime-powers we have A377286.
For two prime-powers we have A377288, primes A053706.
For squarefree instead of prime-power see A377430, A061398, A377431, A068360.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A031218 gives the greatest prime-power <= n.
A246655 lists the prime-powers not including 1, complement A361102.

Programs

  • Mathematica
    Select[Range[100],Length[Select[Range[Prime[#]+1,Prime[#+1]-1],PrimePowerQ]]==1&]
  • Python
    from itertools import count, islice
    from sympy import factorint, nextprime
    def A377287_gen(): # generator of terms
        p, q, k = 2, 3, 1
        for k in count(1):
            if sum(1 for i in range(p+1,q) if len(factorint(i))<=1)==1:
                yield k
            p, q = q, nextprime(q)
    A377287_list = list(islice(A377287_gen(),53)) # Chai Wah Wu, Oct 28 2024
Showing 1-10 of 25 results. Next