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.

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

A069799 The number obtained by reversing the sequence of nonzero exponents in the prime factorization of n with respect to distinct primes present, as ordered by their indices.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 18, 13, 14, 15, 16, 17, 12, 19, 50, 21, 22, 23, 54, 25, 26, 27, 98, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 250, 41, 42, 43, 242, 75, 46, 47, 162, 49, 20, 51, 338, 53, 24, 55, 686, 57, 58, 59, 150, 61, 62, 147, 64, 65
Offset: 1

Views

Author

Amarnath Murthy, Apr 13 2002

Keywords

Comments

Equivalent description nearer to the old name: a(n) is a number obtained by reversing the indices of the primes present in the prime factorization of n, from the smallest to the largest, while keeping the nonzero exponents of those same primes at their old positions.
This self-inverse permutation of natural numbers fixes the numbers in whose prime factorization the sequence of nonzero exponents form a palindrome: A242414.
Integers which are changed are A242416.
Considered as a function on partitions encoded by the indices of primes in the prime factorization of n (as in table A112798), this implements an operation which reverses the order of vertical line segments of the "steps" in Young (or Ferrers) diagram of a partition, but keeps the order of horizontal line segments intact. Please see the last example in the example section.

Examples

			a(24) = 54 as 24 = p_1^3 * p_2^1 = 2^3 * 3^1 and 54 = p_1^1 * p_2^3 = 2 * 3^3.
For n = 2200, we see that it encodes the partition (1,1,1,3,3,5) in A112798 as 2200 = p_1 * p_1 * p_1 * p_3 * p_3 * p_5 = 2^3 * 5^2 * 11. This in turn corresponds to the following Young diagram in French notation:
   _
  | |
  | |
  | |_ _
  |     |
  |     |_ _
  |_ _ _ _ _|
Reversing the order of vertical line segment lengths (3,2,1)  to (1,2,3), but keeping the order of horizontal line segment lengths as (1,2,2), we get a new Young diagram
   _
  | |_ _
  |     |
  |     |_ _
  |         |
  |         |
  |_ _ _ _ _|
which represents the partition (1,3,3,5,5,5), encoded in A112798 by p_1 * p_3^2 * p_5^3 = 2 * 5^2 * 11^3 = 66550, thus a(2200) = 66550.
		

Crossrefs

A242414 gives the fixed points and A242416 is their complement.
{A000027, A069799, A242415, A242419} form a 4-group.
The set of permutations {A069799, A105119, A225891} generates an infinite dihedral group.

Programs

  • Haskell
    a069799 n = product $
                zipWith (^) (a027748_row n) (reverse $ a124010_row n)
    -- Reinhard Zumkeller, Apr 27 2013
    (MIT/GNU Scheme, with Aubrey Jaffer's SLIB Scheme library)
    (require 'factor)
    (define (A069799 n) (let ((pf (ifactor n))) (apply * (map expt (uniq pf) (reverse (multiplicities pf))))))
    (define (ifactor n) (cond ((< n 2) (list)) (else (sort (factor n) <))))
    (define (uniq lista) (let loop ((lista lista) (z (list))) (cond ((null? lista) (reverse! z)) ((and (pair? z) (equal? (car z) (car lista))) (loop (cdr lista) z)) (else (loop (cdr lista) (cons (car lista) z))))))
    (define (multiplicities lista) (let loop ((mults (list)) (lista lista) (prev #f)) (cond ((not (pair? lista)) (reverse! mults)) ((equal? (car lista) prev) (set-car! mults (+ 1 (car mults))) (loop mults (cdr lista) prev)) (else (loop (cons 1 mults) (cdr lista) (car lista))))))
    ;; Antti Karttunen, May 24 2014
    
  • Maple
    A069799 := proc(n) local e,j; e := ifactors(n)[2]:
    mul (e[j][1]^e[nops(e)-j+1][2], j=1..nops(e)) end:
    seq (A069799(i), i=1..40);
    # Peter Luschny, Jan 17 2011
  • Mathematica
    f[n_] := Block[{a = Transpose[ FactorInteger[n]], m = n}, If[ Length[a] == 2, Apply[ Times, a[[1]]^Reverse[a[[2]] ]], m]]; Table[ f[n], {n, 1, 65}]
  • PARI
    a(n) = {my(f = factor(n)); my(g = f); my(nbf = #f~); for (i=1, nbf, g[i, 1] = f[nbf-i+1, 1];); factorback(g);} \\ Michel Marcus, Jul 02 2015

Formula

If n = p_a^e_a * p_b^e_b * ... * p_j^e_j * p_k^e_k, where p_a < ... < p_k are distinct primes of the prime factorization of n (sorted into ascending order), and e_a, ..., e_k are their nonzero exponents, then a(n) = p_a^e_k * p_b^e_j * ... * p_j^e_b * p_k^e_a.
a(n) = product(A027748(o(n)+1-k)^A124010(k): k=1..o(n)) = product(A027748(k)^A124010(o(n)+1-k): k=1..o(n)), where o(n) = A001221(n). - Reinhard Zumkeller, Apr 27 2013
From Antti Karttunen, Jun 01 2014: (Start)
Can be obtained also by composing/conjugating related permutations:
a(n) = A242415(A242419(n)) = A242419(A242415(n)).
(End)

Extensions

Edited, corrected and extended by Robert G. Wilson v and Vladeta Jovovic, Apr 15 2002
Definition corrected by Reinhard Zumkeller, Apr 27 2013
Definition again reworded, Comments section edited and Young diagram examples added by Antti Karttunen, May 30 2014

A242418 Numbers n in whose prime factorization, n = 2^e1 * 3^e2 * 5^e3 * ... * p_k^e_k, the exponents (some of them possibly zero) of prime factors from 2 to p_k form a palindrome, so that e1 = e_k, e2 = e_{k-1}, etc.

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 14, 16, 22, 26, 30, 32, 34, 36, 38, 46, 58, 62, 64, 74, 82, 86, 90, 94, 100, 106, 110, 118, 122, 128, 134, 142, 146, 158, 166, 178, 194, 196, 202, 206, 210, 214, 216, 218, 226, 238, 254, 256, 262, 270, 274, 278, 298, 300, 302, 314, 326, 334
Offset: 1

Views

Author

Antti Karttunen, May 20 2014

Keywords

Comments

a(1)=1 is included because 1 has an empty factorization (either no exponents, or all of them are zero), which thus is also a palindrome.

Crossrefs

Fixed points of A137502.
Cf. A241912.
A002110 and A079704 are subsequences.

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]; Select[Range@ 336, g@ f@ # == g@ Reverse@ f@ # &] (* Michael De Vlieger, Aug 27 2016 *)

Formula

a(1)=1, and for n > 1, a(n) = 2 * A241912(n-1).

A273258 Write the distinct prime divisors p of n in the (PrimePi(p) - 1)-th place, ignoring multiplicity. Decode the resulting number after first reversing the code, ignoring any leading zeros.

Original entry on oeis.org

1, 2, 2, 2, 2, 6, 2, 2, 2, 10, 2, 6, 2, 14, 6, 2, 2, 6, 2, 10, 10, 22, 2, 6, 2, 26, 2, 14, 2, 30, 2, 2, 14, 34, 6, 6, 2, 38, 22, 10, 2, 70, 2, 22, 6, 46, 2, 6, 2, 10, 26, 26, 2, 6, 10, 14, 34, 58, 2, 30, 2, 62, 10, 2, 14, 154, 2, 34, 38, 42, 2, 6, 2, 74, 6, 38, 6, 286, 2, 10, 2, 82, 2, 70, 22, 86
Offset: 1

Views

Author

Michael De Vlieger, Aug 28 2016

Keywords

Comments

Encode n with the function f(n) = noting the distinct prime divisors p of n by writing "1" in the (PrimePi(n) - 1)-th place, e.g, f(6) = f(12) = "11". This function is akin to A054841(n) except we don't note the multiplicity e of p in n, rather merely note "1" if e > 0.
This sequence decodes f(n) by reversing the digits.
If we decode f(n) without reversal, we have A007947(n), since f(n) sets any multiplicity e > 1 of prime divisor p of n to 1.
All terms except a(1) are of the form 2x with x odd. a(1) = 1, since f(1) = "0" and stands unaffected in reversal and decoding, and any zeros to the right of all 1's are lost in reversal. Thus f(15) = "110" reversed becomes "011" -> "11" decoded equals 2 * 3 = 6. Because we lose leading zeros, we always have 1 in position 1, which decoded is interpreted as the factor 2.
a(p) for p prime = 2, since primes are written via f(p) as 1 in the (PrimePi(p)-1)-th place. There is only one 1 in this number (similar to a perfect power of ten decimally) and when it is reversed, the number loses all leading zeros to become "1" -> 2. This also applies to prime powers p^e, since e is rendered as 1 by f(p^e), i.e., f(p^e) = f(p).

Examples

			a(3) = 2 since f(3) = "10" reversed becomes "01", loses leading zeros to become "1" -> 2.
a(6) = a(12) = "11" reversed stays the same -> 2 * 3 = 6.
a(15) = "110" reversed becomes "011", loses leading zeros to become "11" -> 6.
a(42) = "1101" reversed becomes "1011" -> 70 (a(70) = 42).
		

Crossrefs

Cf. A007947, A019565, A030101, A054841 (analogous encoding algorithm), A069799, A087207, A137502, A276379, A293448 (a bijective variant of this sequence).

Programs

  • Mathematica
    Table[Times @@ Prime@ Flatten@ Position[#, 1] &@ Reverse@ If[# == 1, {0}, Function[f, ReplacePart[Table[0, {PrimePi[f[[-1, 1]]]}], #] &@ Map[PrimePi@ First@ # -> 1 &, f]]@ FactorInteger@ #] &@ n, {n, 86}]
  • Scheme
    (define (A273258 n) (A019565 (A030101 (A087207 n)))) ;; Antti Karttunen, Jun 18 2017

Formula

a(n) = A019565(A030101(A087207(n))). - Antti Karttunen, Jun 18 2017
For all n, a(A039956(n)) = A293448(A039956(n)). - Antti Karttunen, Nov 21 2017

A377308 All winning positions of Gordon Hamilton's Jumping Frogs game, encoded as even numbers by their prime-factorization exponents.

Original entry on oeis.org

2, 4, 6, 8, 12, 16, 18, 20, 24, 30, 32, 42, 48, 50, 54, 56, 60, 64, 70, 84, 90, 96, 100, 120, 126, 128, 140, 150, 162, 176, 192, 198, 200, 210, 240, 252, 256, 260, 264, 270, 280, 294, 300, 330, 350, 384, 390, 392, 400, 416, 420, 462, 480, 486, 490, 500
Offset: 1

Views

Author

Glen Whitney, Oct 23 2024

Keywords

Comments

For the rules of the Jumping Frogs game, see A377232.
Enumerate the primes in order, p_1 = 2, p_2 = 3, etc. Factor any natural number k > 1 as p_1^{x_1}p_2^{x_2}...p_i^{x_i}, where i is as small as possible and each x_j is nonnegative. Then when k is even and x_1, x_2, ..., x_i is a winning position for Jumping Frogs, k occurs as a term. We consider only even numbers to keep the positions distinct; leading zeros can never be used or affect the outcome of Jumping Frogs.
An even number k is a term if and only if A137502(k) is a term. - Pontus von Brömssen, Oct 24 2024

Examples

			Consider k = 28. It can be written as 2^2 * 3^0 * 5^0 * 7^1. The jumping frogs position 2, 0, 0, 1 has no legal moves (no occupied place adjacent to the 1 entry and no occupied place 2 places away from the 2 entry). Therefore it is not a winning position, and 28 is not a term.
Conversely, k = 20 can be written as 2^2 * 3^0 * 5^1. The jumping frogs position 2, 0, 1 can be won in a single move to 0, 0, 3 (all frogs in one place). Hence k is a term, namely a(8).
		

References

Crossrefs

Cf. A137502, A377232 (binary winning positions).
Showing 1-5 of 5 results.