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

A081373 Number of values of k, 1 <= k <= n, with phi(k) = phi(n), where phi is Euler totient function, A000010.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Mar 24 2003

Keywords

Comments

Ordinal transform of Euler totient function phi, A000010. - Antti Karttunen, Aug 26 2024

Examples

			For n = 16: phi(k) = {1,1,2,2,4,2,6,4,6,4,10,4,12,6,8,8} for k = 1,...,n; 2 numbers exist with phi(k) = phi(n) = 8: {15,16}, so a(16) = 2.
If n = p is an odd prime number, then a(p) = 1 with phi(k) = p-1.
		

Crossrefs

Cf. A000010, A081375 (positions of records), A210719 (of 1's).
Cf. also A067004, A303756, A303757, A303777 (ordinal transform of this sequence).

Programs

  • Mathematica
    f[x_] := Count[Table[EulerPhi[j]-EulerPhi[x], {j, 1, x}], 0] Table[f[w], {w, 1, 100}]
  • PARI
    a(n)=my(t=eulerphi(n), s); sum(k=1, n, eulerphi(k)==t) \\ Charles R Greathouse IV, Feb 21 2013, corrected by Antti Karttunen, Aug 26 2024
    
  • PARI
    a(n) = #select(x -> x <= n, invphi(eulerphi(n))); \\ Amiram Eldar, Nov 08 2024, using Max Alekseyev's invphi.gp

A303757 a(1) = 1 and for n > 1, a(n) = number of values of k, 2 <= k <= n, with A000010(k) = A000010(n), where A000010 is Euler totient function phi.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 30 2018

Keywords

Comments

Ordinal transform of f, where f(1) = 0 and f(n) = A000010(n) for n > 1.
After a(1)=1 and a(4)=2, the positions of the rest of records is given by A081375(n) = 6, 12, 30, 42, 72, 78, 84, 90, 190, ..., for n >= 3.
Apart from a(2) = 1, the other positions of 1's is given by A210719.

Crossrefs

Programs

  • Mathematica
    With[{s = EulerPhi@ Range@ 105}, MapAt[# + 1 &, Table[Count[s[[2 ;; n]], ?(# == s[[n]] &)], {n, Length@ s}], 1]] (* _Michael De Vlieger, Nov 23 2018 *)
  • PARI
    up_to = 65537;
    ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };
    Aux303757(n) = if(1==n,0,eulerphi(n));
    v303757 = ordinal_transform(vector(up_to,n,Aux303757(n)));
    A303757(n) = v303757[n];

Formula

Except for a(2) = 1, a(n) = A081373(n).

A303777 Ordinal transform of A081373; ordinal transform of {the ordinal transform of A000010}.

Original entry on oeis.org

1, 1, 2, 2, 3, 1, 4, 3, 4, 2, 5, 1, 6, 3, 7, 5, 8, 2, 9, 4, 6, 7, 10, 3, 11, 5, 8, 4, 12, 1, 13, 9, 10, 6, 14, 2, 15, 7, 11, 5, 16, 1, 17, 8, 9, 12, 18, 3, 13, 6, 19, 7, 20, 8, 14, 4, 15, 16, 21, 2, 22, 17, 10, 18, 23, 5, 24, 11, 25, 3, 26, 1, 27, 9, 12, 6, 19, 1, 28, 10, 29, 11, 30, 1, 31, 13, 32, 7, 33, 1, 20, 21, 14, 22, 15, 8
Offset: 1

Views

Author

Antti Karttunen, Apr 30 2018

Keywords

Crossrefs

Cf. A000010, A081373, A081375 (positions of ones), A210719 (positions of records), A286610.

Programs

  • Maple
    b:= proc() 0 end: g:= proc() 0 end:
    h:= proc(n) option remember; local t;
          t:= numtheory[phi](n); b(t):= b(t)+1
        end:
    a:= proc(n) option remember; local t;
          t:= h(n); g(t):= g(t)+1
        end:
    seq(a(n), n=1..120);  # Alois P. Heinz, Apr 30 2018
  • Mathematica
    b[] = 0; g[] = 0;
    h[n_] := h[n] = With[{t = EulerPhi[n]}, b[t] = b[t]+1];
    a[n_] := a[n] = With[{t = h[n]}, g[t] = g[t]+1];
    Array[a, 120] (* Jean-François Alcover, Dec 19 2021, after Alois P. Heinz *)
  • PARI
    up_to = 65537;
    ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };
    v081373 = ordinal_transform(vector(up_to,n,eulerphi(n)));
    A081373(n) = v081373[n];
    v303777 = ordinal_transform(vector(up_to,n,A081373(n)));
    A303777(n) = v303777[n];

A081376 a(n) is the least number such that A067003[a(n)] = n.

Original entry on oeis.org

1, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 37, 41, 43, 46, 48, 50, 51, 52, 54, 55, 56, 57, 58, 62, 63, 65, 68, 69, 72, 74, 75, 76, 77, 80, 82, 85, 86, 87, 88, 91, 92, 93, 94, 95, 96, 98, 99, 100, 104, 106, 108, 111, 112, 115, 116, 117, 118, 119, 122, 123
Offset: 1

Views

Author

Labos Elemer, Mar 24 2003

Keywords

Crossrefs

Programs

  • Mathematica
    g[x_] := Length[FactorInteger[x]] f[x_] := Count[Table[g[j] - g[x], {j, 1, x}], 0] Table[f[w], {w, 1, 100}]

A272329 Indices of records in A272328.

Original entry on oeis.org

1, 3, 16, 15, 35, 39, 45, 91, 111, 117, 135, 364, 287, 296, 292, 273, 369, 385, 429, 482, 465, 866, 819, 861, 915, 964, 1154, 1209, 1281, 1558, 1448, 1395, 1845, 1928, 2432, 2336, 2308, 2306, 2275, 2379, 3472, 3416, 3285, 3344, 2583, 3224, 2715, 2775, 2896, 3003
Offset: 1

Views

Author

Tom Edgar, Apr 25 2016

Keywords

Crossrefs

Programs

  • Mathematica
    t = Table[Count[Range@ n, k_ /; EulerPhi@ n == EulerPhi[n + k]], {n, 3600}]; TakeWhile[Flatten[FirstPosition[t, #] & /@ Range@ Max@ t] /. n_ /; MissingQ@ n -> 0, # != 0 &] (* Michael De Vlieger, Apr 25 2016, Version 10.2 *)
  • Sage
    L=[sum([1 for k in [1..n] if euler_phi(n)==euler_phi(n+k)]) for n in [1..4000]]
    print([L.index(i)+1 for i in [1..50]])
Showing 1-5 of 5 results.