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

A230767 Continued fraction expansion of Mertens' constant (A077761).

Original entry on oeis.org

0, 3, 1, 4, 1, 2, 5, 2, 1, 1, 1, 1, 13, 4, 2, 4, 2, 1, 33, 296, 2, 1, 5, 19, 1, 5, 1, 1, 1, 1, 1, 12, 12, 9, 1, 8, 4, 10, 2, 1, 1, 3, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 8, 1, 4, 2, 1, 6, 1, 1, 1, 1, 1, 2, 5, 1, 3, 4, 6, 5, 1, 4, 1, 23
Offset: 0

Views

Author

Edward Jiang, Oct 29 2013

Keywords

Crossrefs

Cf. A077761 (decimal expansion).

Programs

  • Mathematica
    $MaxExtraPrecision = 400; ContinuedFraction[N[EulerGamma + NSum[(MoebiusMu[m]/m)*Log[N[Zeta[m], 120]], {m, 2, 1000}, Method -> "EulerMaclaurin", AccuracyGoal -> 120, NSumTerms -> 1000, PrecisionGoal -> 120, WorkingPrecision -> 120], 71]] (* Michael De Vlieger, May 28 2015, after Jean-François Alcover at A077761 *)
  • PARI
    a()=my(e=precision(2.>>(32*ceil(default(realprecision)*38539962/371253907)) ,9),t,s=Euler,n=1); while((t=log(zeta(n++))/n)>e, s+=moebius(n)*t); t=contfrac(s+moebius(n)*t); t[1..#t-1] \\ Charles R Greathouse IV, May 27 2015

Extensions

a(19) and onward corrected by Charles R Greathouse IV, May 27 2015
Offset changed by Andrew Howroyd, Aug 08 2024

A096167 Engel expansion of Mertens's constant (A077761).

Original entry on oeis.org

4, 22, 86, 92, 292, 904, 1515, 1975, 4933, 19252, 23400, 28026, 43044, 48399, 82292, 238773, 18642549, 28116059, 47720584, 1582947265, 1616934502, 17082390754, 98630202120, 163918621174, 736646478316, 2914782808490, 33024950541229, 104502070935393, 595094589759096
Offset: 1

Views

Author

Gerald McGarvey, Jul 25 2004

Keywords

Crossrefs

Cf. A077761.

Extensions

More terms from Vaclav Kotesovec, Mar 08 2023

A345413 Decimal expansion of exp(gamma + M)*(G - 7*zeta(3)/(4*Pi))/4, where gamma is Euler's constant (A001620), M is Mertens's constant (A077761) and G is Catalan's constant (A006752).

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Jun 18 2021

Keywords

Comments

This constant is notable for being the asymptotic limit in a formula derived by Sinha and Wolf (2010) which "brings together the elements from nine different topics of number theory" (see the Formula section).

Examples

			0.14248676756297667766013119038516485825699065019561...
		

Crossrefs

Programs

  • Mathematica
    M = EulerGamma - NSum[PrimeZetaP[k]/k, {k, 2, Infinity}, WorkingPrecision -> 300, NSumTerms -> 300]; RealDigits[Exp[EulerGamma + M]*(Catalan - 7*Zeta[3]/(4*Pi))/4, 10, 100][[1]]

Formula

Equals lim_{n->oo} (1/log(n)^2) * Sum_{k=1..n} (1/gamma_k) * (1/k + 1/prime(k)) * (arctan(gamma_k/gamma_n))^2 * exp(H(k) + Sum_{i=1..k} 1/prime(i))), where H(k) = A001008(k)/A002805(k) is the k-th harmonic number, and gamma_k is the imaginary part of the k-th nontrivial zero of the Riemann zeta function.

A001358 Semiprimes (or biprimes): products of two primes.

Original entry on oeis.org

4, 6, 9, 10, 14, 15, 21, 22, 25, 26, 33, 34, 35, 38, 39, 46, 49, 51, 55, 57, 58, 62, 65, 69, 74, 77, 82, 85, 86, 87, 91, 93, 94, 95, 106, 111, 115, 118, 119, 121, 122, 123, 129, 133, 134, 141, 142, 143, 145, 146, 155, 158, 159, 161, 166, 169, 177, 178, 183, 185, 187
Offset: 1

Views

Author

Keywords

Comments

Numbers of the form p*q where p and q are primes, not necessarily distinct.
These numbers are sometimes called semiprimes or 2-almost primes.
Numbers n such that Omega(n) = 2 where Omega(n) = A001222(n) is the sum of the exponents in the prime decomposition of n.
Complement of A100959; A064911(a(n)) = 1. - Reinhard Zumkeller, Nov 22 2004
The graph of this sequence appears to be a straight line with slope 4. However, the asymptotic formula shows that the linearity is an illusion and in fact a(n)/n ~ log(n)/log(log(n)) goes to infinity. See also the graph of A066265 = number of semiprimes < 10^n.
For numbers between 33 and 15495, semiprimes are more plentiful than any other k-almost prime. See A125149.
Numbers that are divisible by exactly 2 prime powers (not including 1). - Jason Kimberley, Oct 02 2011
The (disjoint) union of A006881 and A001248. - Jason Kimberley, Nov 11 2015
An equivalent definition of this sequence is a'(n) = smallest composite number which is not divided by any smaller composite number a'(1),...,a'(n-1). - Meir-Simchah Panzer, Jun 22 2016
The above characterization can be simplified to "Composite numbers not divisible by a smaller term." This shows that this is the equivalent of primes computed via Eratosthenes's sieve, but starting with the set of composite numbers (i.e., complement of 1 union primes) instead of all positive integers > 1. It's easy to see that iterating the method (using Eratosthenes's sieve each time on the remaining numbers, complement of the previously computed set) yields numbers with bigomega = k for k = 0, 1, 2, 3, ..., i.e., {1}, A000040, this, A014612, etc. - M. F. Hasler, Apr 24 2019
For all n except n = 2, a(n) is a deficient number. - Amrit Awasthi, Sep 10 2024
It is reasonable to assume that the "comforting numbers" which John T. Williams found in Chapter 3 of Milne's book "The House at Pooh Corner" are these semiprimes. Winnie-the-Pooh wonders whether he has 14 or 15 honey pots and concludes: "It's sort of comforting." To arrange a semiprime number of honey pots in a rectangular way, let's say on a shelf, with the larger divisor parallel to the wall, there is only one solution and this is for a simple mind like Winnie-the-Pooh comforting. - Ruediger Jehn, Dec 12 2024

Examples

			From _Gus Wiseman_, May 27 2021: (Start)
The sequence of terms together with their prime factors begins:
   4 = 2*2     46 = 2*23     91 = 7*13    141 = 3*47
   6 = 2*3     49 = 7*7      93 = 3*31    142 = 2*71
   9 = 3*3     51 = 3*17     94 = 2*47    143 = 11*13
  10 = 2*5     55 = 5*11     95 = 5*19    145 = 5*29
  14 = 2*7     57 = 3*19    106 = 2*53    146 = 2*73
  15 = 3*5     58 = 2*29    111 = 3*37    155 = 5*31
  21 = 3*7     62 = 2*31    115 = 5*23    158 = 2*79
  22 = 2*11    65 = 5*13    118 = 2*59    159 = 3*53
  25 = 5*5     69 = 3*23    119 = 7*17    161 = 7*23
  26 = 2*13    74 = 2*37    121 = 11*11   166 = 2*83
  33 = 3*11    77 = 7*11    122 = 2*61    169 = 13*13
  34 = 2*17    82 = 2*41    123 = 3*41    177 = 3*59
  35 = 5*7     85 = 5*17    129 = 3*43    178 = 2*89
  38 = 2*19    86 = 2*43    133 = 7*19    183 = 3*61
  39 = 3*13    87 = 3*29    134 = 2*67    185 = 5*37
(End)
		

References

  • Archimedeans Problems Drive, Eureka, 17 (1954), 8.
  • Raymond Ayoub, An Introduction to the Analytic Theory of Numbers, Amer. Math. Soc., 1963; Chapter II, Problem 60.
  • Edmund Landau, Handbuch der Lehre von der Verteilung der Primzahlen, Vol. 1, Teubner, Leipzig; third edition: Chelsea, New York (1974). See p. 211.
  • 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).
  • John T. Williams, Pooh and the Philosophers, Dutton Books, 1995.

Crossrefs

Cf. A064911 (characteristic function).
Cf. A048623, A048639, A000040 (primes), A014612 (products of 3 primes), A014613, A014614, A072000 ("pi" for semiprimes), A065516 (first differences).
Sequences listing r-almost primes, that is, the n such that A001222(n) = r: A000040 (r=1), this sequence (r=2), A014612 (r=3), A014613 (r=4), A014614 (r=5), A046306 (r=6), A046308 (r=7), A046310 (r=8), A046312 (r=9), A046314 (r=10), A069272 (r=11), A069273 (r=12), A069274 (r=13), A069275 (r=14), A069276 (r=15), A069277 (r=16), A069278 (r=17), A069279 (r=18), A069280 (r=19), A069281 (r=20).
These are the Heinz numbers of length-2 partitions, counted by A004526.
The squarefree case is A006881 with odd/even terms A046388/A100484 (except 4).
Including primes gives A037143.
The odd/even terms are A046315/A100484.
Partial sums are A062198.
The prime factors are A084126/A084127.
Grouping by greater factor gives A087112.
The product/sum/difference of prime indices is A087794/A176504/A176506.
Positions of even/odd terms are A115392/A289182.
The terms with relatively prime/divisible prime indices are A300912/A318990.
Factorizations using these terms are counted by A320655.
The prime indices are A338898/A338912/A338913.
Grouping by weight (sum of prime indices) gives A338904, with row sums A024697.
The terms with even/odd weight are A338906/A338907.
The terms with odd/even prime indices are A338910/A338911.
The least/greatest term of weight n is A339114/A339115.

Programs

  • Haskell
    a001358 n = a001358_list !! (n-1)
    a001358_list = filter ((== 2) . a001222) [1..]
    
  • Magma
    [n: n in [2..200] | &+[d[2]: d in Factorization(n)] eq 2]; // Bruno Berselli, Sep 09 2015
    
  • Maple
    A001358 := proc(n) option remember; local a; if n = 1 then 4; else for a from procname(n-1)+1 do if numtheory[bigomega](a) = 2 then return a; end if; end do: end if; end proc:
    seq(A001358(n), n=1..120) ; # R. J. Mathar, Aug 12 2010
  • Mathematica
    Select[Range[200], Plus@@Last/@FactorInteger[#] == 2 &] (* Zak Seidov, Jun 14 2005 *)
    Select[Range[200], PrimeOmega[#]==2&] (* Harvey P. Dale, Jul 17 2011 *)
  • PARI
    select( isA001358(n)={bigomega(n)==2}, [1..199]) \\ M. F. Hasler, Apr 09 2008; added select() Apr 24 2019
    
  • PARI
    list(lim)=my(v=List(),t);forprime(p=2, sqrt(lim), t=p;forprime(q=p, lim\t, listput(v,t*q))); vecsort(Vec(v)) \\ Charles R Greathouse IV, Sep 11 2011
    
  • PARI
    A1358=List(4); A001358(n)={while(#A1358M. F. Hasler, Apr 24 2019
    
  • Python
    from sympy import factorint
    def ok(n): return sum(factorint(n).values()) == 2
    print([k for k in range(1, 190) if ok(k)]) # Michael S. Branicky, Apr 30 2022
    
  • Python
    from math import isqrt
    from sympy import primepi, prime
    def A001358(n):
        def f(x): return int(n+x-sum(primepi(x//prime(k))-k+1 for k in range(1, primepi(isqrt(x))+1)))
        m, k = n, f(n)
        while m != k:
            m, k = k, f(k)
        return m # Chai Wah Wu, Jul 23 2024

Formula

a(n) ~ n*log(n)/log(log(n)) as n -> infinity [Landau, p. 211], [Ayoub].
Recurrence: a(1) = 4; for n > 1, a(n) = smallest composite number which is not a multiple of any of the previous terms. - Amarnath Murthy, Nov 10 2002
A174956(a(n)) = n. - Reinhard Zumkeller, Apr 03 2010
a(n) = A088707(n) - 1. - Reinhard Zumkeller, Feb 20 2012
Sum_{n>=1} 1/a(n)^s = (1/2)*(P(s)^2 + P(2*s)), where P is the prime zeta function. - Enrique Pérez Herrero, Jun 24 2012
sigma(a(n)) + phi(a(n)) - mu(a(n)) = 2*a(n) + 1. mu(a(n)) = ceiling(sqrt(a(n))) - floor(sqrt(a(n))). - Wesley Ivan Hurt, May 21 2013
mu(a(n)) = -Omega(a(n)) + omega(a(n)) + 1, where mu is the Moebius function (A008683), Omega is the count of prime factors with repetition, and omega is the count of distinct prime factors. - Alonso del Arte, May 09 2014
a(n) = A078840(2,n). - R. J. Mathar, Jan 30 2019
A100484 UNION A046315. - R. J. Mathar, Apr 19 2023
Conjecture: a(n)/n ~ (log(n)/log(log(n)))*(1-(M/log(log(n)))) as n -> oo, where M is the Mertens's constant (A077761). - Alain Rocchelli, Feb 02 2025

Extensions

More terms from James Sellers, Aug 22 2000

A000961 Powers of primes. Alternatively, 1 and the prime powers (p^k, p prime, k >= 1).

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 37, 41, 43, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 101, 103, 107, 109, 113, 121, 125, 127, 128, 131, 137, 139, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227
Offset: 1

Views

Author

Keywords

Comments

The term "prime power" is ambiguous. To a mathematician it means any number p^k, p prime, k >= 0, including p^0 = 1.
Any nonzero integer is a product of primes and units, where the units are +1 and -1. This is tied to the Fundamental Theorem of Arithmetic which proves that the factorizations are unique up to order and units. (So, since 1 = p^0 does not have a well defined prime base p, it is sometimes not regarded as a prime power. See A246655 for the sequence without 1.)
These numbers are (apart from 1) the numbers of elements in finite fields. - Franz Vrabec, Aug 11 2004
Numbers whose divisors form a geometrical progression. The divisors of p^k are 1, p, p^2, p^3, ..., p^k. - Amarnath Murthy, Jan 09 2002
These are also precisely the orders of those finite affine planes that are known to exist as of today. (The order of a finite affine plane is the number of points in an arbitrarily chosen line of that plane. This number is unique for all lines comprise the same number of points.) - Peter C. Heinig (algorithms(AT)gmx.de), Aug 09 2006
Except for first term, the index of the second number divisible by n in A002378, if the index equals n. - Mats Granvik, Nov 18 2007
These are precisely the numbers such that lcm(1,...,m-1) < lcm(1,...,m) (=A003418(m) for m>0; here for m=1, the l.h.s. is taken to be 0). We have a(n+1)=a(n)+1 if a(n) is a Mersenne prime or a(n)+1 is a Fermat prime; the converse is true except for n=7 (from Catalan's conjecture) and n=1, since 2^1-1 and 2^0+1 are not considered as Mersenne resp. Fermat prime. - M. F. Hasler, Jan 18 2007, Apr 18 2010
The sequence is A000015 without repetitions, or more formally, A000961=Union[A000015]. - Zak Seidov, Feb 06 2008
Except for a(1)=1, indices for which the cyclotomic polynomial Phi[k] yields a prime at x=1, cf. A020500. - M. F. Hasler, Apr 04 2008
Also, {A138929(k) ; k>1} = {2*A000961(k) ; k>1} = {4,6,8,10,14,16,18,22,26,32,34,38,46,50,54,58,62,64,74,82,86,94,98,...} are exactly the indices for which Phi[k](-1) is prime. - M. F. Hasler, Apr 04 2008
A143201(a(n)) = 1. - Reinhard Zumkeller, Aug 12 2008
Number of distinct primes dividing n=omega(n) < 2. - Juri-Stepan Gerasimov, Oct 30 2009
Numbers n such that Sum_{p-1|p is prime and divisor of n} = Product_{p-1|p is prime and divisor of n}. A055631(n) = A173557(n-1). - Juri-Stepan Gerasimov, Dec 09 2009, Mar 10 2010
Numbers n such that A028236(n) = 1. Klaus Brockhaus, Nov 06 2010
A188666(k) = a(k+1) for k: 2*a(k) <= k < 2*a(k+1), k > 0; notably a(n+1) = A188666(2*a(n)). - Reinhard Zumkeller, Apr 25 2011
A003415(a(n)) = A192015(n); A068346(a(n)) = A192016(n); a(n)=A192134(n) + A192015(n). - Reinhard Zumkeller, Jun 26 2011
A089233(a(n)) = 0. - Reinhard Zumkeller, Sep 04 2013
The positive integers n such that every element of the symmetric group S_n which has order n is an n-cycle. - W. Edwin Clark, Aug 05 2014
Conjecture: these are numbers m such that Sum_{k=0..m-1} k^phi(m) == phi(m) (mod m), where phi(m) = A000010(m). - Thomas Ordowski and Giovanni Resta, Jul 25 2018
Numbers whose (increasingly ordered) divisors are alternatingly squares and nonsquares. - Michel Marcus, Jan 16 2019
Possible numbers of elements in a finite vector space. - Jianing Song, Apr 22 2021

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.
  • M. Koecher and A. Krieg, Ebene Geometrie, Springer, 1993.
  • R. Lidl and H. Niederreiter, Introduction to Finite Fields and Their Applications, Cambridge 1986, Theorem 2.5, p. 45.
  • 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

There are four different sequences which may legitimately be called "prime powers": A000961 (p^k, k >= 0), A246655 (p^k, k >= 1), A246547 (p^k, k >= 2), A025475 (p^k, k=0 and k >= 2). When you refer to "prime powers", be sure to specify which of these you mean. Also A001597 is the sequence of nontrivial powers n^k, n >= 1, k >= 2. - N. J. A. Sloane, Mar 24 2018
Cf. indices of record values of A003418; A000668 and A019434 give a member of twin pairs a(n+1)=a(n)+1.
A138929(n) = 2*a(n).
A028236 (if n = Product (p_j^k_j), a(n) = numerator of Sum 1/p_j^k_j). - Klaus Brockhaus, Nov 06 2010
A000015(n) = Min{term : >= n}; A031218(n) = Max{term : <= n}.
Complementary (in the positive integers) to sequence A024619. - Jason Kimberley, Nov 10 2015

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a000961 n = a000961_list !! (n-1)
    a000961_list = 1 : g (singleton 2) (tail a000040_list) where
    g s (p:ps) = m : g (insert (m * a020639 m) $ insert p s') ps
    where (m, s') = deleteFindMin s
    -- Reinhard Zumkeller, May 01 2012, Apr 25 2011
    
  • Magma
    [1] cat [ n : n in [2..250] | IsPrimePower(n) ]; // corrected by Arkadiusz Wesolowski, Jul 20 2012
    
  • Maple
    readlib(ifactors): for n from 1 to 250 do if nops(ifactors(n)[2])=1 then printf(`%d,`,n) fi: od:
    # second Maple program:
    a:= proc(n) option remember; local k; for k from
          1+a(n-1) while nops(ifactors(k)[2])>1 do od; k
        end: a(1):=1: A000961:= a:
    seq(a(n), n=1..100);  # Alois P. Heinz, Apr 08 2013
  • Mathematica
    Select[ Range[ 2, 250 ], Mod[ #, # - EulerPhi[ # ] ] == 0 & ]
    Select[ Range[ 2, 250 ], Length[FactorInteger[ # ] ] == 1 & ]
    max = 0; a = {}; Do[m = FactorInteger[n]; w = Sum[m[[k]][[1]]^m[[k]][[2]], {k, 1, Length[m]}]; If[w > max, AppendTo[a, n]; max = w], {n, 1, 1000}]; a (* Artur Jasinski *)
    Join[{1}, Select[Range[2, 250], PrimePowerQ]] (* Jean-François Alcover, Jul 07 2015 *)
  • PARI
    A000961(n,l=-1,k=0)=until(n--<1,until(lA000961(lim=999,l=-1)=for(k=1,lim, l==lcm(l,k) && next; l=lcm(l,k); print1(k,",")) \\ M. F. Hasler, Jan 18 2007
    
  • PARI
    isA000961(n) = (omega(n) == 1 || n == 1) \\ Michael B. Porter, Sep 23 2009
    
  • PARI
    nextA000961(n)=my(m,r,p);m=2*n;for(e=1,ceil(log(n+0.01)/log(2)),r=(n+0.01)^(1/e);p=prime(primepi(r)+1);m=min(m,p^e));m \\ Michael B. Porter, Nov 02 2009
    
  • PARI
    is(n)=isprimepower(n) || n==1 \\ Charles R Greathouse IV, Nov 20 2012
    
  • PARI
    list(lim)=my(v=primes(primepi(lim)),u=List([1])); forprime(p=2,sqrtint(lim\1),for(e=2,log(lim+.5)\log(p),listput(u,p^e))); vecsort(concat(v,Vec(u))) \\ Charles R Greathouse IV, Nov 20 2012
    
  • Python
    from sympy import primerange
    def A000961_list(limit): # following Python style, list terms < limit
        L = [1]
        for p in primerange(1, limit):
            pe = p
            while pe < limit:
                L.append(pe)
                pe *= p
        return sorted(L) # Chai Wah Wu, Sep 08 2014, edited by M. F. Hasler, Jun 16 2022
    
  • Python
    from sympy import primepi
    from sympy.ntheory.primetest import integer_nthroot
    def A000961(n):
        def f(x): return int(n+x-1-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))
        m, k = n, f(n)
        while m != k:
            m, k = k, f(k)
        return m # Chai Wah Wu, Jul 23 2024
  • Sage
    def A000961_list(n):
        R = [1]
        for i in (2..n):
            if i.is_prime_power(): R.append(i)
        return R
    A000961_list(227) # Peter Luschny, Feb 07 2012
    

Formula

a(n) = A025473(n)^A025474(n). - David Wasserman, Feb 16 2006
a(n) = A117331(A117333(n)). - Reinhard Zumkeller, Mar 08 2006
Panaitopol (2001) gives many properties, inequalities and asymptotics, including a(n) ~ prime(n). - N. J. A. Sloane, Oct 31 2014, corrected by M. F. Hasler, Jun 12 2023 [The reference gives pi*(x) = pi(x) + pi(sqrt(x)) + ... where pi*(x) counts the terms up to x, so it is the inverse function to a(n).]
m=a(n) for some n <=> lcm(1,...,m-1) < lcm(1,...,m), where lcm(1...0):=0 as to include a(1)=1. a(n+1)=a(n)+1 <=> a(n+1)=A019434(k) or a(n)=A000668(k) for some k (by Catalan's conjecture), except for n=1 and n=7. - M. F. Hasler, Jan 18 2007, Apr 18 2010
A001221(a(n)) < 2. - Juri-Stepan Gerasimov, Oct 30 2009
A008480(a(n)) = 1 for all n >= 1. - Alois P. Heinz, May 26 2018
Sum_{k=1..n} 1/a(k) ~ log(log(a(n))) + 1 + A077761 + A136141. - François Huppé, Jul 31 2024

Extensions

Description modified by Ralf Stephan, Aug 29 2014

A246655 Prime powers: numbers of the form p^k where p is a prime and k >= 1.

Original entry on oeis.org

2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 37, 41, 43, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 101, 103, 107, 109, 113, 121, 125, 127, 128, 131, 137, 139, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 197, 199, 211
Offset: 1

Views

Author

Keywords

Comments

The elements are called prime powers in contrast to the powers of primes which are the numbers of the same form but with k >= 0, cf. A000961.
Every nonzero integer is the product of elements of this sequence which are relatively prime and an element of {-1, 1}. This product is up to a rearrangement of the factors unique. (This statement is the fundamental theorem of arithmetic.)
These numbers are the numbers such that the von Mangoldt function is nonzero.
These numbers are the numbers of elements in finite fields. - Franz Vrabec, Aug 11 2004
A positive integer n is a prime power if and only if nZ is a primary ideal of Z. - John Cremona, Sep 02 2014
Also, numbers n divisible by their cototients A051953(n). - Ivan Neretin, May 29 2016
Numbers n such that (theta_3(q) - theta_3(q^n)) / 2 is the g.f. of a multiplicative sequence. - Michael Somos, Oct 17 2016
Numbers that are evenly divisible by exactly one prime number. - Lee A. Newberg, May 07 2018
Ram proved that these are precisely the numbers n such that the binomial coefficients n!/(m!(n-m)!) for m = 1..n-1 have a common factor greater than 1 (which is the unique prime dividing n). See Joris, Oestreicher & Steinig for a generalization. - Charles R Greathouse IV, Apr 24 2019
Blagojević & Ziegler prove that for these n and for any convex polygon in the plane, the polygon can be partitioned into n polygons with equal area and equal perimeter. The result is conjectured (by Nandakumar & Rao, who proved the case n = 2) to hold for all n. - Charles R Greathouse IV, Apr 24 2019
Numbers n such that A367064(n) < 0. - Chai Wah Wu, Nov 06 2023
This sequence represents all positive high amplitude peaks of the inverse Riemann spectrum R(x)= Sum_{k=1..oo} -cos(log(x)*Im(z_k)) going over the imaginary part of the nontrivial zeros "Im(z_k)" in the Riemann zeta function. - Marc Morgenegg, Jul 29 2025

Crossrefs

There are four different sequences which may legitimately be called "prime powers": A000961 (p^k, k >= 0), A246655 (p^k, k >= 1), A246547 (p^k, k >= 2), A025475 (p^k, k=0 and k >= 2). When you refer to "prime powers", be sure to specify which of these you mean. Also A001597 is the sequence of nontrivial powers n^k, n >= 1, k >= 2. - N. J. A. Sloane, Mar 24 2018
Partial sums of A275120.

Programs

  • Maple
    select(t -> nops(numtheory:-factorset(t))=1, [$1..1000]); # Robert Israel, Sep 01 2014
    A246655 := proc(n) A000961(n+1) end proc: # R. J. Mathar, Jan 09 2017
    isprimepower := n -> nops(NumberTheory:-PrimeFactors(n)) = 1: # Peter Luschny, Oct 09 2022
  • Mathematica
    Select[Range[222], PrimePowerQ]
  • PARI
    [p| p <- [1..222], isprimepower(p)]
    
  • PARI
    list(lim)=my(v=List(primes([2,lim\=1]))); for(e=2,logint(lim,2), forprime(p=2,sqrtnint(lim,e), listput(v,p^e))); Set(v) \\ Charles R Greathouse IV, Feb 03 2023
    
  • Python
    from sympy import primerange
    m = 10**5
    A246655 = []
    for p in primerange(1,m):
        pe = p
        while pe < m:
            A246655.append(pe)
            pe *= p
    A246655 = sorted(A246655) # Chai Wah Wu, Sep 04 2014
    
  • Python
    from sympy import primepi, integer_nthroot
    def A246655(n):
        def f(x): return int(n-1+x-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))
        kmin, kmax = 1,2
        while f(kmax) >= kmax:
            kmax <<= 1
        while True:
            kmid = kmax+kmin>>1
            if f(kmid) < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return kmax # Chai Wah Wu, Aug 20 2024
  • Sage
    [n for n in (1..222) if sloane.A001221(n) == 1]
    

Formula

a(n) is characterized by A001221(a(n)) = 1.
a(n) is characterized by A014963(a(n)) != 1.
Euler's A000010(a(n)) = a(n)*(1 - 1/A014963(a(n))).
All three relations above are not true for A000961(n) instead of a(n).
Sum_{k=1..n} 1/a(k) ~ log(log(a(n))) + A077761 + A136141. - François Huppé, Jul 31 2024

A064547 Sum of binary digits (or count of 1-bits) in the exponents of the prime factorization of n.

Original entry on oeis.org

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

Views

Author

Wouter Meeussen, Oct 09 2001

Keywords

Comments

This sequence is different from A058061 for n containing 6th, 8th, ..., k-th powers in its prime decomposition, where k runs through the integers missing from A064548.
For n > 1, n is a product of a(n) distinct members of A050376. - Matthew Vandermast, Jul 13 2004
For n > 1: a(n) = length of n-th row in A213925. - Reinhard Zumkeller, Mar 20 2013
Number of Fermi-Dirac factors of n. - Peter Munn, Dec 27 2019

Examples

			For n = 54, n = 2^1 * 3^3 with exponents (1) and (11) in binary, so a(54) = A000120(1) + A000120(3) = 1 + 2 = 3.
		

Crossrefs

Cf. A000028 (positions of odd terms), A000379 (of even terms).
Cf. A050376 (positions of ones), A268388 (terms larger than ones).
Row lengths of A213925.
A000120, A007814, A028234, A037445, A052331, A064989, A067029, A156552, A223491, A286574 are used in formulas defining this sequence.
Cf. A005117, A058061 (to which A064548 relates), A138302.
Cf. other sequences counting factors of n: A001221, A001222.
Cf. other sequences where a(n) depends only on the prime signature of n: A181819, A267116, A268387.
A003961, A007913, A008833, A059895, A059896, A059897, A225546 are used to express relationship between terms of this sequence.

Programs

  • Haskell
    a064547 1 = 0
    a064547 n = length $ a213925_row n  -- Reinhard Zumkeller, Mar 20 2013
    
  • Maple
    expts:=proc(n) local t1,t2,t3,t4,i; if n=1 then RETURN([0]); fi; if isprime(n) then RETURN([1]); fi; t1:=ifactor(n); if nops(factorset(n))=1 then RETURN([op(2,t1)]); fi; t2:=nops(t1); t3:=[]; for i from 1 to t2 do t4:=op(i,t1); if nops(t4) = 1 then t3:=[op(t3),1]; else t3:=[op(t3),op(2,t4)]; fi; od; RETURN(t3); end;
    A000120 := proc(n) local w,m,i; w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end:
    LamMos:= proc(n) local t1,t2,t3,i; t1:=expts(n); add( A000120(t1[i]),i=1..nops(t1)); end; # N. J. A. Sloane, Dec 20 2007
    # alternative Maple program:
    A064547:= proc(n) local F;
    F:= ifactors(n)[2];
    add(convert(convert(f[2],base,2),`+`),f=F)
    end proc:
    map(A064547,[$1..100]); # Robert Israel, May 17 2016
  • Mathematica
    Table[Plus@@(DigitCount[Last/@FactorInteger[k], 2, 1]), {k, 105}]
  • PARI
    a(n) = {my(f = factor(n)[,2]); sum(k=1, #f, hammingweight(f[k]));} \\ Michel Marcus, Feb 10 2016
    
  • Python
    from sympy import factorint
    def wt(n): return bin(n).count("1")
    def a(n):
        f=factorint(n)
        return sum([wt(f[i]) for i in f]) # Indranil Ghosh, May 30 2017
  • Scheme
    ;; uses memoizing-macro definec
    (definec (A064547 n) (cond ((= 1 n) 0) (else (+ (A000120 (A067029 n)) (A064547 (A028234 n))))))
    ;; Antti Karttunen, Feb 09 2016
    
  • Scheme
    ;; uses memoizing-macro definec
    (definec (A064547 n) (if (= 1 n) 0 (+ (A000120 (A007814 n)) (A064547 (A064989 n)))))
    ;; Antti Karttunen, Feb 09 2016
    

Formula

a(m*n) <= a(m)*a(n). - Reinhard Zumkeller, Mar 20 2013
From Antti Karttunen, Feb 09 2016: (Start)
a(1) = 0, and for n > 1, a(n) = A000120(A067029(n)) + a(A028234(n)).
a(1) = 0, and for n > 1, a(n) = A000120(A007814(n)) + a(A064989(n)).
(End)
a(n) = log_2(A037445(n)). - Vladimir Shevelev, May 13 2016
a(n) = A286574(A156552(n)). - Antti Karttunen, May 28 2017
Additive with a(p^e) = A000120(e). - Jianing Song, Jul 28 2018
a(n) = A000120(A052331(n)). - Peter Munn, Aug 26 2019
From Peter Munn, Dec 18 2019: (Start)
a(A000379(n)) mod 2 = 0.
a(A000028(n)) mod 2 = 1.
A001221(n) <= a(n) <= A001222(n).
A001221(n) < a(n) => a(n) < A001222(n).
a(n) = A001222(n) if and only if n is in A005117.
a(n) = A001221(n) if and only if n is in A138302.
a(n^2) = a(n).
a(A003961(n)) = a(n).
a(A225546(n)) = a(n).
a(n) = a(A007913(n)) + a(A008833(n)).
a(A050376(n)) = 1.
a(A059897(n,k)) + 2 * a(A059895(n,k)) = a(n) + a(k).
a(A059896(n,k)) + a(A059895(n,k)) = a(n) + a(k).
Alternative definition: a(1) = 0; a(n * m) = a(n) + 1 for m = A050376(k) > A223491(n).
(End)
Sum_{k=1..n} a(k) ~ n * (log(log(n)) + B + C), where B is Mertens's constant (A077761) and C = Sum_{p prime} f(1/p) = 0.13605447049622836522... (A382294), where f(x) = -x + Sum_{k>=0} x^(2^k)/(1+x^(2^k)). - Amiram Eldar, Sep 28 2023
a(n) << log n/log log n. - Charles R Greathouse IV, Nov 29 2024

A136141 Decimal expansion of Sum_{p prime} 1/(p*(p-1)).

Original entry on oeis.org

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

Views

Author

R. J. Mathar, Mar 09 2008

Keywords

Comments

Excess of prime factors with multiplicity over distinct prime factors for random (large) integers. - Charles R Greathouse IV, Sep 06 2011
Sum of reciprocals of (proper) prime powers. The sum of reciprocals of all proper powers is A072102. - Charles R Greathouse IV, Apr 24 2012
Decimal expansion of the infinite sum of the reciprocals of the prime powers which are not prime (A246547). - Robert G. Wilson v, May 13 2019
See the second 'Applications' example under the Mathematica help file for the function PrimePowerQ. - Robert G. Wilson v, May 13 2019
It easy to prove that this constant < 1 (Sum_{p prime} 1/(p*(p-1)) < Sum_{k>=2} 1/(k*(k-1)) = 1). Luthar (1969) asks for a better upper bound. The solution shows that this constant is < 3/2 - log(2) = 0.80685... . - Amiram Eldar, Feb 14 2025

Examples

			Equals 1/2 + 1/(3*2) + 1/(5*4) + 1/(7*6) + ...
= 0.7731566690497951278643674598559423956187413360831860483110060673567...
		

References

  • Henri Cohen, Number Theory, Volume II: Analytic and Modern Tools, GTM Vol. 240, Springer, 2007; see pp. 208-209.
  • Steven R. Finch, Mathematical Constants, Cambridge Univ. Press, 2003, Meissel-Mertens constants, p. 94.

Crossrefs

Cf. A152447 (over the semiprimes), A000040, A000720, A001248, A046660 (excess, see first comment), A072102, A077761, A083342, A179119, A246547.
Decimal expansion of the prime zeta function: A085548 (at 2), A085541 (at 3), A085964 (at 4) to A085969 (at 9).

Programs

  • Magma
    R := RealField(105);
    c := &+[R|(EulerPhi(n)-MoebiusMu(n))/n*Log(ZetaFunction(R,n)):n in[2..360]];
    Reverse(IntegerToSequence(Floor(c*10^103))); // Jason Kimberley, Jan 12 2017
  • Mathematica
    digits = 103; sp = NSum[PrimeZetaP[n], {n, 2, Infinity}, WorkingPrecision -> digits + 10, NSumTerms -> 2*digits]; RealDigits[sp, 10, digits] // First (* Jean-François Alcover, Sep 02 2015 *)
  • PARI
    W(x)=solve(y=log(x)/2,max(1,log(x)),y*exp(y)-x)
    eps()=2. >> (32*ceil(default(realprecision)/9.63))
    primezeta(s)=my(t=s*log(2),iter=W(t/eps())\t);sum(k=1,iter, moebius(k)/k*log(abs(zeta(k*s))))
    a(lim,e)={ \\ choose parameters to maximize speed and precision
        my(x,y=exp(W(lim)-.5));
        x=lim^e*(e*log(y))^e*(y*log(y))^-e*incgam(-e,e*log(y));
        forprime(p=2,lim,x+=1/((p*1.)^e*(p-1)));
        x+sum(n=2,e,primezeta(n))
    }; \\ Charles R Greathouse IV, Sep 07 2011
    
  • PARI
    sumeulerrat(1/(p*(p-1))) \\ Amiram Eldar, Mar 18 2021
    

Formula

Equals Sum_{n>=1} 1/A036689(n).
Equals Sum_{s>=2} P(s), where P is the prime zeta function. - Charles R Greathouse IV, Sep 06 2011
Equals A083342 - A077761, that is, Sum_{n>=2} ((EulerPhi(n) - MoebiusMu(n))/n) * log(zeta(n)). - Jean-François Alcover, Sep 02 2015
Equals 2 * Sum_{k>=2} pi(k)/(k^3-k), where pi(k) = A000720(k) (Shamos, 2011, p. 8). - Amiram Eldar, Mar 12 2024

Extensions

More terms from D. S. McNeil, Sep 06 2011
More digits from Jean-François Alcover, Sep 02 2015

A024451 a(n) is the numerator of Sum_{i = 1..n} 1/prime(i).

Original entry on oeis.org

0, 1, 5, 31, 247, 2927, 40361, 716167, 14117683, 334406399, 9920878441, 314016924901, 11819186711467, 492007393304957, 21460568175640361, 1021729465586766997, 54766551458687142251, 3263815694539731437539, 201015517717077830328949, 13585328068403621603022853
Offset: 0

Views

Author

Keywords

Comments

Arithmetic derivative of p#: a(n) = A003415(A002110(n)). - Reinhard Zumkeller, Feb 25 2002
(n-1)-st elementary symmetric functions of first n primes; see Mathematica section. - Clark Kimberling, Dec 29 2011
Denominators of the harmonic mean of the first n primes; A250130 gives the numerators. - Colin Barker, Nov 14 2014
Let Pn(n) = A002110 denote the primorial function. The average number of distinct prime factors <= prime(n) in the natural numbers up to Pn(n) is equal to Sum_{i = 1..n} 1/prime(i). - Jamie Morken, Sep 17 2018
Conjecture: All terms are squarefree numbers. - Nicolas Bělohoubek, Apr 13 2022
The above conjecture would imply that for n > 0, gcd(a(n), A369651(n)) = 1. See corollary 2 on the page 4 of Ufnarovski-Åhlander paper. - Antti Karttunen, Jan 31 2024
Apart from the initial 0, a subsequence of A048103. Proof: For all primes p, when i >= A000720(p), neither p itself nor p^p divides a(i) [implied by Henry Bottomley's Sep 27 2006 formula], but neither does p^p divide a(i) when 0 < i < A000720(p), as then p^p > a(i). See A074107, which gives an upper bound for this sequence. - Antti Karttunen, Nov 19 2024

Examples

			0/1, 1/2, 5/6, 31/30, 247/210, 2927/2310, 40361/30030, 716167/510510, 14117683/9699690, ...
		

References

  • S. R. Finch, Mathematical Constants, Cambridge, 2003, Sect. 2.2.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Sect. VII.28.

Crossrefs

Denominators are A002110.
Row sums of A077011 and A258566.
Subsequence of A048103 (after the initial 0).
Cf. A053144 (a lower bound), A074107 (an upper bound).
Cf. A109628 (indices k where a(k) is prime), A244622 (corresponding primes), A244621 (a(n) mod 12).
Cf. A369972 (k where prime(1+k)|a(k)), A369973 (corresponding primorials), A293457 (corresponding primes), A377992 (antiderivatives of the terms > 1 of this sequence).

Programs

  • Magma
    [ Numerator(&+[ NthPrime(k)^-1: k in [1..n]]): n in [1..18] ];  // Bruno Berselli, Apr 11 2011
    
  • Maple
    h:= n-> add(1/(ithprime(i)),i=1..n);
    t1:=[seq(h(n),n=0..50)];
    t1a:=map(numer,t1); # A024451
    t1b:=map(denom,t1); # A002110 - N. J. A. Sloane, Apr 25 2014
  • Mathematica
    a[n_] := Numerator @ Sum[1/Prime[i], {i, n}]; Array[a,18]  (* Jean-François Alcover, Apr 11 2011 *)
    f[k_] := Prime[k]; t[n_] := Table[f[k], {k, 1, n}]
    a[n_] := SymmetricPolynomial[n - 1, t[n]]
    Table[a[n], {n, 1, 16}] (* A024451 *)
    (* Clark Kimberling, Dec 29 2011 *)
    Numerator[Accumulate[1/Prime[Range[20]]]] (* Harvey P. Dale, Apr 11 2012 *)
  • PARI
    a(n) = numerator(sum(i=1, n, 1/prime(i))); \\ Michel Marcus, Sep 18 2018
    
  • Python
    from sympy import prime
    from fractions import Fraction
    def a(n): return sum(Fraction(1, prime(k)) for k in range(1, n+1)).numerator
    print([a(n) for n in range(20)]) # Michael S. Branicky, Feb 12 2021
    
  • Python
    from math import prod
    from sympy import prime
    def A024451(n):
        q = prod(plist:=tuple(prime(i) for i in range(1,n+1)))
        return sum(q//p for p in plist) # Chai Wah Wu, Nov 03 2022

Formula

Limit_{n->oo} (Sum_{p <= n} 1/p - log log n) = 0.2614972... = A077761.
a(n) = (Product_{i=1..n} prime(i))*(Sum_{i=1..n} 1/prime(i)). - Benoit Cloitre, Jan 30 2002
(n+1)-st elementary symmetric function of the first n primes.
a(n) = a(n-1)*A000040(n) + A002110(n-1). - Henry Bottomley, Sep 27 2006
From Antti Karttunen, Jan 31 2024, Feb 08 2024 and Nov 19 2024: (Start)
a(0) = 0, for n > 0, a(n) = 2*A203008(n-1) + A070826(n).
For n > 0, a(n) = A327860(A143293(n-1)).
For n > 0, a(n) = A348301(n) + A002110(n).
For n = 3..175, a(n) = A356253(A002110(n)). [See comments in A356253.]
For n >= 0, A053144(n) <= a(n) <= A074107(n) < A070826(1+n).
(End)

Extensions

a(0)=0 prepended by Alois P. Heinz, Jun 26 2015

A056169 Number of unitary prime divisors of n.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Jul 27 2000

Keywords

Comments

The zeros of this sequences are the powerful numbers (A001694). There are no arbitrarily long subsequences with a given upper bound; for example, every sequence of 4 values includes one divisible by 2 but not 4, so there are no more than 3 consecutive zeros. Similarly, there can be no more than 23 consecutive values with none divisible by both 2 and 3 but neither 4 nor 9 (so a(n) >= 2), etc. In general, this gives an upper bound that is a (relatively) small multiple of the k-th primorial number (prime(k)#). One suspects that the actual upper bounds for such subsequences are quite a bit lower; e.g., Erdős conjectured that there are no three consecutive powerful numbers. - Franklin T. Adams-Watters, Aug 08 2006
In particular, for every A048670(k)*A002110(k) consecutive terms, at least one is greater than or equal to k. - Charlie Neder, Jan 03 2019
Following Catalan's conjecture (which became Mihăilescu's theorem in 2002), the first case of two consecutive zeros in this sequence is for a(8) and a(9), because 8 = 2^3 and 9 = 3^2, and there are no other consecutive zeros for consecutive powers. However, there are other pairs of consecutive zeros at powerful numbers (A001694, A060355). The next example is a(288) = a(289) = 0, because 288 = 2^5 * 3^2 and 289 = 17^2, then also a(675) and a(676). - Bernard Schott, Jan 06 2019
a(2k-1) is the number of primes p such that p || x + y and p^2 || x^(2k-1) + y^(2k-1) for some positive integers x and y. For any positive integers x, y and k > 1, there is no prime p such that p || x + y and p^2 || x^(2k) + y^(2k). - Jinyuan Wang, Apr 08 2020

Examples

			9 = 3^2 so a(9) = 0; 10 = 2 * 5 so a(10) = 2; 11 = 11^1 so a(11) = 1.
		

Crossrefs

Programs

  • Haskell
    a056169 = length . filter (== 1) . a124010_row
    -- Reinhard Zumkeller, Sep 10 2013
    
  • Maple
    a:= n-> nops(select(i-> i[2]=1, ifactors(n)[2])):
    seq(a(n), n=1..120);  # Alois P. Heinz, Mar 27 2017
  • Mathematica
    Join[{0},Table[Count[Transpose[FactorInteger[n]][[2]],1],{n,2,110}]] (* Harvey P. Dale, Mar 15 2012 *)
    Table[DivisorSum[n, 1 &, And[PrimeQ@ #, CoprimeQ[#, n/#]] &], {n, 105}] (* Michael De Vlieger, Nov 28 2017 *)
  • PARI
    a(n)=my(f=factor(n)[,2]); sum(i=1,#f,f[i]==1) \\ Charles R Greathouse IV, Apr 29 2015
    
  • Python
    from sympy import factorint
    def a(n):
        f=factorint(n)
        return 0 if n==1 else sum(1 for i in f if f[i]==1)
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 19 2017
    
  • Scheme
    ;; With memoization-macro definec.
    (definec (A056169 n) (if (= 1 n) 0 (+ (if (= 1 (A067029 n)) 1 0) (A056169 (A028234 n))))) ;; Antti Karttunen, Nov 28 2017

Formula

A prime factor of n is unitary iff its exponent is 1 in prime factorization of n. In general, gcd(p, n/p) = 1 or = p.
Additive with a(p^e) = 1 if e = 1, 0 otherwise.
a(n) = #{k: A124010(n,k) = 1, k = 1..A001221}. - Reinhard Zumkeller, Sep 10 2013
From Antti Karttunen, Nov 28 2017: (Start)
a(1) = 0; for n > 1, a(n) = A063524(A067029(n)) + a(A028234(n)).
a(n) = A001221(A055231(n)) = A001222(A055231(n)).
a(n) = A001221(n) - A056170(n) = A001221(n) - A001221(A000188(n)).
a(n) = A001222(n) - A275812(n).
a(n) = A162642(n) - A295662(n).
a(n) <= A162642(n) <= a(n) + A295659(n).
a(n) <= A295664(n).
(End)
Sum_{k=1..n} a(k) ~ n * (log(log(n)) + B - C), where B is Mertens's constant (A077761) and C = Sum_{p prime} (1/p^2) = 0.452247... (A085548). - Amiram Eldar, Sep 28 2023
Showing 1-10 of 98 results. Next