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.

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).

A270435 Positions of zeros in A270434; numbers n for which A270432(n) = A270433(n).

Original entry on oeis.org

96, 220, 222, 226, 272, 274, 276, 288, 376, 380, 394, 396, 398, 412, 414, 416, 422, 434, 448, 458, 462, 464, 466, 472, 476, 480, 482, 484, 486, 506, 508, 512, 514, 522, 524, 528, 590, 592, 594, 596, 618, 620, 622, 636, 638, 648, 652, 654, 656, 658, 662, 678, 680, 682, 684, 686, 688, 704, 706, 708, 992, 1008, 1016, 1024
Offset: 1

Views

Author

Antti Karttunen, Mar 17 2016

Keywords

Comments

Numbers n for which in the range 1 .. n there are exactly the same number of s's such that A048673(s) and A064216(s) are of the same parity than there are t's such that A048673(t) and A064216(t) are of opposite parity.
No other terms after a(2651) = 2346398 in range 1 .. 2^25.

Crossrefs

Programs

  • Mathematica
    nn = 2048; 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@ #] &]; Flatten@ Position[Table[Count[s, k_ /; k <= n] - Count[t, k_ /; k <= n], {n, nn/2}], n_ /; n == 0] (* Michael De Vlieger, Mar 19 2016 *)

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.

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