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

A206369 a(p^k) = p^k - p^(k-1) + p^(k-2) - ... +- 1, and then extend by multiplicativity.

Original entry on oeis.org

1, 1, 2, 3, 4, 2, 6, 5, 7, 4, 10, 6, 12, 6, 8, 11, 16, 7, 18, 12, 12, 10, 22, 10, 21, 12, 20, 18, 28, 8, 30, 21, 20, 16, 24, 21, 36, 18, 24, 20, 40, 12, 42, 30, 28, 22, 46, 22, 43, 21, 32, 36, 52, 20, 40, 30, 36, 28, 58, 24, 60, 30, 42, 43, 48, 20, 66, 48, 44, 24, 70, 35
Offset: 1

Views

Author

N. J. A. Sloane, Feb 06 2012

Keywords

Comments

For more information see the Comments in A061020.
a(n) is the number of integers j such that 1 <= j <= n and gcd(n,j) is a perfect square. For example, a(12) = 6 because |{1,4,5,7,8,11}|=6 and the respective GCDs with 12 are 1,4,1,1,4,1, which are squares. - Geoffrey Critzer, Feb 16 2015
If m is squarefree (A005117), then a(m) = A000010(m) where A000010 is the Euler totient function. - Michel Marcus, Nov 08 2017
Also it appears that the primorials (A002110) is the sequence of indices of minimum records for a(n)/n, and these records are A038110(n)/A060753(n). - Michel Marcus, Nov 09 2017
Also called rho(n). When rho(n) | n, then n is called k-imperfect, with k = n/rho(n), cf. A127724. - M. F. Hasler, Feb 13 2020

References

  • P. J. McCarthy, Introduction to Arithmetical Functions, Springer Verlag, 1986, page 25.

Crossrefs

Cf. A027748 row, A124010, A206475 (first differences).
Cf. A078429.
Cf. A127724 (k-imperfect), A127725 (2-imperfect), A127726 (3-imperfect).

Programs

  • Haskell
    a206369 n = product $
       zipWith h (a027748_row n) (map toInteger $ a124010_row n) where
               h p e = sum $ take (fromInteger e + 1) $
                             iterate ((* p) . negate) (1 - 2 * (e `mod` 2))
    -- Reinhard Zumkeller, Feb 08 2012
    
  • Maple
    a:= n-> mul(add(i[1]^(i[2]-j)*(-1)^j, j=0..i[2]), i=ifactors(n)[2]):
    seq(a(n), n=1..100);  # Alois P. Heinz, Nov 03 2017
  • Mathematica
    Table[Length[Select[Range[n], IntegerQ[GCD[n, #]^(1/2)] &]], {n, 72}] (* Geoffrey Critzer, Feb 16 2015 *)
    a[n_] := n*DivisorSum[n, LiouvilleLambda[#]/#&]; Array[a, 72] (* Jean-François Alcover, Dec 04 2017, after Enrique Pérez Herrero *)
    f[p_,e_] := Sum[(-1)^(e-k)*p^k, {k,0,e}]; a[1] = 1; a[n_] := Times @@ (f @@@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, Jan 01 2020 *)
  • PARI
    a(n) = sum(k=1, n, issquare(gcd(n, k)));
    
  • PARI
    ak(p,e)=my(s=1); for(i=1,e, s=s*p + (-1)^i); s
    a(n)=my(f=factor(n)); prod(i=1,#f~, ak(f[i,1],f[i,2])) \\ Charles R Greathouse IV, Dec 27 2016
    
  • PARI
    a(n) = sumdiv(n, d, eulerphi(n/d) * issquare(d)); \\ Daniel Suteu, Jun 27 2018
    
  • PARI
    apply( {A206369(n)=vecprod([f[1]^(f[2]+1)\/(f[1]+1)|f<-factor(n)~])}, [1..99]) \\ M. F. Hasler, Feb 13 2020
    
  • Python
    from math import prod
    from sympy import factorint
    def A206369(n): return prod((lambda x:x[0]+int((x[1]<<1)>=p+1))(divmod(p**(e+1),p+1)) for p, e in factorint(n).items()) # Chai Wah Wu, Mar 05 2024

Formula

a(n) = abs(A061020(n)).
a(n) = n*Sum_{d|n} lambda(d)/d, where lambda(n) is A008836(n). - Enrique Pérez Herrero, Sep 23 2012
Dirichlet g.f.: zeta(s - 1)*zeta(2*s)/zeta(s). - Geoffrey Critzer, Feb 25 2015
From Michel Marcus, Nov 05 2017: (Start)
a(2^n) = A001045(n+1);
a(3^n) = A015518(n+1);
a(5^n) = A015531(n+1);
a(7^n) = A015552(n+1);
a(11^n) = A015592(n+1). (End)
a(p^k) = p^k - a(p^(k - 1)) for k > 0 and prime p. - David A. Corneth, Nov 09 2017
a(n) = Sum_{d|n, d is a perfect square} phi(n/d), where phi(k) is the Euler totient function. - Daniel Suteu, Jun 27 2018
a(p^k) = A071324(p^k), for k >= 0 and prime p. - Michel Marcus, Aug 11 2018
Sum_{k=1..n} a(k) ~ Pi^2 * n^2 / 30. - Vaclav Kotesovec, Feb 07 2019
G.f.: Sum_{k>=1} lambda(k)*x^k/(1 - x^k)^2. - Ilya Gutkovskiy, May 23 2019
a(n) = Sum_{i=1..n} A010052(gcd(n,i)). - Ridouane Oudra, Nov 24 2019
a(p^k) = round(p^(k+1)/(p+1)). - M. F. Hasler, Feb 13 2020

A127725 Numbers that are 2-imperfect.

Original entry on oeis.org

2, 12, 40, 252, 880, 10880, 75852, 715816960, 62549517598720
Offset: 1

Views

Author

T. D. Noe, Jan 25 2007

Keywords

Comments

This sequence also contains n = 3074457344902430720 = 2^31*5*17*257*65537, which has the product of four Fermat primes (A019434). For this n, 3*n is a 3-imperfect number (A127726). - T. D. Noe, Apr 03 2009
a(9) > 2*10^11. - Donovan Johnson, Feb 07 2013
62549517598720 is also a term (see the "43 terms > 2*10^11" link by Donovan Johnson in A127724). - Michel Marcus, Nov 05 2017

Examples

			40 = 2^3 * 5, (8 - 4 + 2 - 1)(5 - 1) = 20 = 40 / 2, so 40 is in the sequence. - _Jud McCranie_, Aug 17 2019
		

Crossrefs

Cf. A127726 (3-imperfect numbers), A127724 (k-imperfect numbers).

Programs

  • Mathematica
    okQ[n_] := 2 Sum[d*(-1)^PrimeOmega[n/d], {d, Divisors[n]}] == n;
    For[k = 2, k <= 10^9, k = k+2, If[okQ[k], Print[k]]] (* Jean-François Alcover, Jan 27 2019 *)
  • PARI
    isok(n) = 2*sumdiv(n, d, d*(-1)^bigomega(n/d)) == n; \\ Michel Marcus, Oct 28 2017

Extensions

a(9) by Jud McCranie, Aug 17 2019

A127726 Numbers that are 3-imperfect.

Original entry on oeis.org

6, 120, 126, 2520, 2640, 30240, 32640, 37800, 37926, 55440, 685440, 758520, 831600, 2600640, 5533920, 6917400, 9102240, 10281600, 11377800, 16687440, 152182800, 206317440, 250311600, 475917120, 866829600, 1665709920, 1881532800, 2082137400, 2147450880
Offset: 1

Views

Author

T. D. Noe, Jan 25 2007

Keywords

Comments

The new terms come from the paper by Zhou and Zhu. This sequence also contains n = 9223372034707292160 = 2^31*3*5*17*257*65537, which has the product of five Fermat primes (A019434). For this n, n/3 is a 2-imperfect number (A127725). - T. D. Noe, Apr 03 2009
From M. F. Hasler, Feb 13 2020: (Start)
By definition, n is k-imperfect iff n = k*A206369(n).
So a k-imperfect number is always a multiple of k, and up to the first odd 3-imperfect number (larger than 10^49, if it exists, see Zhou & Zhu (2009)), all terms are a multiple of 6. (End)

Examples

			6 = 2*3, so A206369(6) = (2 - 1)(3 - 1) = 2 = 6 / 3, so 6 is a term.
120 = 2^3 * 3 * 5, (8-4+2-1)*(3-1)*(5-1) = 40 = 120 / 3, so 120 is another term.
		

Crossrefs

Cf. A127724 (k-imperfect), A127725 (2-imperfect), A206369 (the rho function).

Programs

  • Mathematica
    okQ[n_] := 3 Sum[d*(-1)^PrimeOmega[n/d], {d, Divisors[n]}] == n;
    For[k = 3, k < 10^6, k = k + 3, If[okQ[k], Print[k]]] (* Jean-François Alcover, Feb 01 2019 *)
  • PARI
    isok(n) = 3*sumdiv(n, d, d*(-1)^bigomega(n/d)) == n; \\ Michel Marcus, Oct 28 2017
    
  • PARI
    select( {is_A127726(n)=A206369(n)*3==n}, [1..10^5]*6) \\ M. F. Hasler, Feb 13 2020

Extensions

Extended by T. D. Noe, Apr 03 2009

A127727 Primes of the form p^e - p^(e-1) + p^(e-2) - ... + (-1)^e, where p is prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 43, 61, 157, 521, 547, 683, 2731, 4423, 6163, 13421, 19183, 22651, 26407, 37057, 43691, 113233, 121453, 143263, 174763, 208393, 292141, 375157, 398581, 412807, 527803, 590593, 843643, 981091, 1041421, 1193557, 1246573
Offset: 1

Views

Author

T. D. Noe, Jan 25 2007

Keywords

Comments

These primes are important in studying k-imperfect numbers (A127724), see Iannucci-link. Except for the cases p^e = 3 and 8, which yield primes 2 and 5, e is an even number such that e+1 is prime. In fact, except for those two cases, all the primes are of the form (1+p^q)/(1+p), where q is an odd prime; that is, repunit primes with negative prime base.

Examples

			From _David A. Corneth_, Oct 28 2017: (Start)
For (p, e) = (3, 1) we have the prime 3^1 - 3^0 = 2.
For (p, e) = (2, 3) we have the prime 2^3 - 2^2 + 2^1 - 2^0 = 5.
The examples above are the cases mentioned in the comments not of the form (1+p^q)/(1+p). A prime of that form is below;
For (p, e) = (2, 4) we have the prime 2^4 - 2^3 + 2^2 - 2^1 + 2^0 = 11 = (1+p^(e+1)) / (1+p) = 33/3. (End)
		

Crossrefs

Programs

  • PARI
    upto(n) = {my(res = List([2,5])); forprime(p = 2, sqrtnint(n, 2), forprime(q = 3, logint(n * (1+p), p), r = (1+p^q)/(1+p); if(isprime(r), listput(res, r)))); listsort(res, 1); res} \\ David A. Corneth, Oct 28 2017

A294649 a(n) = numerator(A206369(n))/n.

Original entry on oeis.org

1, 1, 2, 3, 4, 1, 6, 5, 7, 2, 10, 1, 12, 3, 8, 11, 16, 7, 18, 3, 4, 5, 22, 5, 21, 6, 20, 9, 28, 4, 30, 21, 20, 8, 24, 7, 36, 9, 8, 1, 40, 2, 42, 15, 28, 11, 46, 11, 43, 21, 32, 9, 52, 10, 8, 15, 12, 14, 58, 2, 60, 15, 2, 43, 48, 10, 66, 12, 44, 12, 70, 35, 72, 18, 14
Offset: 1

Views

Author

Michel Marcus, Nov 06 2017

Keywords

Comments

a(n) = 1 for n in A127724.

Crossrefs

Cf. A127724 (k-imperfect), A206369, A294650 (denominator).
A225679 is a subsequence (on squarefree indices). - Michel Marcus, Dec 22 2017

Programs

  • Mathematica
    (* b = A209369 *) b[n_] := n*DivisorSum[n, LiouvilleLambda[#]/# &];
    a[n_] := Numerator[b[n]/n];
    Array[a, 100] (* Jean-François Alcover, Dec 04 2017 *)
  • PARI
    rhope(p, e) = my(s=1); for(i=1, e, s=s*p + (-1)^i); s;
    rho(n) = my(f=factor(n)); prod(i=1, #f~, rhope(f[i, 1], f[i, 2]));
    a(n) = numerator(rho(n)/n);

A309806 Values of k in k-imperfect numbers.

Original entry on oeis.org

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

Views

Author

Jud McCranie, Aug 17 2019

Keywords

Comments

The value of k in k-imperfect numbers, A127724. Except for the first term, all terms are > 1.
It appears that the first instance of a(n)=4 is for n=98 (993803899780063855042560), while no integer is currently known to be 5-imperfect. - Michel Marcus, Aug 20 2019
A number n is called k-imperfect iff k := n/rho(n) is an integer, where rho = A206369 is a sum-of divisors function with alternating signs. - M. F. Hasler, Feb 14 2020

Examples

			The first 3 terms of A127724 are 1, 2, and 6, that are respectively 1-, 2-, and 3-imperfect. So the first 3 terms of this sequence are 1, 2 and 3.
		

Crossrefs

Cf. A127724, A127725 (2-imperfect), A127726 (3-imperfect), A206369 (rho).

Programs

  • Mathematica
    {1}~Join~Map[If[IntegerQ@ #, #, Nothing] &[#/Times @@ (Sum[(-1)^(#2 - k) #1^k, {k, 0, #2}] & @@@ FactorInteger[#])] &, Range[2, 10^6]] (* Michael De Vlieger, Feb 15 2020 *)
  • PARI
    lista(lim) = {my(v = []); for (i=1, 4, my(vi = solveIMP(1, i, lim)); v = concat (v, vi);); apply(x->x/rhon(x), vecsort(v));} \\ uses the script in links section
    lista(10^24) \\ to get 98 terms; Michel Marcus, Aug 20 2019
    
  • PARI
    A309806(n)=(n=A127724(n))/A206369(n) \\ M. F. Hasler, Feb 14 2020

Formula

a(n) = m/A206369(m) with m = A127724(n). - M. F. Hasler, Feb 14 2020

Extensions

a(45)-a(50) from Giovanni Resta, Aug 19 2019

A344826 Integers k such that k/A097621(k) is an integer.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60, 891, 1584, 1782, 3564, 4032, 4455, 4752, 7920, 8910, 17820, 20160, 22275, 23760, 44550, 49896, 86400, 89100, 100800, 118800, 249480, 349272, 399168, 694008, 1097712, 1746360, 1778400, 1995840, 2181168, 2774304, 2794176, 3470040
Offset: 1

Views

Author

Michel Marcus, May 29 2021, after a suggestion from Allan C. Wechsler

Keywords

Comments

Allan C. Wechsler remarks that one can derive larger terms from existing terms. For instance, k = 5552064 has q = k/A097621(k) = 18. So multiplying 5552064 by 31 = A000961(18) will give a new term with q = 31.
More precisely, if k = a(n) has q = A343886(k) and m = A000961(q) such that gcd(k, m) = 1, then k*m is also a term. We could call "primitive" those terms not derived from a smaller term in this way. All the listed terms are primitive, but a({35, 36, 38, 42, 43}) allow the sequence to be extended to five larger non-primitive terms. The second and fourth one, having q = 17 resp. q = 23, both lead to a whole chain of many new terms. - M. F. Hasler, Jun 15 2021

Crossrefs

Cf. A000961, A095874, A097621, A127724, A343886 (the ratios k/A097621(k)).

Programs

  • PARI
    f(n) = if(isprimepower(n), sum(i=1, logint(n, 2), primepi(sqrtnint(n, i)))+1, n==1); \\ A095874
    ff(n) = my(fr=factor(n)); for (k=1, #fr~, fr[k,1] = f(fr[k,1]^fr[k,2]); fr[k,2] = 1); factorback(fr); \\ A097621
    isok(k) = denominator(k/ff(k)) == 1;
    
  • PARI
    mappp(nn) = {my(map = Map()); mapput(map, 1, 1); my(nb=1); for (n=2, nn, if (isprimepower(n), nb++; mapput(map, n, nb));); map;}
    ff(n, map) = my(fr=factor(n)); for (k=1, #fr~, fr[k, 1] = mapget(map, fr[k, 1]^fr[k, 2]); fr[k, 2] = 1); factorback(fr); \\ A097621
    wa(na, nb) = {my(map = mappp(nb)); for (k=na, nb, if (denominator(k/ff(k, map)) == 1, print1(k, ", ")););}
    wa(1, 10^8)
    
  • PARI
    is_A344826(n)=!(n%A097621(n))
    extend(n)=n*if(gcd(n, n=A000961(n/A097621(n)))==1,n) \\ Return the larger non-primitive term "derived" from a term n = a(k) with gcd(n,q) = 1, cf. COMMENTS, or zero if gcd(n,q) > 1, i.e., it cannot be "extended" that way. This allows the production of (infinitely?) many new terms from the existing ones. - M. F. Hasler, Jun 15 2021

A294650 a(n) = denominator(A206369(n))/n.

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 7, 8, 9, 5, 11, 2, 13, 7, 15, 16, 17, 18, 19, 5, 7, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 32, 33, 17, 35, 12, 37, 19, 13, 2, 41, 7, 43, 22, 45, 23, 47, 24, 49, 50, 51, 13, 53, 27, 11, 28, 19, 29, 59, 5, 61, 31, 3, 64, 65, 33, 67, 17, 69, 35
Offset: 1

Views

Author

Michel Marcus, Nov 06 2017

Keywords

Crossrefs

Cf. A127724 (k-imperfect), A206369, A294649 (numerator).
A225680 is a subsequence (on squarefree indices). - Michel Marcus, Dec 22 2017

Programs

  • Mathematica
    (* b = A209369 *) b[n_] := n*DivisorSum[n, LiouvilleLambda[#]/# &];
    a[n_] := Denominator[b[n]/n];
    Array[a, 100] (* Jean-François Alcover, Dec 04 2017 *)
  • PARI
    rhope(p, e) = my(s=1); for(i=1, e, s=s*p + (-1)^i); s;
    rho(n) = my(f=factor(n)); prod(i=1, #f~, rhope(f[i, 1], f[i, 2]));
    a(n) = denominator(rho(n)/n);

A307038 Unitary imperfect numbers: numbers n that equal to their unitary analog of the alternating sum of divisors, A307037(n).

Original entry on oeis.org

1, 20, 272, 65792, 2901600, 4596800, 29016000, 4295032832, 5789534400, 49085337600, 585248256000, 960935040000
Offset: 1

Views

Author

Amiram Eldar, Mar 21 2019

Keywords

Comments

Includes all the numbers of the form F(k)*(F(k)-1) with k > 0, where F(k) = 2^(2^k) + 1, the k-th Fermat number, is prime.
a(9) > 5*10^9.
Also in the sequence are 49085337600, 585248256000, 960935040000 and 46127952000000.
a(13) > 2*10^12. - Giovanni Resta, Mar 21 2019

Crossrefs

Cf. A000215, A127724 (k-imperfect), A127725 (2-imperfect), A127726 (3-imperfect), A307037.

Programs

  • Mathematica
    f[p_,e_] := p^e + (-1)^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Select[Range[10^6], a[#] == # &]

Extensions

a(9)-a(12) from Giovanni Resta, Mar 21 2019

A295236 Hemi-imperfect numbers: numbers such that the denominator of k/A206369(k) is equal to 2.

Original entry on oeis.org

3, 10, 42, 60, 63, 840, 1260, 12642, 18480, 18900, 18963, 154350, 228480, 252840, 379260, 3458700, 5562480, 5688900, 68772480, 1041068700, 15032156160, 53621568000, 4524679004160, 9812746944000
Offset: 1

Views

Author

Michel Marcus, Nov 19 2017

Keywords

Comments

This is to rho (A206369) what hemiperfect numbers are to sigma (A000203).
After 3, 10 and 42, whose quotients are resp. 3/2, 5/2 and 7/2, 373316437260251755241798182764378479569038727298776522806597255168000000 is an instance of a term with quotient 9/2. - Michel Marcus, Dec 17 2017
a(25) > 10^13. - Giovanni Resta, Feb 17 2020

Examples

			3 is a term since rho(3) = 2, so 3/rho(3) is 3/2.
10 is a term since rho(10) = 4, so 10/rho(10) is 5/2.
42 is a term since rho(42) = 12, so 42/rho(42) is 7/2.
		

Crossrefs

Cf. A127724 (k-imperfect), A206369 (rho).
Cf. A159907 (hemiperfect).

Programs

  • Maple
    rho:= proc(n) local f;
      mul((f[1]^(f[2]+1)+(-1)^f[2])/(f[1]+1), f = ifactors(n)[2]);
    end proc:
    select(t -> denom(t/rho(t)) = 2, [$1..10^6]); # Robert Israel, Nov 20 2017
  • Mathematica
    (* b = A209369 *) b[n_] := n*DivisorSum[n, LiouvilleLambda[#]/# &];
    Select[Range[10^6], If[Denominator[#/b[#]] == 2, Print[#]; True, False]&] (* Jean-François Alcover, Dec 04 2017 *)
  • PARI
    rho(n) = {my(f = factor(n), res = q = 1); for(i=1, #f~, q = 1; for(j = 1, f[i, 2], q = -q + f[i, 1]^j); res *= q); res;}
    isok(n) = denominator(n/rho(n))==2;

Extensions

a(20) from Jinyuan Wang, Feb 15 2020
a(21)-a(24) from Giovanni Resta, Feb 17 2020
Showing 1-10 of 13 results. Next