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

A056171 a(n) = pi(n) - pi(floor(n/2)), where pi is A000720.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Jul 27 2000

Keywords

Comments

Also, the number of unitary prime divisors of n!. A prime divisor of n is unitary iff its exponent is 1 in the prime power factorization of n. In general, gcd(p, n/p) = 1 or p. Here we count the cases when gcd(p, n/p) = 1.
A unitary prime divisor of n! is >= n/2, hence their number is pi(n) - pi(n/2). - Peter Luschny, Mar 13 2011
See also the references and links mentioned in A143227. - Jonathan Sondow, Aug 03 2008
From Robert G. Wilson v, Mar 20 2017: (Start)
First occurrence of k is at n = A080359(k).
The last occurrence of k is at n = A080360(k).
The number of times k appears is A080362(k). (End)
Lev Schnirelmann proved that for every n, a(n) > (1/log_2(n))*(n/3 - 4*sqrt(n)) - 1 - (3/2)*log_2(n). - Arkadiusz Wesolowski, Nov 03 2017

Examples

			10! = 2^8 * 3^2 * 5^2 * 7. The only unitary prime divisor is 7, so a(10) = 1.
		

References

  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 214.

Crossrefs

Programs

  • Maple
    A056171 := proc(x)
         numtheory[pi](x)-numtheory[pi](floor(x/2)) ;
    end proc:
    seq(A056171(n),n=1..130) ; # N. J. A. Sloane, Sep 01 2015
    A056171 := n -> nops(select(isprime,[$iquo(n,2)+1..n])):
    seq(A056171(i),i=1..98); # Peter Luschny, Mar 13 2011
  • Mathematica
    s=0; Table[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; s, {k,100}]
    Table[PrimePi[n]-PrimePi[Floor[n/2]],{n,100}] (* Harvey P. Dale, Sep 01 2015 *)
  • PARI
    A056171=n->primepi(n)-primepi(n\2) \\ M. F. Hasler, Dec 31 2016
    
  • Python
    from sympy import primepi
    [primepi(n) - primepi(n//2) for n in range(1,151)] # Indranil Ghosh, Mar 22 2017
    
  • Sage
    [prime_pi(n)-prime_pi(floor(n/2)) for n in range(1,99)] # Stefano Spezia, Apr 22 2025

Formula

a(n) = A000720(n) - A056172(n). - Robert G. Wilson v, Apr 09 2017
a(n) = A056169(n!). - Amiram Eldar, Jul 24 2024

Extensions

Definition simplified by N. J. A. Sloane, Sep 01 2015

A063956 Sum of unitary prime divisors of n.

Original entry on oeis.org

0, 2, 3, 0, 5, 5, 7, 0, 0, 7, 11, 3, 13, 9, 8, 0, 17, 2, 19, 5, 10, 13, 23, 3, 0, 15, 0, 7, 29, 10, 31, 0, 14, 19, 12, 0, 37, 21, 16, 5, 41, 12, 43, 11, 5, 25, 47, 3, 0, 2, 20, 13, 53, 2, 16, 7, 22, 31, 59, 8, 61, 33, 7, 0, 18, 16, 67, 17, 26, 14, 71, 0, 73, 39, 3, 19, 18, 18, 79, 5, 0
Offset: 1

Views

Author

Labos Elemer, Sep 04 2001

Keywords

Examples

			The prime divisors of 420 = 2^2 * 3 * 5 * 7. Among them, those that have exponent 1 (i.e., unitary prime divisors) are {3, 5, 7}, so a(420) = 3 + 5 + 7 = 15.
		

Crossrefs

Programs

  • Mathematica
    Table[DivisorSum[n, # &, And[PrimeQ@ #, GCD[#, n/#] == 1] &], {n, 81}] (* Michael De Vlieger, Feb 17 2019 *)
    f[p_, e_] := If[e == 1, p, 0]; a[1] = 0; a[n_] := Plus @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jul 24 2024 *)
    Join[{0},Table[Total[Select[FactorInteger[n],#[[2]]==1&][[;;,1]]],{n,2,100}]] (* Harvey P. Dale, Jan 26 2025 *)
  • PARI
    { for (n=1, 1000, f=factor(n)~; a=0; for (i=1, length(f), if (f[2, i]==1, a+=f[1, i])); write("b063956.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 04 2009

Formula

a(n*m) = a(n) + a(m) - a(gcd(n^2, m)) - a(gcd(n, m^2)) for all n and m > 0 (conjecture). - Velin Yanev, Feb 17 2019
From Amiram Eldar, Jul 24 2024: (Start)
a(n) = A008472(n) - A063958(n).
Additive with a(p^e) = p is e = 1, and 0 otherwise. (End)

Extensions

Example clarified by Harvey P. Dale, Jan 26 2025

A336499 Irregular triangle read by rows where T(n,k) is the number of divisors of n! with distinct prime multiplicities and a total of k prime factors, counted with multiplicity.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 0, 1, 2, 1, 2, 1, 1, 3, 1, 3, 2, 0, 1, 3, 2, 5, 3, 3, 2, 1, 1, 4, 2, 7, 4, 4, 3, 2, 0, 1, 4, 2, 7, 4, 5, 7, 7, 6, 3, 2, 0, 1, 4, 2, 8, 8, 9, 10, 11, 11, 7, 8, 5, 2, 0, 1, 4, 3, 11, 8, 11, 16, 16, 15, 15, 15, 13, 9, 6, 3, 1, 1, 5, 3, 14, 10, 13, 21, 21, 20, 19, 21, 18, 13, 9, 5, 2, 0
Offset: 0

Views

Author

Gus Wiseman, Aug 03 2020

Keywords

Comments

Row lengths are A022559(n) + 1.

Examples

			Triangle begins:
  1
  1
  1  1
  1  2  0
  1  2  1  2  1
  1  3  1  3  2  0
  1  3  2  5  3  3  2  1
  1  4  2  7  4  4  3  2  0
  1  4  2  7  4  5  7  7  6  3  2  0
  1  4  2  8  8  9 10 11 11  7  8  5  2  0
  1  4  3 11  8 11 16 16 15 15 15 13  9  6  3  1
  1  5  3 14 10 13 21 21 20 19 21 18 13  9  5  2  0
  1  5  3 14 10 14 25 23 27 24 30 28 28 25 20 16 11  5  2  0
Row n = 7 counts the following divisors:
  1  2  4  8   16  48   144  720   {}
     3  9  12  24  72   360  1008
     5     18  40  80   504
     7     20  56  112
           28
           45
           63
		

Crossrefs

A000720 is column k = 1.
A022559 gives row lengths minus one.
A056172 appears to be column k = 2.
A336414 gives row sums.
A336420 is the version for superprimorials.
A336498 is the version counting all divisors.
A336865 is the generalization to non-factorials.
A336866 lists indices of rows with a final 1.
A336867 lists indices of rows with a final 0.
A336868 gives the final terms in each row.
A000110 counts divisors of superprimorials with distinct prime exponents.
A008302 counts divisors of superprimorials by number of prime factors.
A130091 lists numbers with distinct prime exponents.
A181796 counts divisors with distinct prime exponents.
A327498 gives the maximum divisor of n with distinct prime exponents.

Programs

  • Mathematica
    Table[Length[Select[Divisors[n!],PrimeOmega[#]==k&&UnsameQ@@Last/@FactorInteger[#]&]],{n,0,6},{k,0,PrimeOmega[n!]}]

A076471 Number of pairs (p,q) of successive primes with p+q<=n.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 14 2002

Keywords

Examples

			Pairs (p,q) of successive primes with p+q<=27: {(2,3), (3,5), (5,7), (7,11), (11,13)}, hence a(27)=5.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p;
      if n <= 4 then return 0 fi;
      p:= prevprime(ceil(n/2));
      if p + nextprime(p) <= n then numtheory:-pi(p) else numtheory:-pi(p)-1 fi
    end proc:
    map(f, [$1..100]); # Robert Israel, Dec 08 2024
  • Mathematica
    With[{t=Total/@Partition[Prime[Range[100]],2,1]},Table[Count[t,?(#<=n&)],{n,100}]] (* _Harvey P. Dale, Apr 16 2015 *)

Formula

A056172(n)-1 <= a(n) <= A056172(n).
a(n) = A076472(n) + A076473(n).

A063955 Sum of the unitary prime divisors of n!.

Original entry on oeis.org

0, 2, 5, 3, 8, 5, 12, 12, 12, 7, 18, 18, 31, 24, 24, 24, 41, 41, 60, 60, 60, 49, 72, 72, 72, 59, 59, 59, 88, 88, 119, 119, 119, 102, 102, 102, 139, 120, 120, 120, 161, 161, 204, 204, 204, 181, 228, 228, 228, 228, 228, 228, 281, 281, 281, 281, 281, 252, 311, 311
Offset: 1

Views

Author

Labos Elemer, Sep 04 2001

Keywords

Examples

			Prime divisors of 20! which have exponent 1 (i.e., unitary prime divisors) are {11, 13, 17, 19}, so a(20) = 11 + 13 + 17 + 19= 60. (The sum of all its prime divisors (unitary and non-unitary) is A034387(20).)
		

Crossrefs

Programs

  • Maple
    a:= n-> add(`if`(i[2]=1, i[1], 0), i=ifactors(n!)[2]):
    seq(a(n), n=1..60);  # Alois P. Heinz, Jun 24 2018
  • Mathematica
    a[n_] := Select[FactorInteger[n!], #[[2]] == 1&][[All, 1]] // Total;
    Array[a, 60] (* Jean-François Alcover, Jan 01 2022 *)
  • PARI
    a(n) = my(f=factor(n!)~); sum(i=1, length(f), if (f[2, i]==1, f[1, i])); \\ Harry J. Smith, Sep 04 2009

Formula

a(n) = Sum_{k=floor(n/2)+1..n} k*c(k), where c is the prime characteristic (A010051). - Wesley Ivan Hurt, Dec 23 2023
a(n) = A063956(n!). - Amiram Eldar, Jul 24 2024

A063960 Sum of non-unitary prime divisors of n!: sum of those prime divisors for which the exponent in the prime factorization exceeds 1.

Original entry on oeis.org

0, 0, 0, 2, 2, 5, 5, 5, 5, 10, 10, 10, 10, 17, 17, 17, 17, 17, 17, 17, 17, 28, 28, 28, 28, 41, 41, 41, 41, 41, 41, 41, 41, 58, 58, 58, 58, 77, 77, 77, 77, 77, 77, 77, 77, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 129, 129, 129, 129, 160, 160, 160, 160
Offset: 1

Views

Author

Labos Elemer, Sep 04 2001

Keywords

Comments

Sum of the prime numbers among the smallest parts of the partitions of n into two parts. For example, a(8)=5; the partitions of 8 into two parts are (7,1), (6,2), (5,3) and (4,4). The prime numbers among the smallest parts are 2 and 3, so 2 + 3 = 5. - Wesley Ivan Hurt, Nov 01 2017
Number of distinct rectangles with integer length and prime width such that L + W = n, W <= L. For a(14)=17; the rectangles are 2 X 12, 3 X 11, 5 X 9, and 7 X 7. The sum of the lengths are then 2+3+5+7 = 17. - Wesley Ivan Hurt, Nov 08 2017

Examples

			20! = (2^18)*(3^8)*(5^4)*(7^2)*11*13*17*19, the non-unitary prime divisors are {2, 3, 5, 7}, so a(20) = 2 + 3 + 5 + 7 = 17.
		

Crossrefs

Programs

  • Maple
    seq(add(j, j=select(isprime, [$1..iquo(n,2)])), n=1..65); # Peter Luschny, Nov 28 2022
  • Mathematica
    Join[{0,0,0},Table[Total[Transpose[Select[FactorInteger[n!], Last[#]>1&]][[1]]],{n,4,70}]] (* Harvey P. Dale, Jun 19 2013 *)
  • PARI
    { for (n=1, 1000, f=factor(n!)~; a=0; for (i=1, length(f), if (f[2, i]>1, a+=f[1, i])); write("b063960.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 04 2009

Formula

a(n) = Sum_{i=1..floor(n/2)} i * A010051(i). - Wesley Ivan Hurt, Oct 31 2017
a(n) = A034387(floor(n/2)) for n >= 2. - Georg Fischer, Nov 28 2022
a(n) = A063958(n!). - Amiram Eldar, Jul 24 2024

A064028 Sum of the unitary divisors of n!.

Original entry on oeis.org

1, 3, 12, 36, 216, 1020, 8160, 61920, 507744, 4383392, 52600704, 624249600, 8739494400, 109190390400, 1583122968000, 25318378008000, 455730804144000, 8193040840252800, 163860816805056000, 3256371347261760000, 67204676251838361600, 1366492477414792734720
Offset: 1

Views

Author

Labos Elemer, Sep 11 2001

Keywords

Examples

			n=6, 6! = 720, sum of the 8 unitary ones of its 30 divisors is 1020, a(6) = 720+1+16+45+9+80+5+144 = 1020.
		

Crossrefs

Programs

  • Mathematica
    usigma[1] = 1; usigma[n_] := Times @@ (1 + Power @@@ FactorInteger[n]); usigma/@ (Range[17]!) (* Amiram Eldar, Jun 23 2019 *)
  • PARI
    valp(n,p)=my(s); while(n\=p, s+=n); s
    a(n)=my(s=1); forprime(p=2,n, s*=p^valp(n,p)+1); s \\ Charles R Greathouse IV, Jan 26 2023

Formula

a(n) = usigma(n!) = A034448(A000142(n)).
a(n)/n! <= 2 (while usigma(n)/n and sigma(n!)/n! are unbounded; Wall, 1984). - Amiram Eldar, Feb 08 2022

A229989 Number of primes in the interval [floor(n/2), floor(3n/2)].

Original entry on oeis.org

0, 2, 2, 3, 4, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 7, 7, 7, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 15, 16, 16, 16, 17, 18, 18, 18
Offset: 1

Views

Author

Clark Kimberling, Oct 09 2013

Keywords

Comments

Conjectures:
(1) a(n+1) - a(n) = 1 for infinitely many n;
(2) a(n+1) - a(n) = -1 for infinitely many n;
(3) a(n+1) - a(n) = -1 if and only if n = 2*prime(m+1) - 1.

Examples

			a(5) = 4 counts the primes in the interval [2,7].
		

Crossrefs

Programs

  • Maple
    with(numtheory): A229989 := proc(n) return pi(floor((3/2)*n))-pi(floor(n/2)-1): end proc: seq(A229989(n), n=1..75); # Nathaniel Johnston, Oct 11 2013
  • Mathematica
    z = 1000; c[n_] := PrimePi[Floor[3 n/2]] - PrimePi[Floor[n/2]-1];
    t = Table[c[n], {n, 1, z}];            (* A229989 *)
    Flatten[Position[Differences[t], -1]]  (* A076274? *)
    Flatten[Position[Differences[t], 1]]   (* A229990 *)

A229990 Numbers k such that the interval [floor((k+1)/2), floor(3*(k+1)/2)] contains more primes than the interval [floor(k/2), floor(3*k/2)] does.

Original entry on oeis.org

1, 3, 4, 8, 12, 19, 20, 24, 28, 31, 40, 44, 48, 52, 55, 64, 67, 68, 71, 72, 84, 91, 92, 99, 100, 104, 108, 111, 115, 120, 127, 128, 131, 132, 140, 148, 151, 152, 155, 160, 171, 175, 180, 184, 187, 188, 204, 208, 211, 220, 224, 231, 232, 235, 239, 244, 248, 252
Offset: 1

Views

Author

Clark Kimberling, Oct 09 2013

Keywords

Examples

			4 is in this sequence because [[5/2], [15/2]] contains the primes 2,3,5,7, while [[4/2], [12/2]] contains the primes 2,3,5.
		

Crossrefs

Programs

  • Maple
    with(numtheory): isA229990 := proc(n) return pi(floor(3*(n+1)/2))-pi(floor((n+1)/2)-1) > pi(floor(3*n/2))-pi(floor(n/2)-1): end proc: seq(`if`(isA229990(n),n,NULL), n=1..252); # Nathaniel Johnston, Oct 11 2013
  • Mathematica
    z = 1000; c[n_] := PrimePi[Floor[3 n/2]] - PrimePi[Floor[n/2]-1];
    t = Table[c[n], {n, 1, z}];            (* A229989 *)
    Flatten[Position[Differences[t], -1]]  (* A076274? *)
    Flatten[Position[Differences[t], 1]]   (* A229990 *)

A340996 a(n) is the number of different primes that can be expressed as n mod p where p < n is prime.

Original entry on oeis.org

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

Views

Author

J. M. Bergot and Robert Israel, Feb 01 2021

Keywords

Comments

a(n) is the number of primes p < n such that n-p has a prime factor > p.
a(n) <= A056172(n-1), with equality for n = 1, 2, 3, 4, 5, 8, 24.

Examples

			a(8) = 2 because 2 = 8 mod 3 and 3 = 8 mod 5.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k; nops(select(isprime,{seq(n mod k, k=select(isprime,[$2..n-1]))})) end proc:
    map(f, [$1..100]);
Showing 1-10 of 13 results. Next