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-4 of 4 results.

A051953 Cototient(n) := n - phi(n).

Original entry on oeis.org

0, 1, 1, 2, 1, 4, 1, 4, 3, 6, 1, 8, 1, 8, 7, 8, 1, 12, 1, 12, 9, 12, 1, 16, 5, 14, 9, 16, 1, 22, 1, 16, 13, 18, 11, 24, 1, 20, 15, 24, 1, 30, 1, 24, 21, 24, 1, 32, 7, 30, 19, 28, 1, 36, 15, 32, 21, 30, 1, 44, 1, 32, 27, 32, 17, 46, 1, 36, 25, 46, 1, 48, 1, 38, 35, 40, 17, 54, 1, 48, 27
Offset: 1

Views

Author

Labos Elemer, Dec 21 1999

Keywords

Comments

Unlike totients, cototient(n+1) = cototient(n) never holds -- except 2-phi(2) = 3 - phi(3) = 1 -- because cototient(n) is congruent to n modulo 2. - Labos Elemer, Aug 08 2001
Theorem (L. Redei): b^a(n) == b^n (mod n) for every integer b. - Thomas Ordowski and Robert Israel, Mar 11 2016
Let S be the sum of the cototients of the divisors of n (A001065). S < n iff n is deficient, S = n iff n is perfect, and S > n iff n is abundant. - Ivan N. Ianakiev, Oct 06 2023

Examples

			n = 12, phi(12) = 4 = |{1, 5, 7, 11}|, a(12) = 12 - phi(12) = 8, numbers not exceeding 12 and not coprime to 12: {2, 3, 4, 6, 8, 9, 10, 12}.
		

Crossrefs

Cf. A000010, A001065 (inverse Möbius transform), A005278, A001274, A083254, A098006, A049586, A051612, A053579, A054525, A062790 (Möbius transform), A063985 (partial sums), A063986, A290087.
Records: A065385, A065386.
Number of zeros in the n-th row of triangle A054521. - Omar E. Pol, May 13 2016
Cf. A063740 (number of k such that cototient(k) = n). - M. F. Hasler, Jan 11 2018

Programs

  • Haskell
    a051953 n = n - a000010 n  -- Reinhard Zumkeller, Jan 21 2014
    
  • Maple
    with(numtheory); A051953 := n->n-phi(n);
  • Mathematica
    Table[n - EulerPhi[n], {n, 1, 80}] (* Carl Najafi, Aug 16 2011 *)
  • PARI
    A051953(n) = n - eulerphi(n); \\ Michael B. Porter, Jan 28 2010
    
  • Python
    from sympy.ntheory import totient
    print([i - totient(i) for i in range(1, 101)]) # Indranil Ghosh, Mar 17 2017

Formula

a(n) = n - A000010(n).
Equals Mobius transform (A054525) of A001065. - Gary W. Adamson, Jul 11 2008
a(A006881(n)) = sopf(A006881(n)) - 1; a(A000040(n)) = 1. - Wesley Ivan Hurt, May 18 2013
G.f.: sum(n>=1, A000010(n)*x^(2*n)/(1-x^n) ). - Mircea Merca, Feb 23 2014
From Ilya Gutkovskiy, Apr 13 2017: (Start)
G.f.: -Sum_{k>=2} mu(k)*x^k/(1 - x^k)^2.
Dirichlet g.f.: zeta(s-1)*(1 - 1/zeta(s)). (End)
From Antti Karttunen, Sep 05 2018 & Apr 29 2022: (Start)
Dirichlet convolution square of A317846/A046644 gives this sequence + A063524.
a(n) = A003557(n) * A318305(n).
a(n) = A000010(n) - A083254(n).
a(n) = A318325(n) - A318326(n).
a(n) = Sum_{d|n} A062790(d) = Sum_{d|n, dA007431(d)*(A000005(n/d)-1).
a(n) = A048675(A318834(n)) = A276085(A353564(n)). [These follow from the formula below]
a(n) = Sum_{d|n, dA000010(d).
a(n) = A051612(n) - A001065(n).
(End)

A255242 Calculate the aliquot parts of a number n and take their sum. Then repeat the process calculating the aliquot parts of all the previous aliquot parts and add their sum to the previous one. Repeat the process until the sum to be added is zero. Sequence lists these sums.

Original entry on oeis.org

0, 1, 1, 4, 1, 8, 1, 12, 5, 10, 1, 30, 1, 12, 11, 32, 1, 36, 1, 38, 13, 16, 1, 92, 7, 18, 19, 46, 1, 74, 1, 80, 17, 22, 15, 140, 1, 24, 19, 116, 1, 90, 1, 62, 51, 28, 1, 256, 9, 62, 23, 70, 1, 136, 19, 140, 25, 34, 1, 286, 1, 36, 61, 192, 21, 122, 1, 86, 29, 114
Offset: 1

Views

Author

Paolo P. Lava, Feb 19 2015

Keywords

Comments

a(n) = 1 if n is prime.

Examples

			The aliquot parts of 8 are 1, 2, 4 and their sum is 7.
Now, let us calculate the aliquot parts of 1, 2 and 4:
1 => 0;  2 => 1;  4 => 1, 2.  Their sum is 0 + 1 + 1 + 2 = 4.
Let us calculate the aliquot parts of 1, 1, 2:
1 => 0;  1 = > 0; 2 => 1. Their sum is 1.
We have left 1: 1 => 0.
Finally, 7 + 4 + 1 = 12. Therefore a(8) = 12.
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:=proc(q) local a,b,c,k,n,t,v;
    for n from 1 to q do b:=0; a:=sort([op(divisors(n))]); t:=nops(a)-1;
    while add(a[k],k=1..t)>0 do b:=b+add(a[k],k=1..t); v:=[];
    for k from 2 to t do c:=sort([op(divisors(a[k]))]); v:=[op(v),op(c[1..nops(c)-1])]; od;
    a:=v; t:=nops(a); od; print(b); od; end: P(10^3);
  • Mathematica
    f[s_] := Flatten[Most[Divisors[#]] & /@ s]; a[n_] := Total@Flatten[FixedPointList[ f, {n}]] - n; Array[a, 100] (* Amiram Eldar, Apr 06 2019 *)
  • PARI
    ali(n) = setminus(divisors(n), Set(n));
    a(n) = my(list = List(), v = [n]); while (#v, my(w = []); for (i=1, #v, my(s=ali(v[i])); for (j=1, #s, w = concat(w, s[j]); listput(list, s[j]));); v = w;); vecsum(Vec(list)); \\ Michel Marcus, Jul 15 2023

Formula

a(1) = 0.
a(2^k) = k*2^(k-1) = A001787(k), for k>=1.
a(n^k) = (n^k-2^k)/(n-2), for n odd prime and k>=1.
In particular:
a(3^k) = A001047(k-1);
a(5^k) = A016127(k-1);
a(7^k) = A016130(k-1);
a(11^k) = A016135(k-1).
From Antti Karttunen, Nov 22 2024: (Start)
a(n) = A330575(n) - n.
Also, following formulas were conjectured by Sequence Machine:
a(n) = (A191161(n)-n)/2.
a(n) = Sum_{d|n} A001065(d)*A074206(n/d). [Compare to David A. Corneth's Apr 13 2020 formula for A330575]
a(n) = Sum_{d|n} A051953(d)*A067824(n/d).
a(n) = Sum_{d|n} A000203(d)*A174726(n/d).
a(n) = Sum_{d|n} A062790(d)*A253249(n/d).
a(n) = Sum_{d|n} A157658(d)*A191161(n/d).
a(n) = Sum_{d|n} A174725(d)*A211779(n/d).
a(n) = Sum_{d|n} A245211(d)*A323910(n/d).
(End)

A318836 Product_{d|n, dA007431(d) > 0} prime(A007431(d)), where A007431 is the Möbius transform of Euler's totient function.

Original entry on oeis.org

1, 2, 2, 2, 2, 4, 2, 4, 4, 10, 2, 8, 2, 22, 20, 12, 2, 28, 2, 20, 44, 46, 2, 48, 10, 62, 28, 44, 2, 100, 2, 84, 92, 94, 110, 112, 2, 118, 124, 300, 2, 484, 2, 92, 700, 146, 2, 1008, 22, 530, 188, 124, 2, 1036, 230, 1452, 236, 206, 2, 2000, 2, 218, 3388, 1596, 310, 2116, 2, 188, 292, 5170, 2, 7056, 2, 298, 5300, 236, 506
Offset: 1

Views

Author

Antti Karttunen, Sep 05 2018

Keywords

Crossrefs

Cf. A007431, A062790, A318837 (rgs-transform).
Cf. also A318838.

Programs

  • PARI
    A007431(n) = sumdiv(n,d,moebius(n/d)*eulerphi(d));
    A318836(n) = { my(m=1); fordiv(n,d,if((dA007431(d)!=0),m *= prime(A007431(d)))); (m); };

Formula

a(n) = product_{d|n, dA008578(1+A007431(d)).
For all n >= 1, A056239(a(n)) = A062790(n).

A318837 Restricted growth sequence transform of A318836.

Original entry on oeis.org

1, 2, 2, 2, 2, 3, 2, 3, 3, 4, 2, 5, 2, 6, 7, 8, 2, 9, 2, 7, 10, 11, 2, 12, 4, 13, 9, 10, 2, 14, 2, 15, 16, 17, 18, 19, 2, 20, 21, 22, 2, 23, 2, 16, 24, 25, 2, 26, 6, 27, 28, 21, 2, 29, 30, 31, 32, 33, 2, 34, 2, 35, 36, 37, 38, 39, 2, 28, 40, 41, 2, 42, 2, 43, 44, 32, 45, 46, 2, 47, 29, 48, 2, 49, 50, 51, 52, 53, 2, 54, 55, 40, 56, 57, 58, 59, 2, 60, 61, 44, 2
Offset: 1

Views

Author

Antti Karttunen, Sep 05 2018

Keywords

Crossrefs

Programs

  • PARI
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A007431(n) = sumdiv(n,d,moebius(n/d)*eulerphi(d));
    A318836(n) = { my(m=1); fordiv(n,d,if((dA007431(d)!=0),m *= prime(A007431(d)))); (m); }; \\
    v318837 = rgs_transform(vector(up_to,n,A318836(n)));
    A318837(n) = v318837[n];

Formula

For all i, j: a(i) = a(j) => A062790(i) = A062790(j).
Showing 1-4 of 4 results.