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.

A340922 a(n) is the position of phi(A038568(n)^2)/phi(A038569(n)^2) in the enumeration of the rationals by A038568 and A038569, where phi is A000010.

Original entry on oeis.org

0, 1, 2, 19, 20, 3, 4, 35, 36, 9, 10, 239, 240, 55, 56, 57, 58, 13, 14, 83, 84, 16, 15, 1059, 1060, 255, 256, 23, 24, 259, 260, 265, 266, 25, 26, 615, 616, 145, 146, 39, 40, 272, 271, 1763, 1764, 423, 424, 427, 428, 435, 436, 51, 52, 443, 444, 947, 948, 241, 242
Offset: 0

Views

Author

Hugo Pfoertner, Feb 19 2021

Keywords

Examples

			  n                   0   1   2   3    4   5    6    7    8   9    10
  j/k                 1  1/2  2  1/3   3  2/3  3/2  1/4   4  3/4  4/3
  phi(j^2)/phi(k^2)   1  1/2  2  1/6   6  1/3   3   1/8   8  3/4  4/3
  a(n)                0   1   2   19  20   3    4    35  36   9    10
.
  n                  11    12   13    14   15    16    17   18   19   20
  j/k                1/5    5  2/5   5/2  3/5    5/3  4/5  5/4  1/6    6
  phi(j^2)/phi(k^2)  1/20  20  1/10   10  3/10  10/3  2/5  5/2  1/12  12
  a(n)               239  240   55    56   57    58    13   14   83   84
		

Crossrefs

Programs

  • Julia
    using Nemo
    function A340922List(len)
        num(a) = euler_phi(numerator(a)^2)
        den(a) = euler_phi(denominator(a)^2)
        a, q, A, R = QQ(0), QQ(0), [], Int[]
        for n in 1:len
            q = next_minimal(q)
            x = num(q)//den(q)
            while true
                i = findfirst(isequal(x), A)
                if i == nothing
                    a = next_minimal(a)
                    push!(A, a)
                else
                    push!(R, i - 1)
                    break
                end
            end
        end
        R
    end
    A340922List(59) |> println # Peter Luschny, Feb 19 2021
  • PARI
    \\ It is assumed that a38568 and a38569 are available as vectors,
    \\ e.g. from the corresponding b-files.
    \\ a38568=readvec("[path] a38568"); a38569=readvec("[path] a38569");
    findinlist(n,d)={my(num=numerator(n/d),den=denominator(n/d));for(k=1,#a38568,if(num==a38568[k]&&den==a38569[k],return(k)));0};
    for(k=1,60,my(m=a38568[k],n=a38569[k],num=eulerphi(m^2),den=eulerphi(n^2));print1(findinlist(num,den)-1,", "))