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

A066086 Greatest common divisor of product (p-1) and product (p+1), where p ranges over distinct prime divisors of n; a(n) = gcd(A048250(n), A173557(n)).

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 6, 8, 1, 2, 2, 2, 2, 4, 2, 2, 2, 2, 6, 2, 6, 2, 8, 2, 1, 4, 2, 24, 2, 2, 6, 8, 2, 2, 12, 2, 2, 8, 2, 2, 2, 2, 2, 8, 6, 2, 2, 8, 6, 4, 2, 2, 8, 2, 6, 4, 1, 12, 4, 2, 2, 4, 24, 2, 2, 2, 6, 8, 6, 12, 24, 2, 2, 2, 2, 2, 12, 4, 6, 8, 2, 2, 8, 8, 2, 4, 2, 24, 2, 2, 6, 4
Offset: 1

Views

Author

Labos Elemer, Dec 04 2001

Keywords

Comments

Frequently equal, but not identical, to A009223 (i.e. GCD of sigma and phi of n).

Crossrefs

Programs

  • Mathematica
    ffi[x_] := Flatten[FactorInteger[x]] lf[x_] := Length[FactorInteger[x]] ba[x_] := Table[Part[ffi[x], 2*w-1], {w, 1, lf[x]}] cor[x_] := Apply[Times, ba[x]] g1[x_] := GCD[DivisorSigma[1, x], EulerPhi[x]] g2[x_] := GCD[DivisorSigma[1, cor[x]], EulerPhi[cor[x]]] Table[g2[w], {w, 1, 128}]
    a[n_] := If[n == 1, 1, Module[{f=FactorInteger[n]}, GCD[Times@@((#-1)& @@@ f), Times@@((#+1)& @@@ f)]]]; Array[a, 100] (* Amiram Eldar, Dec 05 2018 *)
  • PARI
    a(n)=my(f=factor(n)[,1]);gcd(prod(i=1,#f,f[i]+1),prod(i=1,#f,f[i]-1)) \\ Charles R Greathouse IV, Feb 14 2013

Formula

a(n) = gcd(A048250(n), A023900(n)) = gcd(A000203(A007947(n)), A000010(A007947(n))).
a(n) = A322360(n) / A322359(n). - Antti Karttunen, Dec 04 2018

Extensions

Name edited, part of the old name transferred to the formula section by Antti Karttunen, Dec 04 2018

A295887 Filter sequence combining A003557(n) and A173557(n); the restricted growth sequence transform of A291756.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 03 2017

Keywords

Comments

First define function f(n) = (1/2)*(2 + ((A003557(n) + A173557(n))^2) - A003557(n) - 3*A173557(n)), or in short, f(n) = P(A003557(n), A173557(n)), where P(n,k) is triangular table sequence A000027 used as an injective N x N -> N pairing function. Then apply the restricted growth sequence transform to the sequence f(1), f(2), f(3), ... See the example-section.
This is also the restricted growth sequence transform of sequence A291756, as A291756(n) = P(A003557(n), A000010(n)), where again P(n,k) is sequence A000027 used as a pairing function. Given either an ordered pair (A003557(n),A000010(n)) or (A003557(n),A173557(n)), the other one can be computed because A000010(n) = A003557(n)*A173557(n).
Note that the exact pairing function P used is not important, as long as it provides an injective mapping N x N -> N. So instead of Cantor's mapping we could as well used bit-interleaving A054238 (Morton code) to pack together A003557(n) and A173557(n), or equally, A000010(n) and A003557(n).

Examples

			The first ten terms of the sequence f(n) = (1/2)*(2 + ((A003557(n) + A173557(n))^2) - A003557(n) - 3*A173557(n)) are 1, 1, 2, 3, 7, 2, 16, 10, 9, 7. When we assign to each newly occurring term the least unused number k so far (starting by giving k=1 for the initial term, this k increases by one for each new distinct term produced by f(n) when n grows), and for each repeated term the same number it was given the previous time (equal to the number it was given for the first time), we obtain 1, 1, 2, 3, 4, 2, 5, 6, 7, 4, the first 10 terms of this sequence. Note how f(10) = 7 gets 4 because when seven occurred for the first time at f(5), it was the 4th distinct new number in that sequence.
This is also true for the sequence A291756 although there the terms are different: 1, 1, 2, 5, 7, 2, 16, 25, 31, 7.
		

Crossrefs

Programs

  • PARI
    allocatemem(2^30);
    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; };
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    A003557(n) = { my(f=factor(n)); for (i=1, #f~, f[i, 2] = max(0,f[i, 2]-1)); factorback(f); };
    A173557(n) = my(f=factor(n)[, 1]); prod(k=1, #f, f[k]-1); \\ This function from Michel Marcus, Oct 31 2017
    Anotsubmitted7(n) = (1/2)*(2 + ((A003557(n)+A173557(n))^2) - A003557(n) - 3*A173557(n));
    write_to_bfile(1,rgs_transform(vector(up_to,n,Anotsubmitted7(n))),"b295887.txt");

A322320 a(n) = gcd(A003557(n), A173557(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 05 2018

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := If[n == 1, 1, Module[{f=FactorInteger[n]}, GCD[ Times@@ (First[#] ^(Last[#]-1)& /@  f), Times@@((#-1)& @@@ f)]]]; Array[a, 120] (* Amiram Eldar, Dec 05 2018 *)
  • PARI
    A003557(n) = { my(f=factor(n)); for (i=1, #f~, f[i, 2] = f[i, 2]-1); factorback(f); }; \\ From A003557
    A173557(n) = factorback(apply(p -> p-1, factor(n)[, 1]));
    A322320(n) = gcd(A173557(n), A003557(n));

Formula

a(n) = gcd(A003557(n), A173557(n)) = gcd(A322351(n), A322352(n)).
a(n) = A000010(n) / A322321(n).

A322321 a(n) = lcm(A003557(n), A173557(n)).

Original entry on oeis.org

1, 1, 2, 2, 4, 2, 6, 4, 6, 4, 10, 2, 12, 6, 8, 8, 16, 6, 18, 4, 12, 10, 22, 4, 20, 12, 18, 6, 28, 8, 30, 16, 20, 16, 24, 6, 36, 18, 24, 4, 40, 12, 42, 10, 24, 22, 46, 8, 42, 20, 32, 12, 52, 18, 40, 12, 36, 28, 58, 8, 60, 30, 12, 32, 48, 20, 66, 16, 44, 24, 70, 12, 72, 36, 40, 18, 60, 24, 78, 8, 54, 40, 82, 12, 64, 42, 56, 20
Offset: 1

Views

Author

Antti Karttunen, Dec 05 2018

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := If[n == 1, 1, Module[{f=FactorInteger[n]}, LCM[ Times@@ (First[#] ^(Last[#]-1)& /@  f), Times@@((#-1)& @@@ f)]]]; Array[a, 120] (* Amiram Eldar, Dec 05 2018 *)
  • PARI
    A003557(n) = { my(f=factor(n)); for (i=1, #f~, f[i, 2] = f[i, 2]-1); factorback(f); }; \\ From A003557
    A173557(n) = factorback(apply(p -> p-1, factor(n)[, 1]));
    A322321(n) = lcm(A003557(n), A173557(n));

Formula

a(n) = lcm(A003557(n), A173557(n)) = lcm(A322351(n), A322352(n)).
a(n) = A000010(n) / A322320(n).

A342416 a(n) = gcd(A173557(n), A342001(n)).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 3, 8, 1, 1, 1, 1, 4, 2, 1, 1, 1, 2, 3, 1, 2, 1, 1, 1, 1, 2, 1, 12, 2, 1, 3, 8, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 4, 4, 1, 1, 8, 1, 2, 1, 1, 2, 1, 3, 1, 1, 6, 1, 1, 4, 2, 1, 1, 1, 1, 3, 1, 2, 6, 1, 1, 2, 2, 1, 1, 2, 2, 3, 8, 5, 1, 1, 4, 2, 2, 1, 24, 1, 1, 1, 5, 2, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Antti Karttunen, Mar 11 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Array[GCD[#2, #1/#3] & @@ {If[#1 < 2, 0, #1 Total[#2/#1 & @@@ #2]], If[#1 == 1, 1, Times @@ Map[# - 1 &, #2[[All, 1]] ]], #1/Times @@ #2[[All, 1]]} & @@ {Abs[#], FactorInteger[#]} &, 91] (* Michael De Vlieger, Mar 11 2021 *)
  • PARI
    A003415(n) = if(n<=1, 0, my(f=factor(n)); n*sum(i=1, #f~, f[i, 2]/f[i, 1]));
    A003557(n) = (n/factorback(factorint(n)[, 1]));
    A342413(n) = gcd(eulerphi(n), A003415(n));
    A342416(n) = (A342413(n)/A003557(n));

Formula

a(n) = A342413(n) / A003557(n) = gcd(A173557(n), A342001(n)).

A322351 a(n) = min(A003557(n), A173557(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 05 2018

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := If[n == 1, 1, Module[{f=FactorInteger[n]}, Min[ Times@@ (First[#]^(Last[#]-1)& /@  f), Times@@((#-1)& @@@ f)]]]; Array[a, 120] (* Amiram Eldar, Dec 05 2018 *)
  • PARI
    A003557(n) = { my(f=factor(n)); for (i=1, #f~, f[i, 2] = f[i, 2]-1); factorback(f); }; \\ From A003557
    A173557(n) = factorback(apply(p -> p-1, factor(n)[, 1]));
    A322351(n) = min(A003557(n), A173557(n));

Formula

a(n) = min(A003557(n), A173557(n)).
a(n) = A000010(n) / A322352(n).

A322352 a(n) = max(A003557(n), A173557(n)).

Original entry on oeis.org

1, 1, 2, 2, 4, 2, 6, 4, 3, 4, 10, 2, 12, 6, 8, 8, 16, 3, 18, 4, 12, 10, 22, 4, 5, 12, 9, 6, 28, 8, 30, 16, 20, 16, 24, 6, 36, 18, 24, 4, 40, 12, 42, 10, 8, 22, 46, 8, 7, 5, 32, 12, 52, 9, 40, 6, 36, 28, 58, 8, 60, 30, 12, 32, 48, 20, 66, 16, 44, 24, 70, 12, 72, 36, 8, 18, 60, 24, 78, 8, 27, 40, 82, 12, 64, 42, 56, 10, 88, 8
Offset: 1

Views

Author

Antti Karttunen, Dec 05 2018

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := If[n == 1, 1, Module[{f=FactorInteger[n]}, Max[ Times @@ (First[#]^ (Last[#]-1)& /@  f), Times@@((#-1)& @@@ f)]]]; Array[a, 120] (* Amiram Eldar, Dec 05 2018 *)
  • PARI
    A003557(n) = { my(f=factor(n)); for (i=1, #f~, f[i, 2] = f[i, 2]-1); factorback(f); }; \\ From A003557
    A173557(n) = factorback(apply(p -> p-1, factor(n)[, 1]));
    A322352(n) = max(A003557(n), A173557(n));

Formula

a(n) = max(A003557(n), A173557(n)).
a(n) = A000010(n) / A322351(n).

A345049 a(n) = A173557(n) * A345001(n).

Original entry on oeis.org

-1, 0, -2, 3, -12, 10, -30, 11, 2, 20, -90, 40, -132, 30, 16, 31, -240, 48, -306, 104, 0, 50, -462, 112, -36, 60, 26, 192, -756, 344, -870, 79, -80, 80, -240, 158, -1260, 90, -144, 312, -1560, 636, -1722, 440, 216, 110, -2070, 280, -162, 152, -320, 600, -2652, 186, -880, 600, -432, 140, -3306, 1120, -3540, 150, 348, 191
Offset: 1

Views

Author

Antti Karttunen, Jun 06 2021

Keywords

Crossrefs

Programs

Formula

a(n) = A173557(n) * A345001(n).
a(n) = A345048(n) - A345050(n).

A318841 a(n) = n - A173557(n).

Original entry on oeis.org

0, 1, 1, 3, 1, 4, 1, 7, 7, 6, 1, 10, 1, 8, 7, 15, 1, 16, 1, 16, 9, 12, 1, 22, 21, 14, 25, 22, 1, 22, 1, 31, 13, 18, 11, 34, 1, 20, 15, 36, 1, 30, 1, 34, 37, 24, 1, 46, 43, 46, 19, 40, 1, 52, 15, 50, 21, 30, 1, 52, 1, 32, 51, 63, 17, 46, 1, 52, 25, 46, 1, 70, 1, 38, 67, 58, 17, 54, 1, 76, 79, 42, 1, 72, 21, 44, 31, 78, 1, 82, 19, 70, 33, 48
Offset: 1

Views

Author

Antti Karttunen, Sep 16 2018

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := n - Times @@ (FactorInteger[n][[;;, 1]] - 1); a[1] = 0; Array[a, 100] (* Amiram Eldar, Dec 16 2023 *)
  • PARI
    A173557(n) = factorback(apply(p -> p-1, factor(n)[, 1]));
    A318841(n) = (n-A173557(n));

Formula

a(n) = n - A173557(n).
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = 1 - A307868 = 0.528319... . - Amiram Eldar, Dec 16 2023

A387157 a(n) = A173557(sigma(n)), where A173557(n) is multiplicative with a(p^e) = p-1 and sigma is the sum of divisors function.

Original entry on oeis.org

1, 2, 1, 6, 2, 2, 1, 8, 12, 2, 2, 6, 6, 2, 2, 30, 2, 24, 4, 12, 1, 2, 2, 8, 30, 12, 4, 6, 8, 2, 1, 12, 2, 2, 2, 72, 18, 8, 6, 8, 12, 2, 10, 12, 24, 2, 2, 30, 36, 60, 2, 6, 2, 8, 2, 8, 4, 8, 8, 12, 30, 2, 12, 126, 12, 2, 16, 12, 2, 2, 2, 96, 36, 36, 30, 24, 2, 12, 4, 60, 10, 12, 12, 6, 2, 20, 8, 8, 8, 24, 6, 12, 1, 2, 8
Offset: 1

Views

Author

Antti Karttunen, Aug 19 2025

Keywords

Crossrefs

Cf. A000203, A003958, A080398, A173557, A387158 (positions where equal to A173557(n)).
Cf. also A351442.

Programs

  • Mathematica
    A387157[n_] := If[n == 1, 1, Times @@ (FactorInteger[DivisorSigma[1, n]][[All, 1]] - 1)];
    Array[A387157, 100] (* Paolo Xausa, Aug 20 2025 *)
  • PARI
    A387157(n) = factorback(apply(p -> p-1,factor(sigma(n))[,1]));

Formula

a(n) = A003958(A080398(n)).
Showing 1-10 of 94 results. Next