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

A241912 Fixed points of A241916.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 11, 13, 15, 16, 17, 18, 19, 23, 29, 31, 32, 37, 41, 43, 45, 47, 50, 53, 55, 59, 61, 64, 67, 71, 73, 79, 83, 89, 97, 98, 101, 103, 105, 107, 108, 109, 113, 119, 127, 128, 131, 135, 137, 139, 149, 150, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199
Offset: 1

Views

Author

Antti Karttunen, May 03 2014

Keywords

Comments

A natural number n occurs here if and only if it is either a power of 2, or satisfies A001511(n) = A071178(n) [the exponent of highest power of 2 dividing n is one less than the exponent of the largest prime factor of n], and all the intermediate exponents form a palindrome. [Please see the definition of A241916.]
Numbers for which the corresponding rows in A112798 and A241918 are the conjugate partitions of each other.

Examples

			98 = 2*7*7 = p_1^1 * p_2^0 * p_3^0 * p_4^2 is included because 2 occurs once, the highest prime factor 7 occurs twice (thus A001511(150) = A071178(150) = 2), and the intermediate exponents (in this case {0,0}) form a palindrome.
150 = 2*3*5*5 = p_1^1 * p_2^1 * p_3^2 is included because 2 occurs once, the highest prime factor 5 occurs twice (thus A001511(150) = A071178(150) = 2), and the intermediate exponents (in this case 1) form a palindrome.
		

Crossrefs

Complement: A241913.
A079704 is a subsequence.

Programs

  • Mathematica
    f[n_] := If[n == 1, {0}, Function[f, ReplacePart[Table[0, {PrimePi[f[[-1, 1]]]}], #] &@ Map[PrimePi@ First@ # -> Last@ # &, f]]@ FactorInteger@ n]; g[w_List] := Times @@ Flatten@ MapIndexed[Prime[#2]^#1 &, w]; Table[#[[n + 1]]/2, {n, Length@ # - 1}] &@ Select[Range@ 400, g@ f@ # == g@ Reverse@ f@ # &] (* Michael De Vlieger, Aug 27 2016 *)

Formula

a(n) = A242418(n+1)/2.

A241913 Complement of A241912, natural numbers not fixed by A241916.

Original entry on oeis.org

6, 9, 10, 12, 14, 20, 21, 22, 24, 25, 26, 27, 28, 30, 33, 34, 35, 36, 38, 39, 40, 42, 44, 46, 48, 49, 51, 52, 54, 56, 57, 58, 60, 62, 63, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 99, 100, 102, 104, 106, 110, 111
Offset: 1

Views

Author

Antti Karttunen, May 03 2014

Keywords

Comments

Terms that occur in 2-cycles of permutation A241916. (E.g., A241916(6)=9, A241916(9)=6.)
Apart from its initial terms, 1 and 2, all the terms of A088902 occur here because A241909 has no other fixed points than 1 and 2.

Crossrefs

Complement of A241912.
A subsequence apart from its two initial terms: A088902.
Cf. A241916.

Programs

  • Mathematica
    f[n_] := If[n == 1, {0}, Function[f, ReplacePart[Table[0, {PrimePi[f[[-1, 1]]]}], #] &@ Map[PrimePi@ First@ # -> Last@ # &, f]]@ FactorInteger@ n]; g[w_List] := Times @@ Flatten@ MapIndexed[Prime[#2]^#1 &, w]; Complement[Range@ Max@ #, Table[#[[n + 1]]/2, {n, Length@ # - 1}]] &@ Select[Range@ 120, g@ f@ # == g@ Reverse@ f@ # &] (* Michael De Vlieger, Aug 27 2016 *)

A369033 LCM-transform of permutation A241916.

Original entry on oeis.org

1, 2, 3, 2, 5, 3, 7, 2, 1, 5, 11, 3, 13, 7, 1, 2, 17, 1, 19, 5, 1, 11, 23, 3, 1, 13, 1, 7, 29, 1, 31, 2, 1, 17, 1, 1, 37, 19, 1, 5, 41, 1, 43, 11, 1, 23, 47, 3, 1, 1, 1, 13, 53, 1, 1, 7, 1, 29, 59, 1, 61, 31, 1, 2, 1, 1, 67, 17, 1, 1, 71, 1, 73, 37, 1, 19, 1, 1, 79, 5, 1, 41, 83, 1, 1, 43, 1, 11, 89, 1, 1, 23, 1, 47
Offset: 1

Views

Author

Antti Karttunen, Jan 12 2024

Keywords

Comments

See comments in A368900.

Crossrefs

Programs

  • PARI
    up_to = 2^16;
    LCMtransform(v) = { my(len = length(v), b = vector(len), g = vector(len)); b[1] = g[1] = 1; for(n=2,len, g[n] = lcm(g[n-1],v[n]); b[n] = g[n]/g[n-1]); (b); };
    A209229(n) = (n && !bitand(n,n-1));
    A241916(n) = if(1==A209229(n), n, my(f = factor(2*n), nbf = #f~, igp = primepi(f[nbf,1]), g = f); for(i=1,nbf,g[i,1] = prime(1+igp-primepi(f[i,1]))); factorback(g)/2); \\ Antti Karttunen, Jan 12 2024
    v369033 = LCMtransform(vector(up_to,i,A241916(i)));
    A369033(n) = v369033[n];
    
  • PARI
    A014963(n) = { ispower(n, , &n); if(isprime(n), n, 1); };
    A369033(n) = A014963(A241916(n));

Formula

a(1) = 1, for n > 1, a(n) = lcm {1..A241916(n)} / lcm {1..A241916(n-1)}.
a(n) = A014963(A241916(n)). [A241916 satisfies the property S defined in A368900]

A278525 Filtering sequence (related to prime factorization): a(n) = A046523(A241916(n)).

Original entry on oeis.org

1, 2, 2, 4, 2, 4, 2, 8, 6, 4, 2, 8, 2, 4, 6, 16, 2, 12, 2, 8, 6, 4, 2, 16, 6, 4, 12, 8, 2, 12, 2, 32, 6, 4, 6, 24, 2, 4, 6, 16, 2, 12, 2, 8, 12, 4, 2, 32, 6, 12, 6, 8, 2, 36, 6, 16, 6, 4, 2, 24, 2, 4, 12, 64, 6, 12, 2, 8, 6, 12, 2, 48, 2, 4, 30, 8, 6, 12, 2, 32, 24, 4, 2, 24, 6, 4, 6, 16, 2, 36, 6, 8, 6, 4, 6, 64, 2, 12, 12, 24, 2, 12, 2, 16, 30, 4, 2, 72, 2
Offset: 1

Views

Author

Antti Karttunen, Nov 30 2016

Keywords

Crossrefs

Programs

Formula

a(n) = A046523(A241916(n)).
Other identities. For all n:
a(2^n) = 2^n.
a(A000040(n)) = 2.

A005940 The Doudna sequence: write n-1 in binary; power of prime(k) in a(n) is # of 1's that are followed by k-1 0's.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 9, 8, 7, 10, 15, 12, 25, 18, 27, 16, 11, 14, 21, 20, 35, 30, 45, 24, 49, 50, 75, 36, 125, 54, 81, 32, 13, 22, 33, 28, 55, 42, 63, 40, 77, 70, 105, 60, 175, 90, 135, 48, 121, 98, 147, 100, 245, 150, 225, 72, 343, 250, 375, 108, 625, 162, 243, 64, 17, 26, 39
Offset: 1

Views

Author

Keywords

Comments

A permutation of the natural numbers. - Robert G. Wilson v, Feb 22 2005
Fixed points: A029747. - Reinhard Zumkeller, Aug 23 2006
The even bisection, when halved, gives the sequence back. - Antti Karttunen, Jun 28 2014
From Antti Karttunen, Dec 21 2014: (Start)
This irregular table can be represented as a binary tree. Each child to the left is obtained by applying A003961 to the parent, and each child to the right is obtained by doubling the parent:
1
|
...................2...................
3 4
5......../ \........6 9......../ \........8
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
7 10 15 12 25 18 27 16
11 14 21 20 35 30 45 24 49 50 75 36 125 54 81 32
etc.
Sequence A163511 is obtained by scanning the same tree level by level, from right to left. Also in binary trees A253563 and A253565 the terms on level of the tree are some permutation of the terms present on the level n of this tree. A252464(n) gives the distance of n from 1 in all these trees.
A252737(n) gives the sum and A252738(n) the product of terms on row n (where 1 is on row 0, 2 on row 1, 3 and 4 on row 2, etc.). A252745(n) gives the number of nodes on level n whose left child is larger than the right child, A252750 the difference between left and right child for each node from node 2 onward.
(End)
-A008836(a(1+n)) gives the corresponding numerator for A323505(n). - Antti Karttunen, Jan 19 2019
(a(2n+1)-1)/2 [= A244154(n)-1, for n >= 0] is a permutation of the natural numbers. - George Beck and Antti Karttunen, Dec 08 2019
From Peter Munn, Oct 04 2020: (Start)
Each term has the same even part (equivalently, the same 2-adic valuation) as its index.
Using the tree depicted in Antti Karttunen's 2014 comment:
Numbers are on the right branch (4 and descendants) if and only if divisible by the square of their largest prime factor (cf. A070003).
Numbers on the left branch, together with 2, are listed in A102750.
(End)
According to Kutz (1981), he learned of this sequence from American mathematician Byron Leon McAllister (1929-2017) who attributed the invention of the sequence to a graduate student by the name of Doudna (first name Paul?) in the mid-1950's at the University of Wisconsin. - Amiram Eldar, Jun 17 2021
From David James Sycamore, Sep 23 2022: (Start)
Alternative (recursive) definition: If n is a power of 2 then a(n)=n. Otherwise, if 2^j is the greatest power of 2 not exceeding n, and if k = n - 2^j, then a(n) is the least m*a(k) that has not occurred previously, where m is an odd prime.
Example: Use recursion with n = 77 = 2^6 + 13. a(13) = 25 and since 11 is the smallest odd prime m such that m*a(13) has not already occurred (see a(27), a(29),a(45)), then a(77) = 11*25 = 275. (End)
The odd bisection, when transformed by replacing all prime(k)^e in a(2*n - 1) with prime(k-1)^e, returns a(n), and thus gives the sequence back. - David James Sycamore, Sep 28 2022

Examples

			From _N. J. A. Sloane_, Aug 22 2022: (Start)
Let c_i = number of 1's in binary expansion of n-1 that have i 0's to their right, and let p(j) = j-th prime.  Then a(n) = Product_i p(i+1)^c_i.
If n=9, n-1 is 1000, c_3 = 1, a(9) = p(4)^1 = 7.
If n=10, n-1 = 1001, c_0 = 1, c_2 = 1, a(10) = p(1)*p(3) = 2*5 = 10.
If n=11, n-1 = 1010, c_1 = 1, c_2 = 1, a(11) = p(2)*p(3) = 15. (End)
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A103969. Inverse is A005941 (A156552).
Cf. A125106. [From Franklin T. Adams-Watters, Mar 06 2010]
Cf. A252737 (gives row sums), A252738 (row products), A332979 (largest on row).
Related permutations of positive integers: A163511 (via A054429), A243353 (via A006068), A244154, A253563 (via A122111), A253565, A332977, A334866 (via A225546).
A000120, A003602, A003961, A006519, A053645, A070939, A246278, A250246, A252753, A253552 are used in a formula defining this sequence.
Formulas for f(a(n)) are given for f = A000265, A003963, A007949, A055396, A056239.
Numbers that occur at notable sets of positions in the binary tree representation of the sequence: A000040, A000079, A002110, A070003, A070826, A102750.
Cf. A106737, A290077, A323915, A324052, A324054, A324055, A324056, A324057, A324058, A324114, A324335, A324340, A324348, A324349 for various number-theoretical sequences applied to (i.e., permuted by) this sequence.
k-adic valuation: A007814 (k=2), A337821 (k=3).
Positions of multiples of 3: A091067.
Primorial deflation: A337376 / A337377.
Sum of prime indices of a(n) is A161511, reverse version A359043.
A048793 lists binary indices, ranked by A019565.
A066099 lists standard comps, partial sums A358134 (ranked by A358170).

Programs

  • Haskell
    a005940 n = f (n - 1) 1 1 where
       f 0 y _          = y
       f x y i | m == 0 = f x' y (i + 1)
               | m == 1 = f x' (y * a000040 i) i
               where (x',m) = divMod x 2
    -- Reinhard Zumkeller, Oct 03 2012
    (Scheme, with memoization-macro definec from Antti Karttunen's IntSeq-library)
    (define (A005940 n) (A005940off0 (- n 1))) ;; The off=1 version, utilizing any one of three different offset-0 implementations:
    (definec (A005940off0 n) (cond ((< n 2) (+ 1 n)) (else (* (A000040 (- (A070939 n) (- (A000120 n) 1))) (A005940off0 (A053645 n))))))
    (definec (A005940off0 n) (cond ((<= n 2) (+ 1 n)) ((even? n) (A003961 (A005940off0 (/ n 2)))) (else (* 2 (A005940off0 (/ (- n 1) 2))))))
    (define (A005940off0 n) (let loop ((n n) (i 1) (x 1)) (cond ((zero? n) x) ((even? n) (loop (/ n 2) (+ i 1) x)) (else (loop (/ (- n 1) 2) i (* x (A000040 i)))))))
    ;; Antti Karttunen, Jun 26 2014
    
  • Maple
    f := proc(n,i,x) option remember ; if n = 0 then x; elif type(n,'even') then procname(n/2,i+1,x) ; else procname((n-1)/2,i,x*ithprime(i)) ; end if; end proc:
    A005940 := proc(n) f(n-1,1,1) ; end proc: # R. J. Mathar, Mar 06 2010
  • Mathematica
    f[n_] := Block[{p = Partition[ Split[ Join[ IntegerDigits[n - 1, 2], {2}]], 2]}, Times @@ Flatten[ Table[q = Take[p, -i]; Prime[ Count[ Flatten[q], 0] + 1]^q[[1, 1]], {i, Length[p]}] ]]; Table[ f[n], {n, 67}] (* Robert G. Wilson v, Feb 22 2005 *)
    Table[Times@@Prime/@(Join@@Position[Reverse[IntegerDigits[n,2]],1]-Range[DigitCount[n,2,1]]+1),{n,0,100}] (* Gus Wiseman, Dec 28 2022 *)
  • PARI
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, n%2 && (t*=p) || p=nextprime(p+1)); t } \\ M. F. Hasler, Mar 07 2010; update Aug 29 2014
    
  • PARI
    a(n)=my(p=2, t=1); for(i=0,exponent(n), if(bittest(n,i), t*=p, p=nextprime(p+1))); t \\ Charles R Greathouse IV, Nov 11 2021
    
  • Python
    from sympy import prime
    import math
    def A(n): return n - 2**int(math.floor(math.log(n, 2)))
    def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
    print([b(n - 1) for n in range(1, 101)]) # Indranil Ghosh, Apr 10 2017
    
  • Python
    from math import prod
    from itertools import accumulate
    from collections import Counter
    from sympy import prime
    def A005940(n): return prod(prime(len(a)+1)**b for a, b in Counter(accumulate(bin(n-1)[2:].split('1')[:0:-1])).items()) # Chai Wah Wu, Mar 10 2023

Formula

From Reinhard Zumkeller, Aug 23 2006, R. J. Mathar, Mar 06 2010: (Start)
a(n) = f(n-1, 1, 1)
where f(n, i, x) = x if n = 0,
= f(n/2, i+1, x) if n > 0 is even
= f((n-1)/2, i, x*prime(i)) otherwise. (End)
From Antti Karttunen, Jun 26 2014: (Start)
Define a starting-offset 0 version of this sequence as:
b(0)=1, b(1)=2, [base cases]
and then compute the rest either with recurrence:
b(n) = A000040(1+(A070939(n)-A000120(n))) * b(A053645(n)).
or
b(2n) = A003961(b(n)), b(2n+1) = 2 * b(n). [Compare this to the similar recurrence given for A163511.]
Then define a(n) = b(n-1), where a(n) gives this sequence A005940 with the starting offset 1.
Can be also defined as a composition of related permutations:
a(n+1) = A243353(A006068(n)).
a(n+1) = A163511(A054429(n)). [Compare the scatter plots of this sequence and A163511 to each other.]
This permutation also maps between the partitions as enumerated in the lists A125106 and A112798, providing identities between:
A161511(n) = A056239(a(n+1)). [The corresponding sums ...]
A243499(n) = A003963(a(n+1)). [... and the products of parts of those partitions.]
(End)
From Antti Karttunen, Dec 21 2014 - Jan 04 2015: (Start)
A002110(n) = a(1+A002450(n)). [Primorials occur at (4^n - 1)/3 in the offset-0 version of the sequence.]
a(n) = A250246(A252753(n-1)).
a(n) = A122111(A253563(n-1)).
For n >= 1, A055396(a(n+1)) = A001511(n).
For n >= 2, a(n) = A246278(1+A253552(n)).
(End)
From Peter Munn, Oct 04 2020: (Start)
A000265(a(n)) = a(A000265(n)) = A003961(a(A003602(n))).
A006519(a(n)) = a(A006519(n)) = A006519(n).
a(n) = A003961(a(A003602(n))) * A006519(n).
A007814(a(n)) = A007814(n).
A007949(a(n)) = A337821(n) = A007814(A003602(n)).
a(n) = A225546(A334866(n-1)).
(End)
a(2n) = 2*a(n), or generally a(2^k*n) = 2^k*a(n). - Amiram Eldar, Oct 03 2022
If n-1 = Sum_{i} 2^(q_i-1), then a(n) = Product_{i} prime(q_i-i+1). These are the Heinz numbers of the rows of A125106. If the offset is changed to 0, the inverse is A156552. - Gus Wiseman, Dec 28 2022

Extensions

More terms from Robert G. Wilson v, Feb 22 2005
Sign in a formula switched and Maple program added by R. J. Mathar, Mar 06 2010
Binary tree illustration and keyword tabf added by Antti Karttunen, Dec 21 2014

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

A246277 Column index of n in A246278: a(1) = 0, a(2n) = n, a(2n+1) = a(A064989(2n+1)).

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 1, 4, 2, 5, 1, 6, 1, 7, 3, 8, 1, 9, 1, 10, 5, 11, 1, 12, 2, 13, 4, 14, 1, 15, 1, 16, 7, 17, 3, 18, 1, 19, 11, 20, 1, 21, 1, 22, 6, 23, 1, 24, 2, 25, 13, 26, 1, 27, 5, 28, 17, 29, 1, 30, 1, 31, 10, 32, 7, 33, 1, 34, 19, 35, 1, 36, 1, 37, 9, 38, 3, 39, 1, 40, 8, 41, 1, 42
Offset: 1

Views

Author

Antti Karttunen, Aug 21 2014

Keywords

Comments

If n >= 2, n occurs in column a(n) of A246278.
By convention, a(1) = 0 because 1 does not occur in A246278.

Crossrefs

Terms of A348717 halved. A305897 is the restricted growth sequence transform.
Positions of terms 1 .. 8 in this sequence are given by the following sequences: A000040, A001248, A006094, A030078, A090076, A251720, A090090, A030514.
Cf. A078898 (has the same role with array A083221 as this sequence has with A246278).
This sequence is also used in the definition of the following permutations: A246274, A246276, A246675, A246677, A246683, A249815, A249817 (A249818), A249823, A249825, A250244, A250245, A250247, A250249.
Also in the definition of arrays A249821, A251721, A251722.
Sum of prime indices of a(n) is A359358(n) + A001222(n) - 1, cf. A326844.
A112798 lists prime indices, length A001222, sum A056239.

Programs

  • Mathematica
    a246277[n_Integer] := Module[{f, p, a064989, a},
      f[x_] := Transpose@FactorInteger[x];
      p[x_] := Which[
        x == 1, 1,
        x == 2, 1,
        True, NextPrime[x, -1]];
      a064989[x_] := Times @@ Power[p /@ First[f[x]], Last[f[x]]];
      a[1] = 0;
      a[x_] := If[EvenQ[x], x/2, NestWhile[a064989, x, OddQ]/2];
    a/@Range[n]]; a246277[84] (* Michael De Vlieger, Dec 19 2014 *)
  • PARI
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A246277(n) = { if(1==n, 0, while((n%2), n = A064989(n)); (n/2)); };
    
  • PARI
    A246277(n) = if(1==n, 0, my(f = factor(n), k = primepi(f[1,1])-1); for (i=1, #f~, f[i,1] = prime(primepi(f[i,1])-k)); factorback(f)/2); \\ Antti Karttunen, Apr 30 2022
    
  • Python
    from sympy import factorint, prevprime
    from operator import mul
    from functools import reduce
    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 a(n): return 0 if n==1 else n//2 if n%2==0 else a(a064989(n))
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 15 2017
  • Scheme
    ;; two different variants, the second one employing memoizing definec-macro)
    (define (A246277 n) (if (= 1 n) 0 (let loop ((n n)) (if (even? n) (/ n 2) (loop (A064989 n))))))
    (definec (A246277 n) (cond ((= 1 n) 0) ((even? n) (/ n 2)) (else (A246277 (A064989 n)))))
    

Formula

a(1) = 0, a(2n) = n, a(2n+1) = a(A064989(2n+1)) = a(A064216(n+1)). [Cf. the formula for A252463.]
Instead of the equation for a(2n+1) above, we may write a(A003961(n)) = a(n). - Peter Munn, May 21 2022
Other identities. For all n >= 1, the following holds:
For all w >= 0, a(p_{i} * p_{j} * ... * p_{k}) = a(p_{i+w} * p_{j+w} * ... * p_{k+w}).
For all n >= 2, A001222(a(n)) = A001222(n)-1. [a(n) has one less prime factor than n. Thus each semiprime (A001358) is mapped to some prime (A000040), etc.]
For all n >= 2, a(n) = A078898(A249817(n)).
For semiprimes n = p_i * p_j, j >= i, a(n) = A000040(1+A243055(n)) = p_{1+j-i}.
a(n) = floor(A348717(n)/2). - Antti Karttunen, Apr 30 2022
If n has prime factorization Product_{i=1..k} prime(x_i), then a(n) = Product_{i=2..k} prime(x_i-x_1+1). The opposite version is A358195, prime indices A358172, even bisection A241916. - Gus Wiseman, Dec 29 2022

A241909 Self-inverse permutation of natural numbers: a(1)=1, a(p_i) = 2^i, and if n = p_i1 * p_i2 * p_i3 * ... * p_{ik-1} * p_ik, where p's are primes, with their indexes are sorted into nondescending order: i1 <= i2 <= i3 <= ... <= i_{k-1} <= ik, then a(n) = 2^(i1-1) * 3^(i2-i1) * 5^(i3-i2) * ... * p_k^(1+(ik-i_{k-1})). Here k = A001222(n) and ik = A061395(n).

Original entry on oeis.org

1, 2, 4, 3, 8, 9, 16, 5, 6, 27, 32, 25, 64, 81, 18, 7, 128, 15, 256, 125, 54, 243, 512, 49, 12, 729, 10, 625, 1024, 75, 2048, 11, 162, 2187, 36, 35, 4096, 6561, 486, 343, 8192, 375, 16384, 3125, 50, 19683, 32768, 121, 24, 45, 1458, 15625, 65536, 21, 108, 2401
Offset: 1

Views

Author

Antti Karttunen, May 03 2014, partly inspired by Marc LeBrun's Jan 11 2006 message on SeqFan mailing list

Keywords

Comments

This permutation maps between the partitions as ordered in A112798 and A241918 (the original motivation for this sequence).
For all n > 2, A007814(a(n)) = A055396(n)-1, which implies that this self-inverse permutation maps between primes (A000040) and the powers of two larger than one (A000079(n>=1)), and apart from a(1) & a(2), this also maps each even number to some odd number, and vice versa, which means there are no fixed points after 2.
A122111 commutes with this one, that is, a(n) = A122111(a(A122111(n))).
Conjugates between A243051 and A242424 and other rows of A243060 and A243070.

Examples

			For n = 12 = 2 * 2 * 3 = p_1 * p_1 * p_2, we obtain by the first formula 2^(1-1) * 3^(1-1) * 5^(1+(2-1)) = 5^2 = 25. By the second formula, as n = 2^2 * 3^1, we obtain the same result, p_{1+2} * p_{2+1} = p_3 * p_3 = 25, thus a(12) = 25.
Using the product formula over the terms of row n of table A241918, we see, because 9450 = 2*3*3*3*5*5*7 = p_1^1 * p_2^3 * p_3^2 * p_4^1, that the corresponding row in A241918 is {2,5,7,7}, and multiplying p_2 * p_5 * p_7^2 yields 3 * 11 * 17 * 17 = 9537, thus a(9450) = 9537.
Similarly, for 9537, the corresponding row in A241918 is {1,2,2,2,3,3,4}, and multiplying p_1^1 * p_2^3 * p_3^2 * p_4^1, we obtain 9450 back.
		

Crossrefs

Cf. also A278220 (= A046523(a(n))), A331280 (its rgs_transform), A331299 (= min(n,a(n))).
{A000027, A122111, A241909, A241916} form a 4-group.

Programs

  • Haskell
    a241909 1 = 1
    a241909 n = product $ zipWith (^) a000040_list $ zipWith (-) is (1 : is)
                where is = reverse ((j + 1) : js)
                      (j:js) = reverse $ map a049084 $ a027746_row n
    -- Reinhard Zumkeller, Aug 04 2014
    
  • Mathematica
    Array[If[# == 1, 1, Function[t, Times @@ Prime@ Accumulate[If[Length@ t < 2, {0}, Join[{1}, ConstantArray[0, Length@ t - 2], {-1}]] + ReplacePart[t, Map[#1 -> #2 & @@ # &, #]]]]@ ConstantArray[0, Transpose[#][[1, -1]]] &[FactorInteger[#] /. {p_, e_} /; p > 0 :> {PrimePi@ p, e}]] &, 56] (* Michael De Vlieger, Jan 23 2020 *)
  • PARI
    A241909(n) = if(1==n||isprime(n),2^primepi(n),my(f=factor(n),h=1,i,m=1,p=1,k=1); while(k<=#f~, p = nextprime(1+p); i = primepi(f[k,1]); m *= p^(i-h); h = i; if(f[k,2]>1, f[k,2]--, k++)); (p*m)); \\ Antti Karttunen, Jan 17 2020

Formula

If n is a prime with index i (p_i), then a(n) = 2^i, otherwise when n = p_i1 * p_i2 * p_i3 * ... p_ik, where p_i1, p_i2, p_i3, ..., p_ik are the primes present (not necessarily all distinct) in the prime factorization of n, sorted into nondescending order, a(n) = 2^(i1-1) * 3^(i2-i1) * 5^(i3-i2) * ... * p_k^(1+(ik-i_{k-1})).
Equally, if n = 2^k, then a(n) = p_k, otherwise, when n = 2^e1 * 3^e2 * 5^e3 * ... * p_k^{e_k}, i.e., where e1 ... e_k are the exponents (some of them possibly zero, except the last) of the primes 2, 3, 5, ... in the prime factorization of n, a(n) = p_{1+e1} * p_{1+e1+e2} * p_{1+e1+e2+e3} * ... * p_{e1+e2+e3+...+e_k}.
From the equivalence of the above two formulas (which are inverses of each other) it follows that a(a(n)) = n, i.e., that this permutation is an involution. For a proof, please see the attached notes.
The first formula corresponds to this recurrence:
a(1) = 1, a(p_k) = 2^k for primes with index k, otherwise a(n) = (A000040(A001222(n))^(A241917(n)+1)) * A052126(a(A052126(n))).
And the latter formula with this recurrence:
a(1) = 1, and for n>1, if n = 2^k, a(n) = A000040(k), otherwise a(n) = A000040(A001511(n)) * A242378(A007814(n), a(A064989(n))).
[Here 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.]
We also have:
a(1)=1, and for n>1, a(n) = Product_{i=A203623(n-1)+2..A203623(n)+1} A000040(A241918(i)).
For all n >= 1, A001222(a(n)) = A061395(n), and vice versa, A061395(a(n)) = A001222(n).
For all n > 1, a(2n-1) = 2*a(A064216(n)).

Extensions

Typos in the name corrected by Antti Karttunen, May 31 2014

A253565 Permutation of natural numbers: a(0) = 1, a(1) = 2; after which, a(2n) = A253550(a(n)), a(2n+1) = A253560(a(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 9, 6, 8, 7, 25, 15, 27, 10, 18, 12, 16, 11, 49, 35, 125, 21, 75, 45, 81, 14, 50, 30, 54, 20, 36, 24, 32, 13, 121, 77, 343, 55, 245, 175, 625, 33, 147, 105, 375, 63, 225, 135, 243, 22, 98, 70, 250, 42, 150, 90, 162, 28, 100, 60, 108, 40, 72, 48, 64, 17, 169, 143, 1331, 91, 847, 539, 2401, 65, 605, 385, 1715, 275, 1225, 875, 3125, 39
Offset: 0

Views

Author

Antti Karttunen, Jan 03 2015

Keywords

Comments

This sequence can be represented as a binary tree. Each child to the left is obtained by applying A253550 to the parent, and each child to the right is obtained by applying A253560 to the parent:
1
|
...................2...................
3 4
5......../ \........9 6......../ \........8
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
7 25 15 27 10 18 12 16
11 49 35 125 21 75 45 81 14 50 30 54 20 36 24 32
etc.
Sequence A253563 is the mirror image of the same tree. Also in binary trees A005940 and A163511 the terms on level of the tree are some permutation of the terms present on the level n of this tree. A252464(n) gives the distance of n from 1 in all these trees. Of these four trees, this is the one where the left child is always smaller than the right child.
Note that the indexing of sequence starts from 0, although its range starts from one.
The term a(n) is the Heinz number of the adjusted partial sums of the n-th composition in standard order, where (1) the k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again, (2) the Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k), and (3) we define the adjusted partial sums of a composition to be obtained by subtracting one from all parts, taking partial sums, and adding one back to all parts. See formula for a simplification. A triangular form is A242628. The inverse is A253566. The non-adjusted version is A358170. - Gus Wiseman, Dec 17 2022

Examples

			From _Gus Wiseman_, Dec 23 2022: (Start)
This represents the following bijection between compositions and partitions. The n-th composition in standard order together with the reversed prime indices of a(n) are:
   0:        () -> ()
   1:       (1) -> (1)
   2:       (2) -> (2)
   3:     (1,1) -> (1,1)
   4:       (3) -> (3)
   5:     (2,1) -> (2,2)
   6:     (1,2) -> (2,1)
   7:   (1,1,1) -> (1,1,1)
   8:       (4) -> (4)
   9:     (3,1) -> (3,3)
  10:     (2,2) -> (3,2)
  11:   (2,1,1) -> (2,2,2)
  12:     (1,3) -> (3,1)
  13:   (1,2,1) -> (2,2,1)
  14:   (1,1,2) -> (2,1,1)
  15: (1,1,1,1) -> (1,1,1,1)
(End)
		

Crossrefs

Inverse: A253566.
Cf. A252737 (row sums), A252738 (row products).
Applying A001222 gives A000120.
A reverse version is A005940.
These are the Heinz numbers of the rows of A242628.
Sum of prime indices of a(n) is A359043, reverse A161511.
A048793 gives partial sums of reversed standard comps, Heinz number A019565.
A066099 lists standard compositions.
A112798 list prime indices, sum A056239.
A358134 gives partial sums of standard compositions, Heinz number A358170.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Times@@Prime/@#&/@Table[Accumulate[stc[n]-1]+1,{n,0,60}] (* Gus Wiseman, Dec 17 2022 *)

Formula

a(0) = 1, a(1) = 2; after which, a(2n) = A253550(a(n)), a(2n+1) = A253560(a(n)).
As a composition of related permutations:
a(n) = A122111(A163511(n)).
a(n) = A253563(A054429(n)).
Other identities and observations. For all n >= 0:
a(2n+1) - a(2n) > 0. [See the comment above.]
If n = 2^(x_1)+...+2^(x_k) then a(n) = Product_{i=1..k} prime(x_k-x_{i-1}-k+i) where x_0 = 0. - Gus Wiseman, Dec 23 2022

A368900 LCM-transform of Doudna sequence.

Original entry on oeis.org

1, 2, 3, 2, 5, 1, 3, 2, 7, 1, 1, 1, 5, 1, 3, 2, 11, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 5, 1, 3, 2, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 5, 1, 3, 2, 17, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Keywords

Comments

Let's define "property S" for sequences as follows: If s is any sequence of positive natural numbers, normalized to begin with offset 1, then it satisfies the S-property if LCM-transform(s) is equal to the sequence obtained by applying A014963 to sequence s, or in other words, when for all n >= 1, lcm {s(1)..s(n)} / lcm {s(1)..s(n-1)} = A014963(s(n)). This holds if and only if, for all n >= 1, when, either (case A): s(n) is of the form p^k, p prime, then gcd(s(n), lcm {s(1)..s(n-1)}) must be equal to p^(k-1), or (case B): when s(n) is not a prime power, then gcd(s(n), lcm {s(1)..s(n-1)}) must be equal to s(n). Together the cases (A) and (B) reduce to the condition that each prime power should appear in s before any of its multiples do.
Clearly the Doudna-sequence satisfies the property by the way of its construction, as do many of its variants like A356867 (see A369060).
Also, for any base-2 related permutation b that keeps all the numbers of range [2^k, 2^(1+k)[ in the same range, i.e., if for all n >= 1, A000523(b(n)) = A000523(n), then the above property is automatically satisfied.
Furthermore, because in Doudna-sequence no multiple of any term is located on the same row as the term itself (see the tree-illustration in A005940), it follows that any composition of A005940 with any such base-2 related permutation as mentioned above also automatically satisfies the S-property, for example, the permutations A163511, A243353, A253563, A253565, A366260, A366263 and A366275.
Note: Like A005940 itself, also this sequence might be more logical with the starting offset 0 instead of 1, to better align with the underlying mapping from the binary expansion of n to the prime factorization. - Antti Karttunen, Jan 24 2024

Crossrefs

List of LCM-transforms of permutations (permutation given in parentheses):
Cf. A265576 (A064413; note that the EKG sequence permutation does not satisfy the S-property).
In all following cases, the permutation satisfies the S-property:
Cf. A369041 (A003188), A369042 (A006068), A369043 (A193231), A369044 (A057889), A369041 (A054429). [Base-2 related permutations]
Other permutations that have the same property: A303767, (and when used as an offset=1 sequence): A052330.

Programs

  • Mathematica
    nn = 120; Array[Set[{s[#], a[#]}, {#, #}] &, 2]; j = 2;
    Do[If[EvenQ[n],
      Set[s[n], 2 s[n/2]],
      Set[s[n],
        Times @@ Power @@@ Map[{Prime[PrimePi[#1] + 1], #2} & @@ # &,
          FactorInteger[s[(n + 1)/2]]]]];
      k = LCM[j, s[n]]; a[n] = k/j; j = k, {n, 3, nn}];
    Array[a, nn] (* Michael De Vlieger, Mar 24 2024 *)
  • PARI
    up_to = 16384;
    LCMtransform(v) = { my(len = length(v), b = vector(len), g = vector(len)); b[1] = g[1] = 1; for(n=2,len, g[n] = lcm(g[n-1],v[n]); b[n] = g[n]/g[n-1]); (b); };
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); (t) };
    v368900 = LCMtransform(vector(up_to,i,A005940(i)));
    A368900(n) = v368900[n];
    
  • PARI
    A000265(n) = (n>>valuation(n,2));
    A209229(n) = (n && !bitand(n,n-1));
    A368900(n)  = if(1==n, 1, my(x=A000265(n-1)); if(A209229(1+x), prime(1+valuation(n-1,2)), 1));

Formula

a(n) = A368901(n) / A368901(n-1) = lcm {1..A005940(n)} / lcm {1..A005940(n-1)}.
a(n) = A005940(n) / gcd(A005940(n), A368901(n-1)).
a(n) = A014963(A005940(n)). [Because A005940 satisfies the property given in the comments]
For n >= 1, Product_{d|n} a(A005941(d)) = n. [Implied by above]
For n >= 1, a(n) = A369030(1+A054429(n-1)).
For n > 1, if n-1 is a number of the form 2^i - 2^j with i >= j, then a(n) = prime(1+j), otherwise a(n) = 1.
Showing 1-10 of 29 results. Next