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-8 of 8 results.

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

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

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

A243503 Sums of parts of partitions (i.e., their sizes) as ordered in the table A241918: a(n) = Sum_{i=A203623(n-1)+2..A203623(n)+1} A241918(i).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 05 2014

Keywords

Comments

Each n occurs A000041(n) times in total.
Where are the first and the last occurrence of each n located?

Crossrefs

Cf. A243504 (the products of parts), A241918, A000041, A227183, A075158, A056239, A241909.
Sum of prime indices of A241916, the even bisection of A358195.
Sums of even-indexed rows of A358172.
A112798 lists prime indices, length A001222, sum A056239, max A061395.

Programs

  • Mathematica
    Table[If[n==1,0,With[{y=Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]},Last[y]*Length[y]+Last[y]-Total[y]+Length[y]-1]],{n,100}] (* Gus Wiseman, Jan 09 2023 *)

Formula

a(n) = Sum_{i=A203623(n-1)+2..A203623(n)+1} A241918(i).
a(n) = A056239(A241909(n)).
a(n) = A227183(A075158(n-1)).
a(A000040(n)) = a(A000079(n)) = n for all n >= 1.
a(A122111(n)) = a(n) for all n.
a(A243051(n)) = a(n) for all n, and likewise for A243052, A243053 and other rows of A243060.
a(n) = A061395(n) * A001222(n) + A061395(n) - A056239(n) + A001222(n) - 1. - Gus Wiseman, Jan 09 2023
a(n) = A326844(2n) + A001222(n). - Gus Wiseman, Jan 09 2023

A359360 Length times minimum part of the integer partition with Heinz number n. Least prime index of n times number of prime indices of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Dec 28 2022

Keywords

Comments

The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). A prime index of n is a number m such that prime(m) divides n.

Examples

			The partition with Heinz number 7865 is (6,5,5,3), so a(7865) = 4*3 = 12.
		

Crossrefs

Difference of A056239 and A359358.
The opposite version is A326846.
A055396 gives minimum prime index, maximum A061395.
A112798 list prime indices, length A001222, sum A056239.
A243055 subtracts the least prime index from the greatest.
A358195 gives Heinz numbers of rows of A358172, even bisection A241916.

Programs

  • Mathematica
    Table[PrimeOmega[n]*PrimePi[FactorInteger[n][[1,1]]],{n,100}]
  • PARI
    a(n) = if (n==1, 0, my(f=factor(n)); bigomega(f)*primepi(f[1, 1])); \\ Michel Marcus, Dec 28 2022

Formula

a(n) = A001222(n) * A055396(n).

A356958 Triangle read by rows: if n has weakly increasing prime indices (a,b,...,y,z) then row n is (b-a+1, ..., y-a+1, z-a+1).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Dec 27 2022

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			Triangle begins:
   1:   .
   2:   .
   3:   .
   4:   1
   5:   .
   6:   2
   7:   .
   8:  1 1
   9:   1
  10:   3
  11:   .
  12:  1 2
  13:   .
  14:   4
  15:   2
  16: 1 1 1
For example, the prime indices of 315 are (2,2,3,4), so row 315 is (2,3,4) - 2 + 1 = (1,2,3).
		

Crossrefs

Row lengths are A001222(n) - 1.
Indices of empty rows are A008578.
Even bisection is A112798.
Heinz numbers of rows are A246277.
An opposite version is A358172, Heinz numbers A358195.
Row sums are A359358(n) + A001222(n) - 1.
A112798 list prime indices, sum A056239.
A243055 subtracts the least prime index from the greatest.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[If[n==1,{},1-First[primeMS[n]]+Rest[primeMS[n]]],{n,100}]

A358172 Triangle read by rows: if n has weakly increasing prime indices (a,b,...,y,z) then row n is (z-a+1, z-b+1, ..., z-y+1).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Dec 20 2022

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			Triangle begins:
   1:   .
   2:   .
   3:   .
   4:   1
   5:   .
   6:   2
   7:   .
   8:  1 1
   9:   1
  10:   3
  11:   .
  12:  2 2
  13:   .
  14:   4
  15:   2
  16: 1 1 1
  17:   .
  18:  2 1
  19:   .
  20:  3 3
For example, the prime indices of 900 are (1,1,2,2,3,3), so row 900 is 3 - (1,1,2,2,3) + 1 = (3,3,2,2,1).
		

Crossrefs

Row lengths are A001222(n) - 1.
Indices of empty rows are A008578.
Even-indexed rows have sums A243503.
Row sums are A326844(n) + A001222(n) - 1.
An opposite version is A356958, Heinz numbers A246277.
Heinz numbers of the rows are A358195, even bisection A241916.
A112798 list prime indices, sum A056239.
A243055 subtracts the least prime index from the greatest.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[If[n==1,{},1+Last[primeMS[n]]-Most[primeMS[n]]],{n,100}]

A359358 Let y be the integer partition with Heinz number n. Then a(n) is the size of the Young diagram of y after removing a rectangle of the same length as y and width equal to the smallest part of y.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Dec 27 2022

Keywords

Comments

The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).

Examples

			The partition with Heinz number 7865 is (6,5,5,3), which has the following diagram. The 3 X 4 rectangle is shown in dots.
  . . . o o o
  . . . o o
  . . . o o
  . . .
The size of the complement is 7, so a(7865) = 7.
		

Crossrefs

The opposite version is A326844.
Row sums of A356958 are a(n) + A001222(n) - 1, Heinz numbers A246277.
A055396 gives minimum prime index, maximum A061395.
A112798 list prime indices, sum A056239.
A243055 subtracts the least prime index from the greatest.
A326846 = size of the smallest rectangle containing the prime indices of n.
A358195 gives Heinz numbers of rows of A358172, even bisection A241916.

Programs

  • Mathematica
    Table[If[n==1,0,With[{q=Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]},Total[q]-q[[1]]*Length[q]]],{n,100}]

Formula

a(n) = A056239(n) - A001222(n) * A055396(n).
a(n) = A056239(n) - A359360(n).
Showing 1-8 of 8 results.