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

A250475 Permutation of natural numbers: a(n) = A249824(A249825(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 13, 14, 15, 9, 16, 18, 20, 21, 23, 24, 12, 25, 27, 28, 19, 30, 33, 34, 35, 36, 37, 22, 17, 38, 43, 29, 44, 46, 26, 47, 50, 51, 32, 53, 55, 41, 56, 58, 60, 31, 61, 64, 65, 66, 39, 40, 67, 49, 48, 71, 75, 76, 77, 78, 80, 63, 81, 45, 84, 52, 86, 88, 90, 91, 93, 94, 62, 57, 95, 70, 69, 98, 103, 104, 105, 54, 74, 72, 106, 111, 68, 42
Offset: 1

Views

Author

Antti Karttunen, Dec 07 2014

Keywords

Crossrefs

Inverse: A250476.
Row 3 of A251721.

Programs

Formula

a(n) = A249824(A249825(n)).

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

A249821 Square array of permutations: A(row,col) = A246277(A083221(row,col)), read by antidiagonals A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ... .

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 06 2014

Keywords

Comments

Permutation A249817 preserves the smallest prime factor of n, i.e., A055396(A249817(n)) = A055396(n), in other words, keeps all the terms that appear on any row of A246278 on the same row of A083221. Permutations in this table are induced by changes that A249817 does onto each row of the latter table, thus permutation on row r of this table can be used to sort row r of A246278 into ascending order. I.e., A246278(r, A(r,c)) = A083221(r,c) [the corresponding row in the Sieve of Eratosthenes, where each row appears in monotone order].
The multi-set of cycle-sizes of permutation A249817 is a disjoint union of cycle-sizes of all permutations in this array. For example, A249817 has a 7-cycle (33 39 63 57 99 81 45) which originates from the 7-cycle (6 7 11 10 17 14 8) of A064216, which occurs as the second row in this table.
On each row, 4 is the first composite number (and the first term less than previous, apart from row 1), and on row n it occurs in position A250474(n). This follows because A001222(A246277(n)) = A001222(n)-1 and because on each row of A083221 (see A083140) all terms between the square of prime (second term on each row) and the first cube (of the same prime, this cube mapping in this array to 4) are nonsquare semiprimes (A006881), this implies that the corresponding terms in this array must be primes.
Also, as the smaller prime factor of the terms on row n of A083221 is constant, A020639(n), and for all i < j: A246277(p_{i} * p_{j}) < A246277(p_i * p_{j+1}), the primes on any row appear in monotone order.

Examples

			The top left corner of the array:
1, 2, 3, 4, 5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...
1, 2, 3, 5, 4,  7, 11,  6, 13, 17, 10, 19,  9,  8, 23, 29, 14, 15, 31, ...
1, 2, 3, 5, 7, 11, 13, 17,  4, 19, 23,  6, 29, 31, 37, 41,  9, 43, 10, ...
1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37,  4, 41, 43, 47, 53, 59, ...
...
		

Crossrefs

Inverse permutations can be found from table A249822.
Row k+1 is a left-to-right composition of the first k rows of A251721.
Row 1: A000027 (an identity permutation), Row 2: A064216, Row 3: A249823, Row 4: A249825.
The initial growing part of each row converges towards A008578.

Programs

Formula

A(row,col) = A246277(A083221(row,col)).
A001222(A(row,col)) = A001222(A083221(row,col)) - 1. [This follows directly from the properties of A246277.]

A249823 Permutation of natural numbers: a(n) = A246277(A084967(n)).

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 17, 4, 19, 23, 6, 29, 31, 37, 41, 9, 43, 10, 47, 53, 14, 59, 61, 67, 15, 71, 73, 22, 79, 21, 26, 83, 89, 97, 101, 103, 107, 34, 33, 25, 8, 109, 113, 39, 127, 131, 35, 38, 137, 139, 46, 149, 51, 151, 157, 49, 163, 12, 167, 173, 58, 55, 179, 181, 191, 193, 57, 62, 65, 197, 74, 69, 77, 199, 211, 223, 227, 82, 229, 233, 18
Offset: 1

Views

Author

Antti Karttunen, Nov 06 2014

Keywords

Crossrefs

Programs

Formula

a(n) = A246277(A084967(n)).
As a composition of other permutations:
a(n) = A064216(A249745(n)).
a(n) = A249825(A250476(n)).

A249826 Permutation of natural numbers: a(n) = A078898(A003961(A003961(A003961(2*n)))).

Original entry on oeis.org

1, 2, 3, 14, 4, 21, 5, 92, 33, 25, 6, 144, 7, 32, 39, 641, 8, 226, 9, 170, 50, 36, 10, 1007, 46, 43, 355, 223, 11, 267, 12, 4482, 56, 55, 59, 1582, 13, 58, 68, 1190, 15, 350, 16, 249, 420, 70, 17, 7043, 78, 316, 86, 301, 18, 2485, 66, 1555, 91, 77, 19, 1869, 20, 81, 549, 31374, 80, 391, 22, 379, 109, 413, 23, 11068, 24, 88, 496, 406, 87, 473, 26, 8324, 3905, 99, 27
Offset: 1

Views

Author

Antti Karttunen, Dec 06 2014

Keywords

Crossrefs

Programs

Formula

a(n) = A078898(A003961(A003961(A003961(2*n)))).
a(n) = A078898(A246278(4,n)).
As a composition of other permutations:
a(n) = A250476(A249824(n)).
a(n) = A250476(A249746(A048673(n))). [Composition of the first three rows of array A251722.]
Showing 1-5 of 5 results.