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.

A322311 Lexicographically earliest such sequence a that a(i) = a(j) => A322310(i) = A322310(j) for all i, j.

Original entry on oeis.org

1, 2, 3, 4, 3, 5, 3, 6, 3, 7, 3, 8, 3, 3, 3, 9, 3, 5, 3, 10, 3, 7, 3, 11, 3, 3, 3, 7, 3, 7, 3, 12, 3, 3, 3, 13, 3, 3, 3, 14, 3, 5, 3, 2, 3, 7, 3, 15, 3, 3, 3, 7, 3, 7, 3, 2, 3, 7, 3, 16, 3, 3, 3, 17, 3, 7, 3, 3, 3, 7, 3, 18, 3, 3, 3, 3, 3, 7, 3, 19, 3, 7, 3, 20, 3, 3, 3, 8, 3, 3, 3, 2, 3, 3, 3, 21, 3, 3, 3, 5, 3, 7, 3, 2, 3
Offset: 1

Views

Author

Antti Karttunen, Dec 03 2018

Keywords

Comments

Restricted growth sequence transform of A322310.
For all i, j: a(i) = a(j) => A014197(i) = A014197(j).

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; };
    A320000sq(n, k) = if(1==n, if(1==k,2,1), sumdiv(n, d, if(d>=k && isprime(d+1), my(p=d+1, q=n/d); sum(i=0, valuation(n, p), A320000sq(q/(p^i), p))))); \\ Cf. A320000
    A322310(n) = if(1==n,3,my(m=1); fordiv(n,d, my(s, p=d+1, q=n/d); if(isprime(p) && (s = sum(i=0,valuation(n, p), A320000sq(q/(p^i),p))), m *= prime(s))); (m));
    v322311 = rgs_transform(vector(up_to, n, A322310(n)));
    A322311(n) = v322311[n];

A014197 Number of numbers m with Euler phi(m) = n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Carmichael conjectured that there are no 1's in this sequence. - Jud McCranie, Oct 10 2000
Number of cyclotomic polynomials of degree n. - T. D. Noe, Aug 15 2003
Let v == 0 (mod 24), w = v + 24, and v < k < q < w, where k and q are integer. It seems that, for most values of v, there is no b such that b = a(k) + a(q) and b > a(v) + a(w). The first case where b > a(v) + a(w) occurs at v = 888: b = a(896) + a(900) = 15 + 4, b > a(888) + a(912), or 19 > 8 + 7. The first case where v < n < w and a(n) > a(v) + a(w) occurs at v = 2232: a(2240) > a(2232) + a(2256), or 27 > 7 + 8. - Sergey Pavlov, Feb 05 2017
One elementary result relating to phi(m) is that if m is odd, then phi(m)=phi(2m) because 1 and 2 both have phi value 1 and phi is multiplicative. - Roderick MacPhee, Jun 03 2017

References

  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004, Section B39, pp. 144-146.
  • Joe Roberts, Lure of The Integers, The Mathematical Association of America, 1992, entry 32, page 182.

Crossrefs

Cf. A000010, A002202, A032446 (bisection), A049283, A051894, A055506, A057635, A057826, A058277 (nonzero terms), A058341, A063439, A066412, A070243 (partial sums), A070633, A071386 (positions of odd terms), A071387, A071388 (positions of primes), A071389 (where prime(n) occurs for the first time), A082695, A097942 (positions of records), A097946, A120963, A134269, A219930, A280611, A280709, A280712, A296655 (positions of positive even terms), A305353, A305656, A319048, A322019.
For records see A131934.
Column 1 of array A320000.

Programs

  • GAP
    a := function(n)
    local S, T, R, max, i, k, r;
    S:=[];
    for i in DivisorsInt(n)+1 do
        if IsPrime(i)=true then
            S:=Concatenation(S,[i]);
        fi;
    od;
    T:=[];
    for k in [1..Size(S)] do
        T:=Concatenation(T,[S[k]/(S[k]-1)]);
    od;
    max := n*Product(T);
    R:=[];
    for r in [1..Int(max)] do
        if Phi(r)=n then
            R:=Concatenation(R,[r]);
        fi;
    od;
    return Size(R);
    end; # Miles Englezou, Oct 22 2024
  • Magma
    [#EulerPhiInverse(n): n in [1..100]]; // Marius A. Burtea, Sep 08 2019
    
  • Maple
    with(numtheory): A014197:=n-> nops(invphi(n)): seq(A014197(n), n=1..200);
  • Mathematica
    a[1] = 2; a[m_?OddQ] = 0; a[m_] := Module[{p, nmax, n, k}, p = Select[ Divisors[m]+1, PrimeQ]; nmax = m*Times @@ (p/(p - 1)); n = m; k = 0; While[n <= nmax, If[EulerPhi[n] == m, k++]; n++]; k]; Array[a, 92] (* Jean-François Alcover, Dec 09 2011, updated Apr 25 2016 *)
    With[{nn = 116}, Function[s, Function[t, Take[#, nn] &@ ReplacePart[t, Map[# -> Length@ Lookup[s, #] &, Keys@ s]]]@ ConstantArray[0, Max@ Keys@ s]]@ KeySort@ PositionIndex@ Array[EulerPhi, Floor[nn^(3/2)] + 10]] (* Michael De Vlieger, Jul 19 2017 *)
  • PARI
    A014197(n,m=1) = { n==1 && return(1+(m<2)); my(p,q); sumdiv(n, d, if( d>=m && isprime(d+1), sum( i=0,valuation(q=n\d,p=d+1), A014197(q\p^i,p))))} \\ M. F. Hasler, Oct 05 2009
    
  • PARI
    a(n) = invphiNum(n); \\ Amiram Eldar, Nov 15 2024 using Max Alekseyev's invphi.gp
    
  • Python
    from sympy import totient, divisors, isprime, prod
    def a(m):
        if m == 1: return 2
        if m % 2: return 0
        X = (x + 1 for x in divisors(m))
        nmax=m*prod(i/(i - 1) for i in X if isprime(i))
        n=m
        k=0
        while n<=nmax:
            if totient(n)==m:k+=1
            n+=1
        return k
    print([a(n) for n in range(1, 51)]) # Indranil Ghosh, Jul 18 2017, after Mathematica code
    

Formula

Dirichlet g.f.: Sum_{n>=1} a(n)*n^-s = zeta(s)*Product_(1+1/(p-1)^s-1/p^s). - Benoit Cloitre, Apr 12 2003
Limit_{n->infinity} (1/n) * Sum_{k=1..n} a(k) = zeta(2)*zeta(3)/zeta(6) = 1.94359643682075920505707036... (see A082695). - Benoit Cloitre, Apr 12 2003
From Christopher J. Smyth, Jan 08 2017: (Start)
Euler transform = Product_{n>=1} (1-x^n)^(-a(n)) = g.f. of A120963.
Product_{n>=1} (1+x^n)^a(n)
= Product_{n>=1} ((1-x^(2n))/(1-x^n))^a(n)
= Product_{n>=1} (1-x^n)^(-A280712(n))
= Euler transform of A280712 = g.f. of A280611.
(End)
a(A000010(n)) = A066412(n). - Antti Karttunen, Jul 18 2017
From Antti Karttunen, Dec 04 2018: (Start)
a(A000079(n)) = A058321(n).
a(A000142(n)) = A055506(n).
a(A017545(n)) = A063667(n).
a(n) = Sum_{d|n} A008683(n/d)*A070633(d).
a(n) = A056239(A322310(n)).
(End)

A322312 a(n) = Product_{d|n, d+1 is prime} prime(1+A286561(n,d+1)), where A286561(n,k) gives the k-valuation of n (for k > 1).

Original entry on oeis.org

2, 6, 2, 20, 2, 18, 2, 28, 2, 12, 2, 120, 2, 6, 2, 88, 2, 60, 2, 60, 2, 12, 2, 168, 2, 6, 2, 40, 2, 72, 2, 104, 2, 6, 2, 800, 2, 6, 2, 168, 2, 54, 2, 40, 2, 12, 2, 528, 2, 12, 2, 40, 2, 84, 2, 56, 2, 12, 2, 1440, 2, 6, 2, 136, 2, 72, 2, 20, 2, 24, 2, 2240, 2, 6, 2, 20, 2, 36, 2, 528, 2, 12, 2, 720, 2, 6, 2, 112, 2
Offset: 1

Views

Author

Antti Karttunen, Dec 03 2018

Keywords

Crossrefs

Cf. A067513, A185633, A286561, A322313 (rgs-transform), A322314.
Cf. also A293514, A322310.

Programs

  • PARI
    A322312(n) = { my(m=1,p); fordiv(n,d,p=1+d; if(isprime(p), for(i=0,oo,if(n%(p^i),m *= prime(i);break)))); (m); };

Formula

a(n) = Product_{d|n} A000040(1+A286561(n,1+d))^A010051(1+d).
a(n) = A181819(A185633(n)).
For all n, A001222(a(n)) = A067513(n).

A320000 Square array A(n, k) read by descending antidiagonals: A(1, 1) = 2, A(1, k) = 1 for k > 1, and for n > 1, A(n, k) = Sum_{d|n, d>=k} A010051(1+d)*[Sum_{i=0..valuation(n,1+d)} A((n/d)/((1+d)^i), 1+d)].

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 03 2018

Keywords

Comments

This square array gives the values obtained from the recursive PARI-program that M. F. Hasler has provided Oct 05 2009 for A014197, in its two-argument form.

Examples

			Array begins as:
n  | k=1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16, ...
---+------------------------------------------------
1  |   2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
2  |   3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
3  |   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
4  |   4, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
5  |   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
6  |   4, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
7  |   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
8  |   5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
9  |   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
10 |   2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, ...
11 |   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
12 |   6, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, ...
13 |   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
14 |   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
15 |   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
16 |   6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
		

Crossrefs

Cf. A014197 (column 1).

Programs

  • PARI
    up_to = 120;
    A320000sq(n, k) = if(1==n, if(1==k,2,1), sumdiv(n, d, if(d>=k && isprime(d+1), my(p=d+1, q=n/d); sum(i=0, valuation(n, p), A320000sq(q/(p^i), p))))); \\ After M. F. Hasler's code in A014197
    A320000list(up_to) = { my(v = vector(up_to), i=0); for(a=1,oo, for(col=1,a, i++; if(i > up_to, return(v)); v[i] = A320000sq(col,(a-(col-1))))); (v); };
    v320000 = A320000list(up_to);
    A320000(n) = v320000[n];
Showing 1-4 of 4 results.