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

A241919 If n is a prime power, p_i^e, a(n) = i, (with a(1)=0), otherwise difference (i-j) of the indices of the two largest distinct primes p_i, p_j, i > j in the prime factorization of n: a(n) = A061395(n) - A061395(A051119(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 13 2014

Keywords

Comments

See A242411 and A241917 for other variants.

Crossrefs

Programs

  • Haskell
    a241919 1 = 0
    a241919 n = i - j where
                (i:j:_) = map a049084 $ reverse (1 : a027748_row n)
    -- Reinhard Zumkeller, May 15 2014
    
  • Python
    from sympy import factorint, primefactors, primepi
    def a061395(n): return 0 if n==1 else primepi(primefactors(n)[-1])
    def a053585(n):
        if n==1: return 1
        p = primefactors(n)[-1]
        return p**factorint(n)[p]
    def a051119(n): return n/a053585(n)
    def a(n): return a061395(n) - a061395(a051119(n)) # Indranil Ghosh, May 19 2017
  • Scheme
    (define (A241919 n) (- (A061395 n) (A061395 (A051119 n))))
    

Formula

a(n) = A061395(n) - A061395(A051119(n)).

A242411 If n is a prime power, p_i^e, a(n) = 0, otherwise difference (i-j) of the indices of the two largest distinct primes p_i, p_j, i > j in the prime factorization of n: a(n) = A061395(n) - A061395(A051119(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 13 2014

Keywords

Crossrefs

Cf. A000961 (positions of zeros).

Programs

  • Haskell
    a242411 1 = 0
    a242411 n = i - j where
                (i:j:_) = map a049084 $ ps ++ [p]
                ps@(p:_) = reverse $ a027748_row n
    -- Reinhard Zumkeller, May 15 2014
    
  • Python
    from sympy import factorint, primefactors, primepi
    def a061395(n): return 0 if n==1 else primepi(primefactors(n)[-1])
    def a053585(n):
        if n==1: return 1
        p = primefactors(n)[-1]
        return p**factorint(n)[p]
    def a051119(n): return n/a053585(n)
    def a(n): return 0 if n==1 or len(primefactors(n))==1 else a061395(n) - a061395(a051119(n)) # Indranil Ghosh, May 19 2017
  • Scheme
    (define (A242411 n) (if (= 1 (A001221 n)) 0 (- (A061395 n) (A061395 (A051119 n)))))
    

Formula

If A001221(n) = 1, then a(n) = 0, otherwise a(n) = A241919(n) = A061395(n) - A061395(A051119(n)).

A253783 a(1) = 0; for n>1: a(n) = A075167(1+A071178(n)) + (A061395(n) - A061395(A051119(n))) + a(A051119(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 16 2015

Keywords

Comments

An auxiliary recurrence for computing A075167.

Crossrefs

Formula

a(1) = 0; for n>1: a(n) = A075167(1+A071178(n)) + (A061395(n) - A061395(A051119(n))) + a(A051119(n)).

A122111 Self-inverse permutation of the positive integers induced by partition enumeration in A112798 and partition conjugation.

Original entry on oeis.org

1, 2, 4, 3, 8, 6, 16, 5, 9, 12, 32, 10, 64, 24, 18, 7, 128, 15, 256, 20, 36, 48, 512, 14, 27, 96, 25, 40, 1024, 30, 2048, 11, 72, 192, 54, 21, 4096, 384, 144, 28, 8192, 60, 16384, 80, 50, 768, 32768, 22, 81, 45, 288, 160, 65536, 35, 108, 56, 576, 1536, 131072, 42
Offset: 1

Views

Author

Keywords

Comments

Factor n; replace each prime(i) with i, take the conjugate partition, replace parts i with prime(i) and multiply out.
From Antti Karttunen, May 12-19 2014: (Start)
For all n >= 1, A001222(a(n)) = A061395(n), and vice versa, A061395(a(n)) = A001222(n).
Because the partition conjugation doesn't change the partition's total sum, this permutation preserves A056239, i.e., A056239(a(n)) = A056239(n) for all n.
(Similarly, for all n, A001221(a(n)) = A001221(n), because the number of steps in the Ferrers/Young-diagram stays invariant under the conjugation. - Note added Apr 29 2022).
Because this permutation commutes with A241909, in other words, as a(A241909(n)) = A241909(a(n)) for all n, from which follows, because both permutations are self-inverse, that a(n) = A241909(a(A241909(n))), it means that this is also induced when partitions are conjugated in the partition enumeration system A241918. (Not only in A112798.)
(End)
From Antti Karttunen, Jul 31 2014: (Start)
Rows in arrays A243060 and A243070 converge towards this sequence, and also, assuming no surprises at the rate of that convergence, this sequence occurs also as the central diagonal of both.
Each even number is mapped to a unique term of A102750 and vice versa.
Conversely, each odd number (larger than 1) is mapped to a unique term of A070003, and vice versa. The permutation pair A243287-A243288 has the same property. This is also used to induce the permutations A244981-A244984.
Taking the odd bisection and dividing out the largest prime factor results in the permutation A243505.
Shares with A245613 the property that each term of A028260 is mapped to a unique term of A244990 and each term of A026424 is mapped to a unique term of A244991.
Conversely, with A245614 (the inverse of above), shares the property that each term of A244990 is mapped to a unique term of A028260 and each term of A244991 is mapped to a unique term of A026424.
(End)
The Maple program follows the steps described in the first comment. The subprogram C yields the conjugate partition of a given partition. - Emeric Deutsch, May 09 2015
The Heinz number of the partition that is conjugate to the partition with Heinz number n. The Heinz number of a partition p = [p_1, p_2, ..., p_r] is defined as Product(p_j-th prime, j=1...r). Example: a(3) = 4. Indeed, the partition with Heinz number 3 is [2]; its conjugate is [1,1] having Heinz number 4. - Emeric Deutsch, May 19 2015

Crossrefs

Cf. A088902 (fixed points).
Cf. A112798, A241918 (conjugates the partitions listed in these two tables).
Cf. A243060 and A243070. (Limit of rows in these arrays, and also their central diagonal).
Cf. A319988 (parity of this sequence for n > 1), A336124 (a(n) mod 4).
{A000027, A122111, A241909, A241916} form a 4-group.
{A000027, A122111, A153212, A242419} form also a 4-group.
Cf. also array A350066 [A(i, j) = a(a(i)*a(j))].

Programs

  • Maple
    with(numtheory): c := proc (n) local B, C: B := proc (n) local pf: pf := op(2, ifactors(n)): [seq(seq(pi(op(1, op(i, pf))), j = 1 .. op(2, op(i, pf))), i = 1 .. nops(pf))] end proc: C := proc (P) local a: a := proc (j) local c, i: c := 0; for i to nops(P) do if j <= P[i] then c := c+1 else  end if end do: c end proc: [seq(a(k), k = 1 .. max(P))] end proc: mul(ithprime(C(B(n))[q]), q = 1 .. nops(C(B(n)))) end proc: seq(c(n), n = 1 .. 59); # Emeric Deutsch, May 09 2015
    # second Maple program:
    a:= n-> (l-> mul(ithprime(add(`if`(jAlois P. Heinz, Sep 30 2017
  • Mathematica
    A122111[1] = 1; A122111[n_] := Module[{l = #, m = 0}, Times @@ Power @@@ Table[l -= m; l = DeleteCases[l, 0]; {Prime@Length@l, m = Min@l}, Length@Union@l]] &@Catenate[ConstantArray[PrimePi[#1], #2] & @@@ FactorInteger@n]; Array[A122111, 60] (* JungHwan Min, Aug 22 2016 *)
    a[n_] := Function[l, Product[Prime[Sum[If[jJean-François Alcover, Sep 23 2020, after Alois P. Heinz *)
  • PARI
    A122111(n) = if(1==n,n,my(f=factor(n), es=Vecrev(f[,2]),is=concat(apply(primepi,Vecrev(f[,1])),[0]),pri=0,m=1); for(i=1, #es, pri += es[i]; m *= prime(pri)^(is[i]-is[1+i])); (m)); \\ Antti Karttunen, Jul 20 2020
    
  • Python
    from sympy import factorint, prevprime, prime, primefactors
    from operator import mul
    def a001222(n): return 0 if n==1 else a001222(n/primefactors(n)[0]) + 1
    def a064989(n):
        f=factorint(n)
        return 1 if n==1 else reduce(mul, [1 if i==2 else prevprime(i)**f[i] for i in f])
    def a105560(n): return 1 if n==1 else prime(a001222(n))
    def a(n): return 1 if n==1 else a105560(n)*a(a064989(n))
    [a(n) for n in range(1, 101)] # Indranil Ghosh, Jun 15 2017
  • Scheme
    ;; Uses Antti Karttunen's IntSeq-library.
    (definec (A122111 n) (if (<= n 1) n (* (A000040 (A001222 n)) (A122111 (A064989 n)))))
    ;; Antti Karttunen, May 12 2014
    
  • Scheme
    ;; Uses Antti Karttunen's IntSeq-library.
    (definec (A122111 n) (if (<= n 1) n (* (A000079 (A241917 n)) (A003961 (A122111 (A052126 n))))))
    ;; Antti Karttunen, May 12 2014
    
  • Scheme
    ;; Uses Antti Karttunen's IntSeq-library.
    (definec (A122111 n) (if (<= n 1) n (* (expt (A000040 (A071178 n)) (A241919 n)) (A242378bi (A071178 n) (A122111 (A051119 n))))))
    ;; Antti Karttunen, May 12 2014
    

Formula

From Antti Karttunen, May 12-19 2014: (Start)
a(1) = 1, a(p_i) = 2^i, and for other cases, if n = p_i1 * p_i2 * p_i3 * ... * p_{k-1} * p_k, where p's are primes, not necessarily distinct, sorted into nondescending order so that i1 <= i2 <= i3 <= ... <= i_{k-1} <= ik, then a(n) = 2^(ik-i_{k-1}) * 3^(i_{k-1}-i_{k-2}) * ... * p_{i_{k-1}}^(i2-i1) * p_ik^(i1).
This can be implemented as a recurrence, with base case a(1) = 1,
and then using any of the following three alternative formulas:
a(n) = A105560(n) * a(A064989(n)) = A000040(A001222(n)) * a(A064989(n)). [Cf. the formula for A242424.]
a(n) = A000079(A241917(n)) * A003961(a(A052126(n))).
a(n) = (A000040(A071178(n))^A241919(n)) * A242378(A071178(n), a(A051119(n))). [Here ^ stands for the ordinary exponentiation, and the bivariate function A242378(k,n) changes each prime p(i) in the prime factorization of n to p(i+k), i.e., it's the result of A003961 iterated k times starting from n.]
a(n) = 1 + A075157(A129594(A075158(n-1))). [Follows from the commutativity with A241909, please see the comments section.]
(End)
From Antti Karttunen, Jul 31 2014: (Start)
As a composition of related permutations:
a(n) = A153212(A242419(n)) = A242419(A153212(n)).
a(n) = A241909(A241916(n)) = A241916(A241909(n)).
a(n) = A243505(A048673(n)).
a(n) = A064216(A243506(n)).
Other identities. For all n >= 1, the following holds:
A006530(a(n)) = A105560(n). [The latter sequence gives greatest prime factor of the n-th term].
a(2n)/a(n) = A105560(2n)/A105560(n), which is equal to A003961(A105560(n))/A105560(n) when n > 1.
A243505(n) = A052126(a(2n-1)) = A052126(a(4n-2)).
A066829(n) = A244992(a(n)) and vice versa, A244992(n) = A066829(a(n)).
A243503(a(n)) = A243503(n). [Because partition conjugation does not change the partition size.]
A238690(a(n)) = A238690(n). - per Matthew Vandermast's note in that sequence.
A238745(n) = a(A181819(n)) and a(A238745(n)) = A181819(n). - per Matthew Vandermast's note in A238745.
A181815(n) = a(A181820(n)) and a(A181815(n)) = A181820(n). - per Matthew Vandermast's note in A181815.
(End)
a(n) = A181819(A108951(n)). [Prime shadow of the primorial inflation of n] - Antti Karttunen, Apr 29 2022

A053585 If n = p_1^e_1 * ... * p_k^e_k, p_1 < ... < p_k primes, then a(n) = p_k^e_k.

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 7, 8, 9, 5, 11, 3, 13, 7, 5, 16, 17, 9, 19, 5, 7, 11, 23, 3, 25, 13, 27, 7, 29, 5, 31, 32, 11, 17, 7, 9, 37, 19, 13, 5, 41, 7, 43, 11, 5, 23, 47, 3, 49, 25, 17, 13, 53, 27, 11, 7, 19, 29, 59, 5, 61, 31, 7, 64, 13, 11, 67, 17, 23, 7, 71, 9, 73, 37, 25, 19, 11, 13, 79
Offset: 1

Views

Author

Frederick Magata (frederick.magata(AT)uni-muenster.de), Jan 19 2000

Keywords

Comments

Let p be the largest prime dividing n, a(n) is the largest power of p dividing n.

Examples

			a(42)=7 because 42=2*3*7, a(144)=9 because 144=16*9=2^4*3^2.
		

Crossrefs

Programs

  • Haskell
    a053585 = last . a141809_row  -- Reinhard Zumkeller, Jan 29 2013
    
  • Maple
    a:= n-> `if`(n=1, 1, (i->i[1]^i[2])(sort(ifactors(n)[2])[-1])):
    seq(a(n), n=1..100);  # Alois P. Heinz, Nov 03 2023
  • Mathematica
    Table[Power @@ Last @ FactorInteger @ n, {n, 79}] (* Jean-François Alcover, Apr 01 2011 *)
  • PARI
    a(n)=if(n>1,my(f=factor(n)); f[#f~,1]^f[#f~,2],1) \\ Charles R Greathouse IV, Nov 10 2015
    
  • Python
    from sympy import factorint, primefactors
    def a(n):
        if n==1: return 1
        p = primefactors(n)[-1]
        return p**factorint(n)[p] # Indranil Ghosh, May 19 2017

Formula

a(n) = A006530(n)^A071178(n). - Reinhard Zumkeller, Aug 27 2011
a(n) = A141809(n,A001221(n)). - Reinhard Zumkeller, Jan 29 2013

Extensions

More terms from Andrew Gacek (andrew(AT)dgi.net), Apr 20 2000

A345992 Let m = A344005(n) = smallest m such that n divides m*(m+1); a(n) = gcd(n,m).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 3, 1, 2, 5, 1, 1, 2, 1, 4, 3, 2, 1, 8, 1, 2, 1, 7, 1, 5, 1, 1, 11, 2, 7, 4, 1, 2, 3, 5, 1, 6, 1, 11, 9, 2, 1, 3, 1, 2, 17, 4, 1, 2, 5, 7, 3, 2, 1, 15, 1, 2, 9, 1, 5, 11, 1, 4, 23, 14, 1, 8, 1, 2, 3, 19, 7, 6, 1, 5, 1, 2, 1, 4, 17, 2, 29, 8, 1, 9, 13, 23, 3, 2, 19, 32, 1, 2, 11, 4, 1, 17
Offset: 1

Views

Author

Keywords

Comments

By definition, a(n)*A345993(n) = n.
a(n) is even iff n/2 is in A344000. This is true, but essentially trivial, and does not provide any insight into either sequence.
Empirical: For n >= 3, a(n) <= n/3, and a(n) = n/3 iff n is in 3*{2^odd, primes == -1 mod 6}.
If n = 2*p^k where p is an odd prime then m = A344005(n) = p^k - 1 and a(n) = 2. Conversely, it appears that if a(n) = 2 then n is twice an odd prime power. (Corrected by Antti Karttunen, Jun 14 2022)
a(n) = 1 if n is a prime power. - Chai Wah Wu, Jun 01 2022
From Antti Karttunen, Jun 14 2022: (Start)
Conversely, if a(n) = 1 [i.e., A345993(n) = n] then n is a power of prime. (This follows from N. J. A. Sloane's Jul 11 2021 theorem given in A344005).
Apparently, a(n) = 3 iff n = A354984(k) = 3*A137827(k), for some k >= 1.
(End)

Crossrefs

Cf. A011772, A137827, A182665, A344000, A344005, A345993, A345994, A345995, A354930, A354931 (the least occurrence of each n=1..), A354984.
Cf. also A007528, A051119, A284600.

Programs

  • Maple
    # load Findm from A344005
    ans:=[];
    for n from 1 to 40 do t1:=Findm(n)[1]; ans:=[op(ans), igcd(n,t1)]; od:
    ans;
  • Mathematica
    smd[n_]:=Module[{m=1},While[Mod[m(m+1),n]!=0,m++];GCD[n,m]]; Array[smd,110] (* Harvey P. Dale, Jan 07 2022 *)
  • PARI
    f(n) = my(m=1); while ((m*(m+1)) % n, m++); m; \\ A344005
    a(n) = gcd(n,f(n)); \\ Michel Marcus, Aug 06 2021
    (Python 3.8+)
    from math import gcd, prod
    from itertools import combinations
    from sympy import factorint
    from sympy.ntheory.modular import crt
    def A345992(n):
        if n == 1:
            return 1
        plist = tuple(p**q for p, q in factorint(n).items())
        return 1 if len(plist) == 1 else gcd(n,int(min(min(crt((m, n//m), (0, -1))[0], crt((n//m, m), (0, -1))[0]) for m in (prod(d) for l in range(1, len(plist)//2+1) for d in combinations(plist, l))))) # Chai Wah Wu, Jun 01 2022

Formula

a(n) = gcd(n, A182665(n)) = gcd(A182665(n), A344005(n)). - Antti Karttunen, Jun 13 2022

A349056 Number of weakly alternating permutations of the multiset of prime factors of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Dec 02 2021

Keywords

Comments

We define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either. Then a sequence is alternating in the sense of A025047 iff it is a weakly alternating anti-run.
A prime index of n is a number m such that prime(m) divides n. For n > 1, the multiset of prime factors of n is row n of A027746. The prime indices A112798 can also be used.

Examples

			The following are the weakly alternating permutations for selected n:
n = 2   6    12    24     48      60     90     120     180
   ----------------------------------------------------------
    2   23   223   2223   22223   2253   2335   22253   22335
        32   232   2232   22232   2325   2533   22325   22533
             322   2322   22322   2523   3253   22523   23253
                   3222   23222   3252   3325   23252   23352
                          32222   3522   3352   25232   25233
                                  5232   3523   32225   25332
                                         5233   32522   32325
                                         5332   35222   32523
                                                52223   33252
                                                52322   33522
                                                        35232
                                                        52323
                                                        53322
		

Crossrefs

Counting all permutations of prime factors gives A008480.
The variation counting anti-run permutations is A335452.
The strong case is A345164, with twins A344606.
Compositions of this type are counted by A349052, also A129852 and A129853.
Compositions not of this type are counted by A349053, ranked by A349057.
The version for patterns is A349058, strong A345194.
The version for ordered factorizations is A349059, strong A348610.
Partitions of this type are counted by A349060, complement A349061.
The complement is counted by A349797.
The non-alternating case is A349798.
A001250 counts alternating permutations, complement A348615.
A003242 counts Carlitz (anti-run) compositions.
A025047 counts alternating or wiggly compositions, ranked by A345167.
A056239 adds up prime indices, row sums of A112798, row lengths A001222.
A071321 gives the alternating sum of prime factors, reverse A071322.
A344616 gives the alternating sum of prime indices, reverse A316524.
A345165 counts partitions w/o an alternating permutation, ranked by A345171.
A345170 counts partitions w/ an alternating permutation, ranked by A345172.
A348379 counts factorizations with an alternating permutation.
A349800 counts weakly but not strongly alternating compositions.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    whkQ[y_]:=And@@Table[If[EvenQ[m],y[[m]]<=y[[m+1]],y[[m]]>=y[[m+1]]],{m,1,Length[y]-1}];
    Table[Length[Select[Permutations[primeMS[n]],whkQ[#]||whkQ[-#]&]],{n,100}]

A075167 Number of edges in each rooted plane tree produced with the unranking algorithm presented in A075166, which is based on prime factorization.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 13 2002

Keywords

Comments

Each n occurs A000108(n) times in total.

Crossrefs

Permutation of A072643 and A106457.
A253782 gives the positions where this sequence differs from A252464 (first time at n=16).
Cf. also A106490.

Formula

a(n) = A106457(A106442(n)). - Antti Karttunen, May 09 2005
From Antti Karttunen, Jan 16 2015: (Start)
a(1) = 0; for n>1: a(n) = a(A071178(n)) + (A061395(n) - A061395(A051119(n))) + A253783(A051119(n)).
Other identities.
For all n >= 2, a(n) = A055642(A075166(n))/2. [Half of the number of decimal digits in A075166(n).]
For all n >= 2, a(n) = A029837(1+A075165(n))/2. [Half of the binary width of A075165(n).]
For all n >= 1, a(n) = A000120(A075165(n)). [Thus also the binary weight of A075165(n), because half of the bits are zeros.]
(End)

Extensions

More terms from Antti Karttunen, May 09 2005

A242419 Reverse both the exponents and the deltas of the indices of distinct primes present in the prime factorization of n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 11, 18, 13, 35, 10, 16, 17, 12, 19, 75, 21, 77, 23, 54, 25, 143, 27, 245, 29, 30, 31, 32, 55, 221, 14, 36, 37, 323, 91, 375, 41, 105, 43, 847, 50, 437, 47, 162, 49, 45, 187, 1859, 53, 24, 33, 1715, 247, 667, 59, 150, 61, 899, 147, 64, 65
Offset: 1

Views

Author

Antti Karttunen, May 17 2014

Keywords

Comments

This self-inverse permutation (involution) of natural numbers preserves both the total number of prime divisors and the (index of) largest prime factor of n, i.e. for all n it holds that A001222(a(n)) = A001222(n) and A006530(a(n)) = A006530(n) [equally: A061395(a(n)) = A061395(n)].
Considered as an operation on partitions encoded by the indices of primes in the prime factorization of n (as in table A112798), this implements a bijection which reverses the order of "steps" in Young (or Ferrers) diagram of a partition (but keeps the horizontal line segment of each step horizontal and the vertical line segment vertical). Please see the last example in the example section.
To understand the given recursive formula, it helps to see that in the above context (Young diagrams drawn with French notation), the sequences employed effect the following operations:
A001222: gives the height of whole diagram,
A051119: removes the bottommost step from the diagram,
A241919: gives the length of the horizontal line segment of the bottom step, i.e. its width,
A071178: gives the length of the vertical line segment of the bottom step, i.e. its height,
A242378(k,n): increases the width of whole Young diagram encoded by n by adding a rectangular area A001222(n) squares high and k squares wide to its left,
and finally, multiplying by A000040(a)^b adds a new topmost step whose width is a and height is b. Particularly, multiplying by (A000040(A241919(n))^A071178(n)) transfers the bottommost step to the top.

Examples

			For n = 10 = 2*5 = p_1^1 * p_3^1, we get p_(3-1)^1 * p_3^1 = 3 * 5 = 15, thus a(10) = 15.
For n = 20 = 2*2*5 = p_1^2 * p_3^1, we get p_(3-1)^1 * p_3^2 = 3^1 * 5^2 = 3*25 = 75, thus a(20) = 75.
For n = 84 = 2*2*3*7 = p_1^2 * p_2 * p_4, when we reverse the deltas of indices, and reverse also the order of exponents, we get p_(4-2) * p_(4-1) * p_4^2 = 3 * 5 * 7^2 = 735, thus a(84) = 735.
For n = 2200, we see that it encodes the partition (1,1,1,3,3,5) in A112798 as 2200 = p_1 * p_1 * p_1 * p_3 * p_3 * p_5 = 2^3 * 5^2 * 11. This in turn corresponds to the following Young diagram in French notation:
   _
  | |
  | |
  | |_ _
  |     |
  |     |_ _
  |_ _ _ _ _|
Reversing the order of "steps", so that each horizontal and vertical line segment centered around a "convex corner" moves as a whole, means that the first stair from the top (one unit wide and three units high) is moved to the last position, the second one (two units wide and two units high) stays in the middle, and the original bottom step (two units wide and one unit high) will be the new topmost step, thus we get the following Young diagram:
   _ _
  |   |_ _
  |       |
  |       |_
  |         |
  |         |
  |_ _ _ _ _|
which represents the partition (2,4,4,5,5,5), encoded in A112798 by p_2 * p_4^2 * p_5^3 = 3 * 7^2 * 11^3 = 195657, thus a(2200) = 195657.
		

Crossrefs

Fixed points: A242417.
{A000027, A122111, A153212, A242419} form a 4-group.
{A000027, A069799, A242415, A242419} form also a 4-group.

Formula

If n = p_a^e_a * p_b^e_b * ... * p_h^e_h * p_i^e_i * p_j^e_j * p_k^e_k, where p_a < ... < p_k are distinct primes (sorted into ascending order) in the prime factorization of n, and e_a .. e_k are their nonzero exponents, then a(n) = p_{k-j}^e_k * p_{k-i}^e_j * p_{k-h}^e_i * ... * p_{k-a}^e_b * p_k^e_a.
As a recurrence:
a(1) = 1, and for n>1, a(n) = (A000040(A241919(n))^A071178(n)) * A242378(A241919(n), a(A051119(n))).
By composing related permutations:
a(n) = A122111(A153212(n)) = A153212(A122111(n)).
a(n) = A069799(A242415(n)) = A242415(A069799(n)).
a(n) = A105119(A242420(n)).

A345993 Let m = A344005(n) = smallest m such that n divides m*(m+1); a(n) = gcd(n,m+1).

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 7, 8, 9, 5, 11, 4, 13, 7, 3, 16, 17, 9, 19, 5, 7, 11, 23, 3, 25, 13, 27, 4, 29, 6, 31, 32, 3, 17, 5, 9, 37, 19, 13, 8, 41, 7, 43, 4, 5, 23, 47, 16, 49, 25, 3, 13, 53, 27, 11, 8, 19, 29, 59, 4, 61, 31, 7, 64, 13, 6, 67, 17, 3, 5, 71, 9, 73, 37, 25, 4, 11, 13, 79
Offset: 1

Views

Author

Keywords

Comments

By definition, a(n) <= n and a(n)*A345992(n) = n.
a(n) is even iff n/2 is in A344001. This is true, but essentially trivial, and does not provide any insight into either sequence.
Empirical: For n >= 3, a(n) >= 3, and a(n) = 3 iff n in 3*{2^odd, primes == -1 mod 6}.

Crossrefs

Programs

  • Maple
    # load Findm from A344005
    ans:=[];
    for n from 1 to 40 do t1:=Findm(n)[1]+1; ans:=[op(ans), igcd(n,t1)]; od:
    ans;
  • PARI
    f(n) = my(m=1); while ((m*(m+1)) % n, m++); m; \\ A344005
    a(n) = gcd(n, f(n)+1); \\ Michel Marcus, Aug 06 2021
    
  • Python
    from math import gcd, prod
    from itertools import combinations
    from sympy import factorint
    from sympy.ntheory.modular import crt
    def A345993(n):
        if n == 1:
            return 1
        plist = tuple(p**q for p, q in factorint(n).items())
        return n if len(plist) == 1 else gcd(n,1+int(min(min(crt((m, n//m), (0, -1))[0], crt((n//m, m), (0, -1))[0]) for m in (prod(d) for l in range(1, len(plist)//2+1) for d in combinations(plist, l))))) # Chai Wah Wu, Jun 16 2022
Showing 1-10 of 20 results. Next