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.

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

A253786 a(3n) = 0, a(3n+1) = 0, a(3n+2) = 1 + a(n+1).

Original entry on oeis.org

0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 4, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 5
Offset: 0

Views

Author

Antti Karttunen, Jan 22 2015

Keywords

Comments

For n >= 1, a(n) gives the distance of n in square array A191450 from its leftmost column.
The sequence 0,1,0,0,0,2,0,...,i.e., (a(n)) with the first term removed, is the unique fixed point of the constant length 3 morphism N -> 0 N+1 0 on the infinite alphabet {0,1,...,N,...}. - Michel Dekking, Sep 09 2022
a(n) is the number of trailing 1 digits of n-1 written in ternary, for n>=1. - Kevin Ryde, Sep 09 2022

Crossrefs

Programs

  • Mathematica
    With[{nmax=200},IntegerExponent[2Range[0,nmax]-1,3]] (* Paolo Xausa, Nov 09 2023 *)
  • PARI
    a(n) = n--; my(ret=0,r); while([n,r]=divrem(n,3); r==1, ret++); ret; \\ Kevin Ryde, Sep 13 2022

Formula

Other identities and observations. For all n >= 1:
a(n) = A254046(n)-1.
a(n) <= A254045(n) <= A253894(n).
a(3n-1) = A254046(n). - Cyril Damamme, Aug 04 2015
a(n) = A007949(2n-1), i.e., the 3-adic valuation of 2n-1. - Cyril Damamme, Aug 04 2015
From Antti Karttunen, Sep 12 2017: (Start)
For all n >= 1:
a(n) = A007814(A064216(n)) = A007814(A254104(n)) = A135523(A245611(n)).
a(A048673(n)) = a(A254103(n)) = A007814(n).
a(A244154(n)) = A007814(1+n).
a(A245612(n)) = A135523(n). (End)
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1/2. - Amiram Eldar, Nov 16 2023

A253894 a(1) = 1, for n > 1, a(n) = 1 + a(A253889(n)).

Original entry on oeis.org

1, 2, 2, 3, 3, 3, 4, 3, 4, 5, 4, 5, 4, 4, 5, 5, 4, 4, 5, 5, 6, 6, 4, 6, 5, 5, 6, 5, 6, 6, 6, 5, 6, 6, 6, 7, 7, 5, 6, 7, 5, 7, 6, 6, 7, 6, 6, 6, 7, 5, 7, 7, 5, 7, 7, 6, 7, 6, 6, 7, 6, 7, 5, 7, 7, 7, 7, 5, 8, 8, 7, 7, 7, 6, 8, 8, 6, 7, 8, 7, 7, 8, 6, 8, 7, 7, 8, 6, 7, 8, 8, 7, 7, 7, 6, 8, 8, 7, 8, 8, 7, 7, 7, 7, 7, 8, 8, 7, 8, 8, 8, 8, 6, 8, 8, 7, 8, 8, 8, 8
Offset: 1

Views

Author

Antti Karttunen, Jan 22 2015

Keywords

Crossrefs

One more than A253893.
Sum of A254044 and A254045.

Formula

a(1) = 1, for n > 1, a(n) = 1 + a(A253889(n)).
a(n) = A070939(A064216(n)). [Binary width of terms of A064216.]
a(n) = A253893(n) + 1.
a(n) = A254044(n) + A254045(n).

A254044 a(1) = 1, for n>1: a(n) = a(A253889(n)) + (1 if n is of the form 3n or 3n+1, otherwise 0).

Original entry on oeis.org

1, 1, 2, 2, 1, 3, 3, 2, 3, 2, 2, 3, 2, 1, 4, 4, 3, 4, 5, 3, 3, 3, 2, 4, 3, 3, 5, 3, 2, 4, 5, 2, 2, 5, 3, 3, 4, 2, 3, 3, 1, 5, 4, 4, 4, 5, 4, 4, 4, 3, 3, 4, 4, 5, 5, 5, 5, 4, 3, 2, 3, 3, 4, 4, 3, 7, 4, 2, 3, 3, 4, 4, 3, 3, 4, 4, 3, 5, 5, 5, 6, 5, 3, 4, 5, 2, 5, 4, 4, 5, 5, 5, 5, 5, 2, 5, 7, 2, 3, 4, 5, 5, 6, 3, 6, 5, 3, 6, 3, 4, 5, 5, 2, 7, 5, 3, 5, 2, 3, 5, 7, 1, 4, 6, 5, 5, 3, 4
Offset: 1

Views

Author

Antti Karttunen, Jan 23 2015

Keywords

Crossrefs

Positions of ones: A007051.

Formula

a(1) = 1, for n>1: a(n) = a(A253889(n)) + [n is of the form 3n or 3n+1, i.e., in A032766] (Here [ ] is Iverson bracket).
a(1) = 0, thereafter, if n = 3k+2, then a(n) = a((n+1)/3), otherwise a(n) = 1 + a(A253889(n)).
a(n) = A000120(A064216(n)). [Binary weight of terms of A064216.]
a(n) = A253894(n) - A254045(n).
Other identities:
a(A007051(n)) = 1 for all n >= 0. [And no 1's in any other positions.]

A292246 Base-2 expansion of a(n) encodes the steps where numbers of the form 3k+2 are encountered when map x -> A253889(x) is iterated down to 1, starting from x=n.

Original entry on oeis.org

0, 1, 0, 2, 3, 0, 4, 1, 2, 14, 5, 12, 6, 7, 8, 2, 1, 0, 0, 9, 26, 22, 3, 20, 6, 5, 16, 10, 29, 10, 4, 11, 30, 2, 25, 60, 56, 13, 28, 54, 15, 48, 24, 17, 44, 8, 5, 12, 38, 3, 30, 26, 1, 24, 20, 1, 18, 6, 19, 62, 14, 53, 4, 14, 45, 0, 42, 7, 124, 118, 41, 50, 58, 13, 116, 106, 11, 40, 104, 33, 32, 98, 21, 92, 6, 59, 88, 18, 21, 82, 76, 9, 34, 36, 23, 74
Offset: 1

Views

Author

Antti Karttunen, Sep 15 2017

Keywords

Examples

			For n = 2, the starting value is of the form 3k+2, after which follows A253889(3) = 1, the end point of iteration, which is not, thus a(2) = 1*(2^0) = 1.
For n = 4, the starting value is not of the form 3k+2, while A253889(4) = 2 is, thus a(4) = 0*(2^0) + 1*(2^1) = 2.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1]; g[n_] := (Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n; Map[FromDigits[#, 2] &[IntegerDigits[#, 3] /. d_ /; d > 0 :> d - 1] &, Array[a, 96]] (* Michael De Vlieger, Sep 16 2017 *)

Formula

a(1) = 0; for n > 1, a(n) = 2*a(A253889(n)) + floor((n mod 3)/2).
a(n) = A289814(A292243(n)).
A000120(a(n)) = A254045(n).
a(n) AND A292244(n) = a(n) AND A292245(n) = 0, where AND is a bitwise-AND (A004198).
Showing 1-5 of 5 results.