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

A278520 a(n) = A243503(n) - A056239(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 11 2016

Keywords

Comments

The 223rd zero in this sequence occurs at n=1078 (a(1078) = 0, 1078 = 2*7*7*11) and it is the first zero that is not included in A241912.

Crossrefs

Cf. A241912 (gives the subset of the indices of zeros).

Formula

a(n) = A243503(n) - A056239(n).
a(A241912(n)) = 0 [but obtains zeros also for other values, see comments.]

A286456 Compound filter: a(n) = P(A056239(n), A243503(n)), with a(1) = 0, where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

0, 1, 5, 5, 13, 18, 25, 13, 19, 40, 41, 40, 61, 71, 41, 25, 85, 41, 113, 83, 72, 111, 145, 71, 42, 160, 42, 142, 181, 84, 221, 41, 112, 218, 73, 72, 265, 285, 161, 142, 313, 143, 365, 217, 85, 361, 421, 111, 74, 85, 219, 308, 481, 73, 113, 238, 286, 446, 545, 143, 613, 540, 144, 61, 162, 218, 685, 415, 362, 144, 761, 112, 841, 643, 86, 538, 114, 309, 925, 217
Offset: 1

Views

Author

Antti Karttunen, May 14 2017

Keywords

Crossrefs

Programs

Formula

a(1) = 0 and for n > 1, a(n) = (1/2)*(2 + ((A056239(n)+A243503(n))^2) - A056239(n) - 3*A243503(n)).

A056239 If n = Product_{k >= 1} (p_k)^(c_k) where p_k is k-th prime and c_k >= 0 then a(n) = Sum_{k >= 1} k*c_k.

Original entry on oeis.org

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

Views

Author

Leroy Quet, Aug 19 2000

Keywords

Comments

A pseudo-logarithmic function in the sense that a(b*c) = a(b)+a(c) and so a(b^c) = c*a(b) and f(n) = k^a(n) is a multiplicative function. [Cf. A248692 for example.] Essentially a function from the positive integers onto the partitions of the nonnegative integers (1->0, 2->1, 3->2, 4->1+1, 5->3, 6->1+2, etc.) so each value a(n) appears A000041(a(n)) times, first with the a(n)-th prime and last with the a(n)-th power of 2. Produces triangular numbers from primorials. - Henry Bottomley, Nov 22 2001
Michael Nyvang writes (May 08 2006) that the Danish composer Karl Aage Rasmussen discovered this sequence in the 1990's: it has excellent musical properties.
All A000041(a(n)) different n's with the same value a(n) are listed in row a(n) of triangle A215366. - Alois P. Heinz, Aug 09 2012
a(n) is the sum of the parts of the partition having Heinz number n. We define the Heinz number of a partition p = [p_1, p_2, ..., p_r] as Product_{j=1..r} (p_j-th prime) (concept used by Alois P. Heinz in A215366 as an "encoding" of a partition). For example, for the partition [1, 1, 2, 4, 10] we get 2*2*3*7*29 = 2436. Example: a(33) = 7 because the partition with Heinz number 33 = 3 * 11 is [2,5]. - Emeric Deutsch, May 19 2015

Examples

			a(12) = 1*2 + 2*1 = 4, since 12 = 2^2 *3^1 = (p_1)^2 *(p_2)^1.
		

Crossrefs

Programs

  • Haskell
    a056239 n = sum $ zipWith (*) (map a049084 $ a027748_row n) (a124010_row n)
    -- Reinhard Zumkeller, Apr 27 2013
    
  • Maple
    # To get 10000 terms. First make prime table: M:=10000; pl:=array(1..M); for i from 1 to M do pl[i]:=0; od: for i from 1 to M do if ithprime(i) > M then break; fi; pl[ithprime(i)]:=i; od:
    # Decode Maple's amazing syntax for factoring integers: g:=proc(n) local e,p,t1,t2,t3,i,j,k; global pl; t1:=ifactor(n); t2:=nops(t1); if t2 = 2 and whattype(t1) <> `*` then p:=op(1,op(1,t1)); e:=op(2,t1); t3:=pl[p]*e; else
    t3:=0; for i from 1 to t2 do j:=op(i,t1); if nops(j) = 1 then e:=1; p:=op(1,j); else e:=op(2,j); p:=op(1,op(1,j)); fi; t3:=t3+pl[p]*e; od: fi; t3; end; # N. J. A. Sloane, May 10 2006
    A056239 := proc(n) add( numtheory[pi](op(1,p))*op(2,p), p = ifactors(n)[2]) ; end proc: # R. J. Mathar, Apr 20 2010
    # alternative:
    with(numtheory): a := proc (n) local B: B := proc (n) local nn, j, m: nn := op(2, ifactors(n)): for j to nops(nn) do m[j] := op(j, nn) end do: [seq(seq(pi(op(1, m[i])), q = 1 .. op(2, m[i])), i = 1 .. nops(nn))] end proc: add(B(n)[i], i = 1 .. nops(B(n))) end proc: seq(a(n), n = 1 .. 130); # Emeric Deutsch, May 19 2015
  • Mathematica
    a[1] = 0; a[2] = 1; a[p_?PrimeQ] := a[p] = PrimePi[p];
    a[n_] := a[n] = Total[#[[2]]*a[#[[1]]] & /@ FactorInteger[n]]; a /@ Range[91] (* Jean-François Alcover, May 19 2011 *)
    Table[Total[FactorInteger[n] /. {p_, c_} /; p > 0 :> PrimePi[p] c], {n, 91}] (* Michael De Vlieger, Jul 12 2017 *)
  • PARI
    A056239(n) = if(1==n,0,my(f=factor(n)); sum(i=1, #f~, f[i,2] * primepi(f[i,1]))); \\ Antti Karttunen, Oct 26 2014, edited Jan 13 2020
    
  • Python
    from sympy import primepi, factorint
    def A056239(n): return sum(primepi(p)*e for p, e in factorint(n).items()) # Chai Wah Wu, Jan 01 2023
  • Scheme
    (require 'factor) ;; Uses the function factor available in Aubrey Jaffer's SLIB Scheme library.
    (define (A056239 n) (apply + (map A049084 (factor n))))
    ;; Antti Karttunen, Oct 26 2014
    

Formula

Totally additive with a(p) = PrimePi(p), where PrimePi(n) = A000720(n).
a(n) = Sum_{k=1..A001221(n)} A049084(A027748(k))*A124010(k). - Reinhard Zumkeller, Apr 27 2013
From Antti Karttunen, Oct 11 2014: (Start)
a(n) = n - A178503(n).
a(n) = A161511(A156552(n)).
a(n) = A227183(A243354(n)).
For all n >= 0:
a(A002110(n)) = A000217(n). [Cf. Henry Bottomley's comment above.]
a(A005940(n+1)) = A161511(n).
a(A243353(n)) = A227183(n).
Also, for all n >= 1:
a(A241909(n)) = A243503(n).
a(A122111(n)) = a(n).
a(A242424(n)) = a(n).
A248692(n) = 2^a(n). (End)
a(n) < A329605(n), a(n) = A001222(A108951(n)), a(A329902(n)) = A112778(n). - Antti Karttunen, Jan 14 2020

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

A163511 a(0)=1. a(n) = p(A000120(n)) * Product_{m=1..A000120(n)} p(m)^A163510(n,m), where p(m) is the m-th prime.

Original entry on oeis.org

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

Views

Author

Leroy Quet, Jul 29 2009

Keywords

Comments

This is a permutation of the positive integers.
From Antti Karttunen, Jun 20 2014: (Start)
Note the indexing: the domain starts from 0, while the range excludes zero, thus this is neither a bijection on the set of nonnegative integers nor on the set of positive natural numbers, but a bijection from the former set to the latter.
Apart from that discrepancy, this could be viewed as yet another "entanglement permutation" where the two complementary pairs to be interwoven together are even and odd numbers (A005843/A005408) which are entangled with the complementary pair even numbers (taken straight) and odd numbers in the order they appear in A003961: (A005843/A003961). See also A246375 which has almost the same recurrence.
Note how the even bisection halved gives the same sequence back. (For a(0)=1, take ceiling of 1/2).
(End)
From Antti Karttunen, Dec 30 2017: (Start)
This irregular table can be represented as a binary tree. Each child to the left is obtained by doubling the parent, and each child to the right is obtained by applying A003961 to the parent:
1
|
...................2...................
4 3
8......../ \........9 6......../ \........5
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
16 27 18 25 12 15 10 7
32 81 54 125 36 75 50 49 24 45 30 35 20 21 14 11
etc.
Sequence A005940 is obtained by scanning the same tree level by level in mirror image fashion. 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, and A252463 gives the parent of the node containing n.
A252737(n) gives the sum and A252738(n) the product of terms on row n (where 1 is on row 0, 1 on row 1, 3 and 4 on row 2, etc.). A252745(n) gives the number of nodes on level n whose left child is smaller than the right child, and A252744(n) is an indicator function for those nodes.
(End)
Note that the idea behind maps like this (and the mirror image A005940) admits also using alternative orderings of primes, not just standard magnitude-wise ordering (A000040). For example, A332214 is a similar sequence but with primes rearranged as in A332211, and A332817 is obtained when primes are rearranged as in A108546. - Antti Karttunen, Mar 11 2020
From Lorenzo Sauras Altuzarra, Nov 28 2020: (Start)
This sequence is generated from A228351 by applying the following procedure: 1) eliminate the compositions that end in one unless the first one, 2) subtract one unit from every component, 3) replace every tuple [t_1, ..., t_r] by Product_{k=1..r} A000040(k)^(t_k) (see the examples).
Is it true that a(n) = A337909(n+1) if and only if a(n+1) is not a term of A161992?
Does this permutation have any other cycle apart from (1), (2) and (6, 9, 16, 7)? (End)
From Antti Karttunen, Jul 25 2023: (Start)
(In the above question, it is assumed that the starting offset would be 1 instead of 0).
Questions:
Does a(n) = 1+A054429(n) hold only when n is of the form 2^k times 1, 3 or 7, i.e., one of the terms of A029748?
It seems that A007283 gives all fixed points of map n -> a(n), like A335431 seems to give all fixed points of map n -> A332214(n). Is there a general rule for mappings like these that the fixed points (if they exist) must be of the form 2^k times a certain kind of prime, i.e., that any odd composite (times 2^k) can certainly be excluded? See also note in A029747.
(End)
If the conjecture given in A364297 holds, then it implies the above conjecture about A007283. See also A364963. - Antti Karttunen, Sep 06 2023
Conjecture: a(n^k) is never of the form x^k, for any integers n > 0, k > 1, x >= 1. This holds at least for squares, cubes, seventh and eleventh powers (see A365808, A365801, A366287 and A366391). - Antti Karttunen, Sep 24 2023, Oct 10 2023.
See A365805 for why the above holds for any n^k, with k > 1. - Antti Karttunen, Nov 23 2023

Examples

			For n=3, whose binary representation is "11", we have A000120(3)=2, with A163510(3,1) = A163510(3,2) = 0, thus a(3) = p(2) * p(1)^0 * p(2)^0 = 3*1*1 = 3.
For n=9, "1001" in binary, we have A000120(9)=2, with A163510(9,1) = 0 and A163510(9,2) = 2, thus a(9) = p(2) * p(1)^0 * p(2)^2 = 3*1*9 = 27.
For n=10, "1010" in binary, we have A000120(10)=2, with A163510(10,1) = 1 and A163510(10,2) = 1, thus a(10) = p(2) * p(1)^1 * p(2)^1 = 3*2*3 = 18.
For n=15, "1111" in binary, we have A000120(15)=4, with A163510(15,1) = A163510(15,2) = A163510(15,3) = A163510(15,4) = 0, thus a(15) = p(4) * p(1)^0 * p(2)^0 * p(3)^0 * p(4)^0 = 7*1*1*1*1 = 7.
[1], [2], [1,1], [3], [1,2], [2,1] ... -> [1], [2], [3], [1,2], ... -> [0], [1], [2], [0,1], ... -> 2^0, 2^1, 2^2, 2^0*3^1, ... = 1, 2, 4, 3, ... - _Lorenzo Sauras Altuzarra_, Nov 28 2020
		

Crossrefs

Inverse: A243071.
Cf. A007283 (known positions where a(n)=n), A029747, A029748, A364255 [= gcd(n,a(n))], A364258 [= a(n)-n], A364287 (where a(n) < n), A364292 (where a(n) <= n), A364494 (where n|a(n)), A364496 (where a(n)|n), A364963, A364297.
Cf. A365808 (positions of squares), A365801 (of cubes), A365802 (of fifth powers), A365805 [= A052409(a(n))], A366287, A366391.
Cf. A005940, A332214, A332817, A366275 (variants).

Programs

  • Mathematica
    f[n_] := Reverse@ Map[Ceiling[(Length@ # - 1)/2] &, DeleteCases[Split@ Join[Riffle[IntegerDigits[n, 2], 0], {0}], {k__} /; k == 1]]; {1}~Join~
    Table[Function[t, Prime[t] Product[Prime[m]^(f[n][[m]]), {m, t}]][DigitCount[n, 2, 1]], {n, 120}] (* Michael De Vlieger, Jul 25 2016 *)
  • Python
    from sympy import prime
    def A163511(n):
        if n:
            k, c, m = n, 0, 1
            while k:
                c += 1
                m *= prime(c)**(s:=(~k&k-1).bit_length())
                k >>= s+1
            return m*prime(c)
        return 1 # Chai Wah Wu, Jul 17 2023

Formula

For n >= 1, a(2n) is even, a(2n+1) is odd. a(2^k) = 2^(k+1), for all k >= 0.
From Antti Karttunen, Jun 20 2014: (Start)
a(0) = 1, a(1) = 2, a(2n) = 2*a(n), a(2n+1) = A003961(a(n)).
As a more general observation about the parity, we have:
For n >= 1, A007814(a(n)) = A135523(n) = A007814(n) + A209229(n). [This permutation preserves the 2-adic valuation of n, except when n is a power of two, in which cases that value is incremented by one.]
For n >= 1, A055396(a(n)) = A091090(n) = A007814(n+1) + 1 - A036987(n).
For n >= 1, a(A000225(n)) = A000040(n).
(End)
From Antti Karttunen, Oct 11 2014: (Start)
As a composition of related permutations:
a(n) = A005940(1+A054429(n)).
a(n) = A064216(A245612(n))
a(n) = A246681(A246378(n)).
Also, for all n >= 0, it holds that:
A161511(n) = A243503(a(n)).
A243499(n) = A243504(a(n)).
(End)
More linking identities from Antti Karttunen, Dec 30 2017: (Start)
A046523(a(n)) = A278531(n). [See also A286531.]
A278224(a(n)) = A285713(n). [Another filter-sequence.]
A048675(a(n)) = A135529(n) seems to hold for n >= 1.
A250245(a(n)) = A252755(n).
A252742(a(n)) = A252744(n).
A245611(a(n)) = A253891(n).
A249824(a(n)) = A275716(n).
A292263(a(n)) = A292264(n). [A292944(n) + A292264(n) = n.]
--
A292383(a(n)) = A292274(n).
A292385(a(n)) = A292271(n). [A292271(n) + A292274(n) = n.]
--
A292941(a(n)) = A292942(n).
A292943(a(n)) = A292944(n).
A292945(a(n)) = A292946(n). [A292942(n) + A292944(n) + A292946(n) = n.]
--
A292253(a(n)) = A292254(n).
A292255(a(n)) = A292256(n). [A292944(n) + A292254(n) + A292256(n) = n.]
--
A279339(a(n)) = A279342(n).
a(A071574(n)) = A269847(n).
a(A279341(n)) = A279338(n).
a(A252756(n)) = A250246(n).
(1+A008836(a(n)))/2 = A059448(n).
(End)
From Antti Karttunen, Jul 26 2023: (Start)
For all n >= 0, a(A007283(n)) = A007283(n).
A001222(a(n)) = A290251(n).
(End)

Extensions

More terms computed and examples added by Antti Karttunen, Jun 20 2014

A241916 a(2^k) = 2^k, and for other numbers, if n = 2^e1 * 3^e2 * 5^e3 * ... p_k^e_k, then a(n) = 2^(e_k - 1) * 3^(e_{k-1}) * ... * p_{k-1}^e2 * p_k^(e1+1). Here p_k is the greatest prime factor of n (A006530), and e_k is its exponent (A071178), and the exponents e1, ..., e_{k-1} >= 0.

Original entry on oeis.org

1, 2, 3, 4, 5, 9, 7, 8, 6, 25, 11, 27, 13, 49, 15, 16, 17, 18, 19, 125, 35, 121, 23, 81, 10, 169, 12, 343, 29, 75, 31, 32, 77, 289, 21, 54, 37, 361, 143, 625, 41, 245, 43, 1331, 45, 529, 47, 243, 14, 50, 221, 2197, 53, 36, 55, 2401, 323, 841, 59, 375, 61, 961, 175, 64
Offset: 1

Views

Author

Antti Karttunen, May 03 2014

Keywords

Comments

For other numbers than the powers of 2 (that are fixed), this permutation reverses the sequence of exponents in the prime factorization of n from the exponent of 2 to that of the largest prime factor, except that the exponents of 2 and the greatest prime factor present are adjusted by one. Note that some of the exponents might be zeros.
Self-inverse permutation of natural numbers, composition of A122111 & A241909 in either order: a(n) = A122111(A241909(n)) = A241909(A122111(n)).
This permutation preserves both bigomega and the (index of) largest prime factor: for all n it holds that A001222(a(n)) = A001222(n) and A006530(a(n)) = A006530(n) [equally: A061395(a(n)) = A061395(n)].
From the above it follows, that this fixes both primes (A000040) and powers of two (A000079), among other numbers.
Even positions from n=4 onward contain only terms of A070003, and the odd positions only the terms of A102750, apart from 1 which is at a(1), and 2 which is at a(2).

Crossrefs

A241912 gives the fixed points; A241913 their complement.
{A000027, A122111, A241909, A241916} form a 4-group.
The sum of prime indices of a(n) is A243503(n).
Even bisection of A358195 = Heinz numbers of rows of A358172.
A112798 lists prime indices, length A001222, sum A056239.

Programs

  • Mathematica
    nn = 65; 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[If[IntegerQ@ #, n/4, g@ Reverse@(# - Join[{1}, ConstantArray[0, Length@ # - 2], {1}] &@ f@ n)] &@ Log2@ n, {n, 4, 4 nn, 4}] (* Michael De Vlieger, Aug 27 2016 *)
  • PARI
    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, Jul 02 2018
    
  • Scheme
    (define (A241916 n) (A122111 (A241909 n)))

Formula

a(1)=1, and for n>1, a(n) = A006530(n) * A137502(n)/2.
a(n) = A122111(A241909(n)) = A241909(A122111(n)).
If 2n has prime factorization Product_{i=1..k} prime(x_i), then a(n) = Product_{i=1..k-1} prime(x_k-x_i+1). The opposite version is A000027, even bisection of A246277. - Gus Wiseman, Dec 28 2022

Extensions

Description clarified by Antti Karttunen, Jul 02 2018

A161511 Number of 1...0 pairs in the binary representation of 2n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Row (partition) sums of A125106.
a(n) is also the weight (= sum of parts) of the integer partition having viabin number n. The viabin number of an integer partition is defined in the following way. Consider the southeast border of the Ferrers board of the integer partition and consider the binary number obtained by replacing each east step with 1 and each north step, except the last one, with 0. The corresponding decimal form is, by definition, the viabin number of the given integer partition. "Viabin" is coined from "via binary". For example, consider the integer partition [2,2,2,1]. The southeast border of its Ferrers board yields 10100, leading to the viabin number 20. - Emeric Deutsch, Jul 24 2017

Examples

			For n = 5, the binary representation of 2n is 1010; the 1...0 pairs are 10xx, 1xx0, and xx10, so a(5) = 3.
		

Crossrefs

Cf. A000120, A243499 (gives the corresponding products), A227183, A056239, A243503, A006068, A163511.
Sum of prime indices of A005940.
Row sums of A125106.
A reverse version is A359043, row sums of A242628.
A029837 adds up standard compositions, row sums of A066099.
A029931 adds up binary indices, row sums of A048793.

Programs

  • Mathematica
    a[0] = 0; a[n_] := If[EvenQ[n], a[n/2] + DigitCount[n/2, 2, 1], a[(n-1)/2] + 1]; Array[a, 93, 0] (* Jean-François Alcover, Sep 09 2017 *)
  • PARI
    a(n)=local(t,k);t=0;k=1;while(n>0,if(n%2==0,k++,t+=k);n\=2);t
    
  • Python
    def A161511(n):
        a, b = 0, 0
        for i, j in enumerate(bin(n)[:1:-1], 1):
            if int(j):
                a += i-b
                b += 1
        return a # Chai Wah Wu, Jul 26 2023
  • Scheme
    ;; Two variants, the recursive one requiring memoizing definec-macro from Antti Karttunen's IntSeq-library.
    (define (A161511 n) (let loop ((n n) (i 1) (s 0)) (cond ((zero? n) s) ((even? n) (loop (/ n 2) (+ i 1) s)) (else (loop (/ (- n 1) 2) i (+ s i))))))
    (definec (A161511 n) (cond ((zero? n) n) ((even? n) (+ (A000120 n) (A161511 (/ n 2)))) (else (+ 1 (A161511 (/ (- n 1) 2))))))
    ;; Antti Karttunen, Jun 28 2014
    

Formula

a(0) = 0; a(2n) = a(n) + A000120(n); a(2n+1) = a(n) + 1.
From Antti Karttunen, Jun 28 2014: (Start)
Can be also obtained by mapping with an appropriate permutation from the lists of partition sizes computed for other enumerations similar to A125106:
a(n) = A227183(A006068(n)).
a(n) = A056239(A005940(n+1)).
a(n) = A243503(A163511(n)). (End)
a(n) = A029931(n) - binomial(A000120(n),2). - Gus Wiseman, Jan 03 2023
a(n) = a(n - A048896(n-1)) + 1 for n>=1 (see Peter J. Taylor link). - Mikhail Kurkov, Jul 04 2025

A227183 a(n) is the sum of parts of the unique unordered partition encoded in the run lengths of the binary expansion of n; row sums of A227739 for n >= 1.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jul 05 2013

Keywords

Comments

Like A129594 this sequence utilizes the fact that compositions (i.e., ordered partitions) can be bijectively mapped to (unordered) partitions by taking the partial sums of the list of composants after one has been subtracted from each except the first one. Compositions in turn are mapped to nonnegative integers via the runlength encoding, where the lengths of maximum runs of 0's or 1's in binary representation of n give the composants. See the OEIS Wiki page and the example below.
Each n occurs A000041(n) times in total and occurs for the first time at A227368(n) and for the last time at position A000225(n). See further comments and conjectures at A227368 and A227370.

Examples

			19 has binary expansion "10011", thus the maximal runs of identical bits (scanned from right to left) are [2,2,1]. We subtract one from each after the first one, to get [2,1,0] and then form their partial sums as [2,2+1,2+1+0], which thus maps to unordered partition {2+3+3} which adds to 8. Thus a(19)=8.
		

Crossrefs

Row sums of A227189 and A227739. Cf. A227184 (corresponding products), A227185, A227189, A227192, A129594, A226062, A227368.
Analogous sum sequences computed for other encoding schemes of unordered partitions: A036042, A056239, A161511, A243503. Cf. also A229119, A003188, A075157, A243353 (associated permutations mapping between these schemes).

Programs

  • Mathematica
    Table[Function[b, Total@ Accumulate@ Prepend[If[Length@ b > 1, Rest[b] - 1, {}], First@ b] - Boole[n == 0]]@ Map[Length, Split@ Reverse@ IntegerDigits[n, 2]], {n, 0, 79}] // Flatten (* Michael De Vlieger, May 09 2017 *)
  • Python
    def A227183(n):
      '''Sum of parts of the unique unordered partition encoded in the run lengths of the binary expansion of n.'''
      s = 0
      b = n%2
      i = 1
      while (n != 0):
        n >>= 1
        if ((n%2) == b): # Staying in the same run of bits?
          i += 1
        else: # The run changes.
          b = n%2
          s += i
      return(s)

Formula

a(n) = Sum_{i=0..A005811(n)-1} A227189(n,i). [The defining formula]
Equivalently, for n>=1, a(n) = Sum_{i=(A173318(n-1)+1)..A173318(n)} A227739(i).
a(n) = A227192(n) - A000217(A005811(n)-1).
Other identities:
a(A129594(n)) = a(n). [This follows from the fact that conjugating a partition doesn't change its total sum]
a(A226062(n)) = a(n). [Which is also true for the "Bulgarian operation"]
From Antti Karttunen, Mar 08 2015: (Start)
Can be also obtained by mapping with an appropriate permutation from the sequences giving sizes of each partition (i.e., sum of their parts) computed for other enumerations similar to A227739:
a(n) = A036042(A229119(n)).
a(n) = A161511(A003188(n)).
a(n) = A056239(A243353(n)).
a(n) = A243503(1+A075157(n)).
(End)

A243051 Integer sequence induced by Bulgarian solitaire operation on partition list A241918: a(n) = A241909(A242424(A241909(n))).

Original entry on oeis.org

1, 2, 4, 3, 8, 25, 16, 9, 9, 343, 32, 10, 64, 14641, 125, 27, 128, 15, 256, 98, 2401, 371293, 512, 30, 27, 24137569, 6, 2662, 1024, 147, 2048, 81, 161051, 893871739, 625, 50, 4096, 78310985281, 4826809, 28, 8192, 3993, 16384, 57122, 50, 14507145975869, 32768, 90, 81
Offset: 1

Views

Author

Antti Karttunen, May 29 2014

Keywords

Comments

In "Bulgarian solitaire" a deck of cards or another finite set of objects is divided into one or more piles, and the "Bulgarian operation" is performed by taking one card from each pile, and making a new pile of them, which is added to the remaining set of piles. Essentially, this operation is a function whose domain and range are unordered integer partitions (cf. A000041) and which preserves the total size of a partition (the sum of its parts). This sequence is induced when the operation is implemented on the partitions as ordered by the list A241918.

Examples

			For n = 10, we see that as 10 = 2*5 = p_1^1 * p_2^0 * p_3^1, it encodes a partition [2,2,2]. Applying one step of Bulgarian solitaire (subtract one from each part, and add a new part as large as there were parts in the old partition) to this partition results a new partition [1,1,1,3], which is encoded in the prime factorization of p_1^0 * p_2^0 * p_3^0 * p_4^3 = 7^3 = 343. Thus a(10) = 343.
For n = 46, we see that as 46 = 2*23 = p_1 * p_9 = p_1^1 * p_2^0 * p_3^0 * ... * p_9^1, it encodes a partition [2,2,2,2,2,2,2,2,2]. Applying one step of Bulgarian solitaire to this partition results a new partition [1,1,1,1,1,1,1,1,1,9], which is encoded in the prime factorization of p_1^0 * p_2^0 * ... * p_9^0 * p_10^9 = 29^9 = 14507145975869. Thus a(46) = 14507145975869.
For n = 1875, we see that as 1875 = p_1^0 * p_2^1 * p_3^4, it encodes a partition [1,2,5]. Applying Bulgarian Solitaire, we get a new partition [1,3,4]. This in turn is encoded by p_1^0 * p_2^2 * p_3^2 = 3^2 * 5^2 = 225. Thus a(1875)=225.
		

References

  • Martin Gardner, Colossal Book of Mathematics, Chapter 34, Bulgarian Solitaire and Other Seemingly Endless Tasks, pp. 455-467, W. W. Norton & Company, 2001.

Crossrefs

Row 1 of A243060 (table which gives successive "recursive iterates" of this sequence and converges towards A122111).
Fixed points: A243054.

Formula

a(n) = A241909(A242424(A241909(n))).
a(n) = 1 + A075157(A226062(A075158(n-1))).
A243503(a(n)) = A243503(n) for all n. [Because Bulgarian operation doesn't change the total sum of the partition].

A243060 Square array read by antidiagonals: rows are successively recursivized versions of Bulgarian solitaire operation (starting from the usual "first order" version, A243051), as applied to partitions listed in A241918.

Original entry on oeis.org

1, 2, 1, 4, 2, 1, 3, 4, 2, 1, 8, 3, 4, 2, 1, 25, 8, 3, 4, 2, 1, 16, 6, 8, 3, 4, 2, 1, 9, 16, 6, 8, 3, 4, 2, 1, 9, 5, 16, 6, 8, 3, 4, 2, 1, 343, 9, 5, 16, 6, 8, 3, 4, 2, 1, 32, 12, 9, 5, 16, 6, 8, 3, 4, 2, 1, 10, 32, 12, 9, 5, 16, 6, 8, 3, 4, 2, 1, 64, 35, 32, 12, 9, 5, 16, 6, 8, 3, 4, 2, 1, 14641, 64, 10, 32, 12, 9, 5, 16, 6, 8, 3, 4, 2, 1, 125, 24, 64, 10, 32, 12, 9, 5, 16, 6, 8, 3, 4, 2, 1
Offset: 1

Views

Author

Antti Karttunen, May 29 2014

Keywords

Comments

The array is read by antidiagonals: A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), ... .
Each row is a A241909-conjugate of the corresponding row in A243070.
Rows in both arrays converge towards A122111.
First point where row k differs from row k of A243070 seems to be A000040(k+2): primes from five onward: 5, 7, 11, 13, 17, 19, 23, 29, 31, ...
While the first point where row k differs from A122111 seems to begin as 6, 12, 24, 48, 96, 192, 384, 768, 1536, 3072, ... A007283 (3*2^n) from the term n=1 onward.
The rows in this table preserve A243503.

Examples

			The top left corner of the array:
  1, 2, 4, 3, 8, 25, 16, 9, 9, 343,  32,  10,  64, 14641,   125,   27, ...
  1, 2, 4, 3, 8,  6, 16, 5, 9,  12,  32,  35,  64,    24,    18,   25, ...
  1, 2, 4, 3, 8,  6, 16, 5, 9,  12,  32,  10,  64,    24,    18,    7, ...
  1, 2, 4, 3, 8,  6, 16, 5, 9,  12,  32,  10,  64,    24,    18,    7, ...
  1, 2, 4, 3, 8,  6, 16, 5, 9,  12,  32,  10,  64,    24,    18,    7, ...
		

Crossrefs

Row 1: A243051, Row 2: A243052, Row 3: A243053.
Rows converge towards A122111.

Programs

  • Scheme
    (define (A243060 n) (A243060bi (A002260 n) (A004736 n)))
    (define (A243060bi row col) (explist->n (ascpart_to_prime-exps (bulgarian-operation-n-th-order (prime-exps_to_ascpart (primefacs->explist col)) row))))
    (define (bulgarian-operation-n-th-order ascpart n) (if (or (zero? n) (null? ascpart)) ascpart (let ((newpart (length ascpart))) (let loop ((newpartition (list)) (ascpart ascpart)) (cond ((null? ascpart) (sort (cons newpart (bulgarian-operation-n-th-order newpartition (- n 1))) <)) (else (loop (if (= 1 (car ascpart)) newpartition (cons (- (car ascpart) 1) newpartition)) (cdr ascpart))))))))
    ;; For other required functions and libraries, please see A243051.
Showing 1-10 of 14 results. Next