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.

A270433 a(n) = number of terms A270431 <= n; least monotonic left inverse of A270431.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 3, 3, 3, 4, 5, 5, 5, 6, 7, 7, 8, 9, 10, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 14, 15, 16, 17, 18, 19, 19, 19, 19, 20, 20, 20, 21, 22, 23, 24, 24, 25, 26, 27, 27, 28, 28, 28, 29, 30, 30, 30, 31, 32, 33, 34, 34, 34, 35, 35, 36, 37, 37, 37, 37, 38, 39, 39, 40, 41, 42
Offset: 1

Views

Author

Antti Karttunen, Mar 17 2016

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := (Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n; g[n_] := Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1]; s = Select[Range@ 200, Xor[EvenQ@ f@ #, EvenQ@ g@ #] &] ; Table[Count[s, k_ /; k <= n], {n, 88}] (* Michael De Vlieger, Mar 17 2016 *)

Formula

a(1) = 0, for n > 1, a(n) = (A048673(n)-A064216(n) reduced modulo 2) + a(n-1).
Other identities. For all n >= 1:
a(n) = n - A270432(n).
a(A270431(n)) = n.

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

A270430 Numbers n such that A048673(n) and A064216(n) are of the same parity.

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 9, 10, 12, 13, 16, 17, 20, 25, 26, 27, 29, 30, 31, 32, 33, 34, 36, 37, 39, 40, 41, 42, 48, 49, 50, 52, 53, 58, 62, 64, 65, 68, 69, 74, 75, 77, 80, 81, 82, 85, 90, 93, 97, 98, 99, 100, 101, 102, 104, 105, 106, 108, 109, 111, 113, 114, 116, 117, 120, 121, 124, 125, 126, 128, 130, 132, 133, 136, 137, 139, 141, 144
Offset: 1

Views

Author

Antti Karttunen, Mar 17 2016

Keywords

Comments

See A270434 for the possible bias favoring this sequence over the complement A270431.

Crossrefs

Complement: A270431.
Left inverse: A270432.
Cf. A245449 (a subsequence).
Cf. also A269860.

Programs

  • Mathematica
    f[n_] := (Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n; g[n_] := Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1]; Select[Range@ 144, Xor[EvenQ@ f@ #, OddQ@ g@ #] &] (* Michael De Vlieger, Mar 17 2016 *)

Formula

Other identities. For all n >= 1:
A270432(a(n)) = n.

A270434 a(n) = A270432(n) - A270433(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 17 2016

Keywords

Comments

The first negative term occurs at a(223) = -1.
After a(2457) = -1 the sequence dips next time to the negative side at n=218351.
No other negative terms after a(2346395) = -1 in range 1 .. 2^25.
In range 1..(2^25) the maximum value is a(23963418) = 8326 and there are 1252224 negative terms in that range (less than 4%).

Crossrefs

Cf. A270435 (positions of zeros).
Cf. also A038698, A269364.

Programs

  • Mathematica
    nn = 200; f[n_] := (Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n; g[n_] := Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1]; s = Select[Range@ nn, Xor[EvenQ@ f@ #, OddQ@ g@ #] &]; t = Select[Range@ nn, Xor[EvenQ@ f@ #, EvenQ@ g@ #] &]; Table[Count[s, k_ /; k <= n] - Count[t, k_ /; k <= n], {n, nn/2}] (* Michael De Vlieger, Mar 17 2016 *)
  • PARI
    default(primelimit, 2^30);
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From Michel Marcus
    A048673(n) = (A003961(n)+1)/2;
    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);
    t=0; for(n=1,2^25,if(!((A048673(n)+A064216(n))%2),t++,t--);write("b270434.txt", n, " ", t));
    
  • Scheme
    (define (A270434 n) (- (A270432 n) (A270433 n)))

Formula

a(n) = A270432(n) - A270433(n).

A269861 Numbers n such that n and A048673(n) are of opposite parity.

Original entry on oeis.org

4, 5, 7, 10, 12, 14, 15, 16, 17, 19, 21, 29, 30, 34, 36, 38, 40, 41, 42, 43, 44, 45, 48, 51, 52, 53, 55, 56, 57, 58, 61, 63, 64, 65, 67, 73, 77, 79, 82, 86, 87, 90, 91, 92, 100, 101, 102, 103, 106, 108, 110, 113, 114, 115, 120, 122, 123, 124, 125, 126, 127, 129, 130, 132, 134, 135, 136, 137, 140, 144, 146, 148, 149
Offset: 1

Views

Author

Antti Karttunen, Mar 16 2016

Keywords

Comments

Union of even terms of A246261 and odd terms of A246263.

Crossrefs

Complement: A269860.
Left inverse: A269862.
Cf. also A270431.

Programs

  • Mathematica
    f[n_] := (Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n; Select[Range@ 150, Xor[EvenQ@ f@ #, EvenQ@ #] &] (* Michael De Vlieger, Mar 17 2016 *)

Formula

Other identities. For all n >= 1:
A269862(a(n)) = n.
Showing 1-5 of 5 results.