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

A254099 Fixed points of A254115 and A254116.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 20, 22, 24, 28, 32, 40, 44, 48, 56, 64, 80, 88, 96, 112, 128, 160, 176, 192, 224, 256, 317, 320, 352, 384, 448, 512, 634, 640, 704, 768, 896, 1024, 1268, 1280, 1408, 1536, 1792, 2048, 2536, 2560, 2816, 3072, 3584, 4096, 5072, 5120, 5632, 6144, 7168, 8192, 10144, 10240, 11264
Offset: 1

Views

Author

Antti Karttunen, Feb 04 2015

Keywords

Comments

If n is a member, then 2n is as well, and vice versa, thus the sequence is completely determined by its odd terms: 1, 3, 5, 7, 11, 317, 15989189, 16964283, ...

Crossrefs

Subsequence: A000079.

Programs

A064216 Replace each p^e with prevprime(p)^e in the prime factorization of odd numbers; inverse of sequence A048673 considered as a permutation of the natural numbers.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 11, 6, 13, 17, 10, 19, 9, 8, 23, 29, 14, 15, 31, 22, 37, 41, 12, 43, 25, 26, 47, 21, 34, 53, 59, 20, 33, 61, 38, 67, 71, 18, 35, 73, 16, 79, 39, 46, 83, 55, 58, 51, 89, 28, 97, 101, 30, 103, 107, 62, 109, 57, 44, 65, 49, 74, 27, 113, 82, 127, 85, 24, 131
Offset: 1

Views

Author

Howard A. Landman, Sep 21 2001

Keywords

Comments

a((A003961(n) + 1) / 2) = n and A003961(a(n)) = 2*n - 1 for all n. If the sequence is indexed by odd numbers only, it becomes multiplicative. In this variant sequence, denoted b, even indices don't exist, and we get b(1) = a(1) = 1, b(3) = a(2) = 2, b(5) = 3, b(7) = 5, b(9) = 4 = b(3) * b(3), ... , b(15) = 6 = b(3) * b(5), and so on. This property can also be stated as: a(x) * a(y) = a(((2x - 1) * (2y - 1) + 1) / 2) for x, y > 0. - Reinhard Zumkeller [re-expressed by Peter Munn, May 23 2020]
Not multiplicative in usual sense - but letting m=2n-1=product_j (p_j)^(e_j) then a(n)=a((m+1)/2)=product_j (p_(j-1))^(e_j). - Henry Bottomley, Apr 15 2005
From Antti Karttunen, Jul 25 2016: (Start)
Several permutations that use prime shift operation A064989 in their definition yield a permutation obtained from their odd bisection when composed with this permutation from the right. For example, we have:
A243505(n) = A122111(a(n)).
A243065(n) = A241909(a(n)).
A244153(n) = A156552(a(n)).
A245611(n) = A243071(a(n)).
(End)

Examples

			For n=11, the 11th odd number is 2*11 - 1 = 21 = 3^1 * 7^1. Replacing the primes 3 and 7 with the previous primes 2 and 5 gives 2^1 * 5^1 = 10, so a(11) = 10. - _Michael B. Porter_, Jul 25 2016
		

Crossrefs

Odd bisection of A064989 and A252463.
Row 1 of A251721, Row 2 of A249821.
Cf. A048673 (inverse permutation), A048674 (fixed points).
Cf. A246361 (numbers n such that a(n) <= n.)
Cf. A246362 (numbers n such that a(n) > n.)
Cf. A246371 (numbers n such that a(n) < n.)
Cf. A246372 (numbers n such that a(n) >= n.)
Cf. A246373 (primes p such that a(p) >= p.)
Cf. A246374 (primes p such that a(p) < p.)
Cf. A246343 (iterates starting from n=12.)
Cf. A246345 (iterates starting from n=16.)
Cf. A245448 (this permutation "squared", a(a(n)).)
Cf. A253894, A254044, A254045 (binary width, weight and the number of nonleading zeros in base-2 representation of a(n), respectively).
Cf. A285702, A285703 (phi and sigma applied to a(n).)
Here obviously the variant 2, A151799(n) = A007917(n-1), of the prevprime function is used.
Cf. also A003961, A270430, A270431.

Programs

  • Mathematica
    Table[Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1], {n, 69}] (* Michael De Vlieger, Dec 18 2014, revised Mar 17 2016 *)
  • PARI
    a(n) = {my(f = factor(2*n-1)); for (k=1, #f~, f[k,1] = precprime(f[k,1]-1)); factorback(f);} \\ Michel Marcus, Mar 17 2016
    
  • Python
    from sympy import factorint, prevprime
    from operator import mul
    def a(n):
        f=factorint(2*n - 1)
        return 1 if n==1 else reduce(mul, [prevprime(i)**f[i] for i in f]) # Indranil Ghosh, May 13 2017
  • Scheme
    (define (A064216 n) (A064989 (- (+ n n) 1))) ;; Antti Karttunen, May 12 2014
    

Formula

a(n) = A064989(2n - 1). - Antti Karttunen, May 12 2014
Sum_{k=1..n} a(k) ~ c * n^2, where c = Product_{p prime > 2} ((p^2-p)/(p^2-q(p))) = 0.6621117868..., where q(p) = prevprime(p) (A151799). - Amiram Eldar, Jan 21 2023

Extensions

More terms from Reinhard Zumkeller, Sep 26 2001
Additional description added by Antti Karttunen, May 12 2014

A254115 Permutation of natural numbers: a(n) = A254104(A048673(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 13, 10, 11, 12, 9, 14, 21, 16, 15, 26, 23, 20, 43, 22, 19, 24, 63, 18, 33, 28, 31, 42, 47, 32, 55, 30, 127, 52, 27, 46, 87, 40, 17, 86, 39, 44, 107, 38, 29, 48, 75, 126, 91, 36, 95, 66, 191, 56, 53, 62, 45, 84, 35, 94, 1023, 64, 255, 110, 25, 60, 183, 254, 79, 104, 37, 54, 171, 92, 125, 174, 59, 80, 4095, 34, 61, 172, 77, 78
Offset: 1

Views

Author

Antti Karttunen, Feb 04 2015

Keywords

Crossrefs

Inverse: A254116.
Fixed points: A254099.
Related permutations: A048673, A254104, A254117.

Programs

  • Python
    from sympy import factorint, nextprime
    from operator import mul
    def a048673(n):
        f = factorint(n)
        return 1 if n==1 else (1 + reduce(mul, [nextprime(i)**f[i] for i in f]))/2
    def a254104(n):
        if n==0: return 0
        if n%3==0: return 1 + 2*a254104(2*n/3 - 1)
        elif n%3==1: return 1 + 2*a254104(2*(n - 1)/3)
        else: return 2*a254104((n - 2)/3 + 1)
    def a(n): return a254104(a048673(n)) # Indranil Ghosh, Jun 06 2017

Formula

a(n) = A254104(A048673(n)).
Other identities. For all n >= 1:
a(n) = a(2n)/2. [Even bisection halved gives back the sequence itself.]
A254117(n) = (a((2*n)+1) - 1)/2. [Likewise, the odd bisection induces A254117.]

A254118 Permutation of natural numbers: a(n) = A249745(1+A254103(n)) - 1.

Original entry on oeis.org

1, 2, 3, 6, 5, 4, 8, 20, 11, 7, 9, 33, 18, 23, 14, 13, 30, 36, 21, 44, 10, 29, 15, 55, 53, 28, 16, 74, 39, 41, 12, 179, 90, 96, 50, 114, 24, 42, 35, 92, 69, 47, 19, 86, 25, 51, 26, 236, 153, 110, 81, 101, 22, 45, 48, 221, 113, 119, 56, 77, 65, 38, 17, 546, 182
Offset: 1

Views

Author

Antti Karttunen, Feb 05 2015

Keywords

Crossrefs

Inverse: A254117.
Other related permutations: A254116, A249745, A254103 (compare to the scatterplot of this one).
Cf. A254120 (= a(2^n)).

Programs

  • PARI
    default(primelimit, 2^30);
    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)};
    A064216(n) = A064989((2*n)-1);
    A254103(n) = { if(0==n,0,if(!(n%2),(3*A254103(n/2))-1,(3*(1+A254103((n-1)/2)))\2)); };
    A254116(n) = A064216(A254103(n));
    A254118(n) = (A254116(n+n+1)-1)/2;
    for(n=1, 8191, write("b254118.txt", n, " ", A254118(n)));
    (Scheme, two versions)
    (define (A254118 n) (+ -1 (A249745 (+ 1 (A254103 n)))))
    (define (A254118 n) (/ (+ -1 (A254116 (+ 1 n n))) 2))
    
  • Python
    from sympy import factorint, prevprime, floor
    from operator import mul
    from functools import reduce
    def a064216(n):
        f=factorint(2*n - 1)
        return 1 if n==1 else reduce(mul, [prevprime(i)**f[i] for i in f])
    def a254103(n):
        if n==0: return 0
        if n%2==0: return 3*a254103(n//2) - 1
        else: return floor((3*(1 + a254103((n - 1)/2)))//2)
    def a254116(n): return a064216(a254103(n))
    def a(n): return (a254116(2*n + 1) - 1)//2
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 06 2017

Formula

a(n) = A249745(1+A254103(n)) - 1.
a(n) = (A254116((2*n)+1)-1) / 2. [Obtained also from the odd bisection of A254116.]
Showing 1-4 of 4 results.