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

A276052 Least k > 1 such that phi(k*n-1) = phi(k*n+1), or -1 if no such k exists.

Original entry on oeis.org

5, 4, 3, 2, 15, 106, 21, 127, 3, 39282, 3, 53, 135, 65014, 5, 9489, 171, 361, 27, 19641, 7, 13133, 141, 6326, 3, 6978, 19, 32507, 375, 13094, 165, 93186, 19, 1359, 9, 12588, 15, 171, 45, 35253, 3, 35794, 9, 16796, 7, 1689, 69, 3163, 3, 13653, 57, 3489, 12, 249, 45, 58497, 9
Offset: 1

Views

Author

Altug Alkan, Aug 17 2016

Keywords

Comments

Least k > 1 such that k*n is in A066812. - Robert Israel, Aug 30 2016

Examples

			a(5) = 15 because phi(15*5-1) = phi(15*5+1).
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
       for k from 2 do if numtheory:-phi(k*n-1) = numtheory:-phi(k*n+1) then
          return k
       fi od end proc:
    map(f, [$1..60]); # Robert Israel, Aug 30 2016
  • Mathematica
    kmax = 10^9;
    a[n_] := Module[{k}, For[k = 2, k <= kmax, k++, If[EulerPhi[k n - 1] == EulerPhi[k n + 1] , Print[n, " ", k]; Return[k]]]; -1];
    Array[a, 60] (* Jean-François Alcover, Oct 06 2020 *)
  • PARI
    a(n) = {my(k = 2); while (eulerphi(k*n+1) != eulerphi(k*n-1), k++); k; }

Extensions

Name corrected by Robert Israel, Aug 30 2016

A276373 Least k such that phi(k*n-1) = phi(k*n+1), or -1 if no such k exists.

Original entry on oeis.org

5, 4, 3, 2, 1, 106, 21, 1, 1, 39282, 1, 53, 135, 65014, 5, 9489, 171, 361, 27, 19641, 7, 13133, 141, 6326, 3, 6978, 1, 32507, 375, 13094, 165, 93186, 1, 1359, 9, 12588, 15, 171, 45, 35253, 3, 35794, 9, 16796, 7, 1689, 69, 3163, 3, 13653, 57, 3489, 12, 249, 45, 58497, 9
Offset: 1

Views

Author

Altug Alkan and Robert Israel, Aug 31 2016

Keywords

Comments

Least k such that k*n is in A066812.
If n is in A066812 then a(n) = 1, otherwise a(n) = A276052(n).

Examples

			a(5) = 15 because phi(15*5-1) = phi(15*5+1).
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
       for k from 1 do if numtheory:-phi(k*n-1) = numtheory:-phi(k*n+1) then
          return k
       fi od end proc:
    map(f, [$1..60]);
  • Mathematica
    kmax = 10^8;
    a[n_] := For[k = 1, k <= kmax, k++, If[EulerPhi[k*n - 1] == EulerPhi[k*n + 1], Print[n, " ", k]; Return[k]]] /. Null -> -1;
    Table[a[n], {n, 1, 1000}] (* Jean-François Alcover, Jun 03 2024 *)

A291530 a(n) is the smallest k such that uphi(k*n) = uphi(k*n+1), or 0 if no such k exists.

Original entry on oeis.org

1, 10, 373, 5, 4, 372, 5, 26, 248, 2, 13, 186, 11, 562, 247, 13, 627, 124, 195, 1, 183, 86, 245, 93, 5184, 8, 185, 281, 1623, 4320, 72, 738, 43, 2296, 1, 62, 20, 2312, 95, 3240, 576, 732, 33, 43, 111, 4600, 540100, 492, 115, 2592, 209, 4, 25383, 2388, 629, 549, 65, 1732, 64476, 2160, 20, 36, 61
Offset: 1

Views

Author

Altug Alkan, Aug 25 2017

Keywords

Examples

			a(3) = 373 because uphi(373*3) = uphi(373*3+1) and 373 is the smallest number with this property.
		

Crossrefs

Programs

  • PARI
    uphi(n) = my(f=factor(n)); prod(i=1, #f~, f[i, 1]^f[1, 2]-1);
    a(n) = {my(k = 1); while (uphi(k*n) != uphi(k*n+1), k++); k; }
Showing 1-3 of 3 results.