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

A307713 a(n) = A000010(A307712(n))/A048865(A307712(n)).

Original entry on oeis.org

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

Views

Author

Robert Israel, Apr 23 2019

Keywords

Comments

1/a(n) is the fraction of primes in the reduced residue system mod A307712(n).

Examples

			a(3) = 2 because A307712(3) = 5 and 1/2 of the reduced residue system mod 5 are primes.
		

Crossrefs

Programs

A070296 Let sphi(k) = number of primes less than k and coprime to it (A048865); then a(n) = number of integers m with sphi(m) = n.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, May 10 2002

Keywords

Examples

			a(4) = 3. The three values of m for which sphi(m) = 4 are 11, 14 and 15. The coprime primes less than 11 are 2, 3, 5 and 7. The coprime primes less than 14 are 3, 5, 11 and 13. The coprime primes less than 15 are 2, 7, 11 and 13.
		

Programs

  • Mathematica
    (continuing from A048865) Table[Count[t, i], {i, 0, 150}]

Formula

a(n) = number of m such that A048865(m) = n.

Extensions

More terms from Hans Havermann, Jun 04 2002

A013939 Partial sums of sequence A001221 (number of distinct primes dividing n).

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 14, 15, 17, 19, 20, 21, 23, 24, 26, 28, 30, 31, 33, 34, 36, 37, 39, 40, 43, 44, 45, 47, 49, 51, 53, 54, 56, 58, 60, 61, 64, 65, 67, 69, 71, 72, 74, 75, 77, 79, 81, 82, 84, 86, 88, 90, 92, 93, 96, 97, 99, 101, 102, 104, 107, 108, 110, 112
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a013939 n = a013939_list !! (n-1)
    a013939_list = scanl1 (+) $ map a001221 [1..]
    -- Reinhard Zumkeller, Feb 16 2012
    
  • Magma
    [(&+[Floor(n/NthPrime(k)): k in [1..n]]): n in [1..70]]; // G. C. Greubel, Nov 24 2018
    
  • Maple
    A013939 := proc(n) option remember;  `if`(n = 1, 0, a(n) + iquo(n+1, ithprime(n+1))) end:
    seq(A013939(i), i = 1..69);  # Peter Luschny, Jul 16 2011
  • Mathematica
    a[n_] := Sum[Floor[n/Prime[k]], {k, 1, n}]; Table[a[n], {n, 1, 69}] (* Jean-François Alcover, Jun 11 2012, from 2nd formula *)
    Accumulate[PrimeNu[Range[120]]] (* Harvey P. Dale, Jun 05 2015 *)
  • PARI
    t=0;vector(99,n,t+=omega(n)) \\ Charles R Greathouse IV, Jan 11 2012
    
  • PARI
    a(n)=my(s);forprime(p=2,n,s+=n\p);s \\ Charles R Greathouse IV, Jan 11 2012
    
  • PARI
    a(n) = sum(k=1, sqrtint(n), k * (primepi(n\k) - primepi(n\(k+1)))) + sum(k=1, n\(sqrtint(n)+1), if(isprime(k), n\k, 0)); \\ Daniel Suteu, Nov 24 2018
    
  • Python
    from sympy.ntheory import primefactors
    print([sum(len(primefactors(k)) for k in range(1,n+1)) for n in range(1, 121)]) # Indranil Ghosh, Mar 19 2017
    
  • Python
    from sympy import primerange
    def A013939(n): return sum(n//p for p in primerange(n+1)) # Chai Wah Wu, Oct 06 2024
    
  • Sage
    [sum(floor(n/nth_prime(k)) for k in (1..n)) for n in (1..70)] # G. C. Greubel, Nov 24 2018

Formula

a(n) = Sum_{k <= n} omega(k).
a(n) = Sum_{k = 1..n} floor( n/prime(k) ).
a(n) = a(n-1) + A001221(n).
a(n) = A093614(n) - A048865(n); see also A006218.
A027748(a(A000040(n))+1) = A000040(n), A082287(a(n)+1) = n.
a(n) = Sum_{k=1..n} pi(floor(n/k)). - Vladeta Jovovic, Jun 18 2006
a(n) = n log log n + O(n). - Charles R Greathouse IV, Jan 11 2012
a(n) = n*(log log n + B) + o(n), where B = 0.261497... is the Mertens constant A077761. - Arkadiusz Wesolowski, Oct 18 2013
G.f.: (1/(1 - x))*Sum_{k>=1} x^prime(k)/(1 - x^prime(k)). - Ilya Gutkovskiy, Jan 02 2017
a(n) = Sum_{k=1..floor(sqrt(n))} k * (pi(floor(n/k)) - pi(floor(n/(k+1)))) + Sum_{p prime <= floor(n/(1+floor(sqrt(n))))} floor(n/p). - Daniel Suteu, Nov 24 2018
a(n) = Sum_{k>=1} k * A346617(n,k). - Alois P. Heinz, Aug 19 2021
a(n) = A001222(A048803(n+1)). - Flávio V. Fernandes, Jan 14 2025

Extensions

More terms from Henry Bottomley, Jul 03 2001

A001783 n-phi-torial, or phi-torial of n: Product k, 1 <= k <= n, k relatively prime to n.

Original entry on oeis.org

1, 1, 2, 3, 24, 5, 720, 105, 2240, 189, 3628800, 385, 479001600, 19305, 896896, 2027025, 20922789888000, 85085, 6402373705728000, 8729721, 47297536000, 1249937325, 1124000727777607680000, 37182145, 41363226782215962624, 608142583125, 1524503639859200000
Offset: 1

Views

Author

Keywords

Comments

In other words, a(1) = 1 and for n >= 2, a(n) = product of the phi(n) numbers < n and relatively prime to n.
From Gauss's generalization of Wilson's theorem (see Weisstein link) it follows that, for n>1, a(n) == -1 (mod n) if and only if there exists a primitive root modulo n (cf. the Hardy and Wright reference, Theorem 129. p. 102). - Vladimir Shevelev, May 11 2012
Islam & Manzoor prove that a(n) is an injection for n > 1, see links. In other words, if a(m) = a(n), and min(m, n) > 1, then m = n. - Muhammed Hedayet, May 25 2016
Cosgrave & Dilcher propose the name Gauss factorial. Indeed the sequence is the special case N = n of the Gauss factorial N_n! = Product_{1<=j<=N, gcd(j, n)=1} j (see A216919). - Peter Luschny, Feb 07 2018

References

  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, Fifth ed., Clarendon Press, Oxford, 2003, Theorem 129, p. 102.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Main diagonal gives A216919.

Programs

  • Haskell
    a001783 = product . a038566_row
    -- Reinhard Zumkeller, Mar 04 2012, Aug 26 2011
    
  • Maple
    A001783 := proc(n) local i,t1; t1 := 1; for i from 1 to n do if gcd(i,n)=1 then t1 := t1*i; fi; od; t1; end;
    A001783 := proc(n) local i; mul(i,i=select(k->igcd(n,k)=1,[$1..n])) end; # Peter Luschny, Oct 30 2010
  • Mathematica
    A001783[n_]:=Times@@Select[Range[n],CoprimeQ[n,#]&];
    Array[A001783,20] (* Enrique Pérez Herrero, Jul 23 2011 *)
  • PARI
    A001783(n)=prod(k=2,n-1,k^(gcd(k,n)==1))  \\ M. F. Hasler, Jul 23 2011
    
  • PARI
    a(n)=my(f=factor(n),t=n^eulerphi(f)); fordiv(f,d, t*=(d!/d^d)^moebius(n/d)); t \\ Charles R Greathouse IV, Nov 05 2015
    
  • Sage
    def Gauss_factorial(N, n): return mul(j for j in (1..N) if gcd(j, n) == 1)
    def A001783(n): return Gauss_factorial(n, n)
    [A001783(n) for n in (1..25)] # Peter Luschny, Oct 01 2012

Formula

a(n) = n^phi(n)*Product_{d|n} (d!/d^d)^mu(n/d); phi=A000010 is the Euler totient function and mu=A008683 the Moebius function (Tom M. Apostol, Introduction to Analytic Number Theory, New York 1984, p. 48). - Franz Vrabec, Jul 08 2005
a(n) = n!/A066570(n). - R. J. Mathar, Mar 10 2011
A001221(a(n)) = A000720(n) - A001221(n) = A048865(n).
A006530(a(n)) = A136548(n). - Enrique Pérez Herrero, Jul 23 2011
a(n) = A124441(n)*A124442(n). - M. F. Hasler, Jul 23 2011
a(n) == (-1)^A211487(n) (mod n). - Vladimir Shevelev, May 13 2012
a(n) = A250269(n) / A193679(n). - Daniel Suteu, Apr 05 2021

Extensions

More terms from James Sellers, Dec 23 1999

A073311 Number of squarefree numbers in the reduced residue system of n.

Original entry on oeis.org

1, 1, 2, 2, 3, 2, 5, 4, 4, 3, 7, 4, 8, 5, 6, 7, 11, 6, 12, 7, 8, 9, 15, 8, 13, 10, 13, 9, 17, 8, 19, 13, 13, 13, 15, 11, 23, 15, 17, 14, 26, 11, 28, 17, 18, 18, 30, 15, 26, 17, 21, 19, 32, 16, 25, 20, 23, 23, 36, 15, 37, 25, 26, 26, 30, 18, 41, 26, 29, 22, 44, 22, 45, 30, 29, 29, 36
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 25 2002

Keywords

Comments

Number of positive squarefree numbers <= n that are relatively prime to n.

Examples

			n=15, there are A000010(15)=8 residues: 1, 2, 4=2^2, 7, 8=2^3, 11, 13 and 14; six of them are squarefree: 1, 2, 7, 11, 13 and 14, therefore a(15)=6. [Typo fixed by _Reinhard Zumkeller_, Mar 19 2010]
		

Crossrefs

Programs

  • Haskell
    a073311 = sum . map a008966 . a038566_row
    -- Reinhard Zumkeller, Jul 04 2012
    
  • Magma
    [&+[MoebiusMu(&*PrimeDivisors(k)*i)^2:i in [1..k]]: k in [1..65]]; // Marius A. Burtea, Jul 27 2019
  • Maple
    with(numtheory): rad := n -> mul(p, p in factorset(n)):
    seq(add(mobius(rad(n)*i)^2, i=1..n), n=1..100); # Ridouane Oudra, Jul 27 2019
  • Mathematica
    a[n_] := Select[Range[n], SquareFreeQ[#] && CoprimeQ[#, n]&] // Length;
    Array[a, 100] (* Jean-François Alcover, Dec 12 2021 *)
  • PARI
    a(n)=my(s=1); forfactored(k=2,n-1, if(vecmax(k[2][,2])==1 && gcd(k[1],n)==1, s++)); s \\ Charles R Greathouse IV, Nov 05 2017
    

Formula

a(n) + A073312(n) = A000010(n).
Let s(n) = Sum_{k=1..n} a(k). Then s(n) is asymptotic to C*n^2 where C = (3/Pi^2)*alpha and alpha = Product_{p prime} (1 - 1/(p*(p+1))) = A065463 = 0.7044422009... [From discussions in Number Theory List, Apr 06 2004]
A175046(n) = a(n)*A008966(n). - Reinhard Zumkeller, Apr 05 2010
a(n) = Sum_{k=1..A000010(n)} A008966(A038566(n,k)). - Reinhard Zumkeller, Jul 04 2012
a(n) = Sum_{i=1..n} mu(A007947(n)*i)^2, where mu is the Moebius function (A008683). - Ridouane Oudra, Jul 27 2019
a(n) = Sum_{1<=k<=n, gcd(n,k)=1} mu(k)^2. - Ridouane Oudra, May 25 2023

A181834 The number of primes <= n that are strongly prime to n.

Original entry on oeis.org

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

Views

Author

Peter Luschny, Nov 17 2010

Keywords

Comments

k is strongly prime to n iff k is relatively prime to n and k does not divide n-1.

Examples

			a(11) = card(primes in {3, 4, 6, 7, 8, 9}) = card({3, 7}) = 2.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    Primes := n -> select(k->isprime(k),{$1..n}):
    StrongCoprimes := n -> select(k->igcd(k,n)=1,{$1..n}) minus divisors(n-1):
    StrongCoprimePrimes := n -> Primes(n) intersect StrongCoprimes(n):
    A181834 := n -> nops(StrongCoprimePrimes(n)):
  • Mathematica
    strongCoprimeQ[k_, n_] := PrimeQ[k] && CoprimeQ[n, k] && !Divisible[n-1, k]; a[n_] := Select[Range[n], strongCoprimeQ[#, n]&] // Length; Table[a[n], {n, 0, 72}] (* Jean-François Alcover, Jul 23 2013 *)

A036997 Number of composite numbers <= n and relatively prime to n.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 2, 0, 2, 1, 5, 0, 6, 1, 3, 2, 9, 0, 10, 1, 5, 3, 13, 0, 11, 4, 9, 4, 18, 0, 19, 5, 10, 6, 14, 2, 24, 7, 13, 5, 27, 1, 28, 7, 11, 9, 31, 2, 27, 6, 18, 10, 36, 3, 25, 9, 21, 13, 41, 1, 42, 13, 19, 14, 31, 4, 47, 14, 26, 7, 50, 5, 51, 16, 20, 16, 40, 5, 56, 11, 32, 19, 59, 3
Offset: 1

Views

Author

Keywords

Comments

30 is the largest number n with the property that if 1 < k < n and k is relatively prime to n, then k is prime. In other words, a(30) = 0 and if m > 30, then a(m) > 0. - Jonathan Sondow, Dec 08 2012

Crossrefs

Cf. A048597 (indices where a(n) = 0), A048865 (number of primes p < n that are relatively prime to n).

Programs

  • Mathematica
    Table[ Count[ Select[ Range[ n ], GCD[ #, n ]===1& ], q_/;!(PrimeQ[ q ]||q===1) ], {n, 180} ]

Formula

A048864(n) = a(n) + 1. - Peter Luschny, Oct 22 2010

Extensions

Minor edits by Ray Chandler, Mar 16 2010

A074915 Largest x such that the number of nonprimes (i.e., 1 and composites) in the reduced residue set (RRS(x)) of x equals n, or 0 if there are no such numbers.

Original entry on oeis.org

30, 60, 90, 84, 120, 210, 50, 150, 126, 180, 132, 168, 0, 138, 240, 144, 140, 330, 420, 130, 300, 92, 390, 234, 294, 228, 360, 222, 160, 246, 0, 336, 276, 630, 510, 450, 378, 152, 480, 280, 318, 196, 342, 660, 165, 396, 172, 546, 250, 840, 504, 408, 350, 600
Offset: 1

Views

Author

Labos Elemer, Oct 10 2002

Keywords

Comments

It is conjectured that x is always bounded.
If p and q are primes < sqrt(x) that do not divide x, then p*q is in RRS(x). Thus the number of composites in RRS(x) is at least (pi(sqrt(x)) - log_2(x))^2/2. If x is too large, this must be greater than n. Thus suppose N is large enough that pi(sqrt(N)) > 2*sqrt(2*n) and for all x >= N, pi(sqrt(x)) > 2*log_2(x). Then a(n) <= N. It appears that the condition pi(sqrt(x)) > 2*log_2(x) is true for all x >= 103^2. - Robert Israel, Aug 26 2018, corrected Feb 24 2020
From Giovanni Resta, Feb 25 2020: (Start)
The following bounds (valid for n>1) are known:
primepi(n) < 1.256*n/log(n),
omega(n) > 0,
phi(n) > n/(3/log(log(n)) + exp(g)*log(log(n))), where g = A001620 = 0.5770836... is the Euler-Mascheroni constant.
Combining these bounds we obtain a lower bound for A048864(k) = phi(k) - primepi(k) + omega(k), which allows the establishment of a finite search range when solving A048864(x) = n. (End)

Examples

			One nonprime (=1) is in RRS of {1,2,3,4,6,8,12,18,24,30}; min=1, max=30. See A048597.
Two nonprimes are in RRS of {5,10,14,20,42,60}; min=A072022(2), max = a(2) = 60 here.
For entries of A072023 neither min nor max is believed to exist.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {my(v = vector(10^5, n, eulerphi(n) - (primepi(n) - omega(n)))); vector(nn, k, if (#(w=Vec(select(x->(x==k), v, 1))) == 0, 0, vecmax(w)));} \\ Michel Marcus, Feb 23 2020

Formula

a(n) = max{x; A048864(x)=n}; a(n)=0 if no such number exists (see A072023).

A112484 Array where n-th row contains the primes < n and coprime to n.

Original entry on oeis.org

2, 3, 2, 3, 5, 2, 3, 5, 3, 5, 7, 2, 5, 7, 3, 7, 2, 3, 5, 7, 5, 7, 11, 2, 3, 5, 7, 11, 3, 5, 11, 13, 2, 7, 11, 13, 3, 5, 7, 11, 13, 2, 3, 5, 7, 11, 13, 5, 7, 11, 13, 17, 2, 3, 5, 7, 11, 13, 17, 3, 7, 11, 13, 17, 19, 2, 5, 11, 13, 17, 19, 3, 5, 7, 13, 17, 19, 2, 3, 5, 7, 11, 13, 17, 19, 5, 7, 11, 13
Offset: 3

Views

Author

Leroy Quet, Dec 13 2005

Keywords

Comments

Array's n-th row contains A048865(n) terms.
T(A005408(n),1) = 2; T(n,1) = A053669(n). - Reinhard Zumkeller, Sep 23 2011
These are the primes in row n >= 3 of A038566 (smallest positive restricted residue system modulo n). - Wolfdieter Lang, Jan 18 2017

Examples

			Row 9 is [2, 5, 7], since 2, 5 and 7 are the primes < 9 and coprime to 9.
The irregular triangle begins:
n\k 1 2  3  4  5  6  7  8 ...
3:  2
4:  3
5:  2 3
6:  5
7:  2 3  5
8:  3 5  7
9:  2 5  7
10: 3 7
11: 2 3  5  7
12: 5 7 11
13: 2 3  5  7 11
14: 3 5 11 13
15: 2 7 11 13
16: 3 5  7 11 13
17: 2 3  5  7 11 13
18: 5 7 11 13 17
19: 2 3  5  7 11 13 17
20: 3 7 11 13 17 19
21: 2 5 11 13 17 19
22: 3 5  7 13 17 19
23: 2 3  5  7 11 13 17 19
... - _Wolfdieter Lang_, Jan 18 2017
		

Crossrefs

Programs

  • Mathematica
    f[l_] := Block[{n}, n = Length[l] + 1; Return[Append[l, Select[Range[n - 1], PrimeQ[ # ] && Mod[n, # ] > 0 &]]];]; Flatten[Nest[f, {}, 24]] (* Ray Chandler, Dec 26 2005 *)
    Table[Complement[Prime@ Range@ PrimePi@ n, FactorInteger[n][[All, 1]]], {n, 3, 23}] // Flatten (* Michael De Vlieger, Sep 04 2017 *)
  • Python
    from sympy import primerange, gcd
    def a(n): return [i for i in primerange(1, n) if gcd(i, n)==1]
    for n in range(3, 24): print(a(n)) # Indranil Ghosh, Apr 27 2017

Extensions

Extended by Ray Chandler, Dec 26 2005

A076366 Number of numbers for which the count of nonprimes (i.e., 1 and composites) in their reduced residue set equals n.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Oct 10 2002

Keywords

Examples

			A048864(x) = 13: S = {},                                a(13) =  0;
A048864(x) = 16: S = {144},                             a(16) =  1;
A048864(x) = 22: S = {57,92},                           a(22) =  2;
A048864(x) = 7:  S = {13,34,50},                        a(7)  =  3;
A048864(x) = 4:  S = {15,22,54,84},                     a(4)  =  4;
A048864(x) = 15: S = {35,64,68,156,240},                a(15) =  5;
A048864(x) = 2:  S = {5,10,14,20,42,60},                a(2)  =  6;
A048864(x) = 6:  S = {11,21,32,40,72,78,210},           a(6)  =  7;
A048864(x) = 78: S = {133,177,268,440,490,552,870,990}, a(78) =  8;
A048864(x) = 1:  S = {1,2,3,4,6,8,12,18,24,30},         a(1)  = 10; See A048597.
		

Crossrefs

Programs

  • PARI
    listn(nn) = {my(v = vector(10^5, n, eulerphi(n) - (primepi(n) - omega(n)))); vector(nn, k, if (#(w=Vec(select(x->(x==k), v, 1))) == 0, 0, #w));} \\ Michel Marcus, Feb 23 2020

Formula

a(n) = Card{x; A048864(x) = n}; a(n)=0 if supposedly no such number exists (see A072023).
Showing 1-10 of 22 results. Next