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.

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

This page as a plain text file.
%I A270434 #18 Mar 20 2016 12:56:54
%S A270434 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,
%T A270434 9,10,11,10,11,12,13,14,13,12,11,10,9,10,11,12,11,12,13,12,11,10,9,10,
%U A270434 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
%N A270434 a(n) = A270432(n) - A270433(n).
%C A270434 The first negative term occurs at a(223) = -1.
%C A270434 After a(2457) = -1 the sequence dips next time to the negative side at n=218351.
%C A270434 No other negative terms after a(2346395) = -1 in range 1 .. 2^25.
%C A270434 In range 1..(2^25) the maximum value is a(23963418) = 8326 and there are 1252224 negative terms in that range (less than 4%).
%H A270434 Antti Karttunen, <a href="/A270434/b270434.txt">Table of n, a(n) for n = 1..35000</a>
%F A270434 a(n) = A270432(n) - A270433(n).
%t A270434 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 *)
%o A270434 (PARI)
%o A270434 default(primelimit, 2^30);
%o A270434 A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From _Michel Marcus_
%o A270434 A048673(n) = (A003961(n)+1)/2;
%o A270434 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)};
%o A270434 A064216(n) = A064989((2*n)-1);
%o A270434 t=0; for(n=1,2^25,if(!((A048673(n)+A064216(n))%2),t++,t--);write("b270434.txt", n, " ", t));
%o A270434 (Scheme) (define (A270434 n) (- (A270432 n) (A270433 n)))
%Y A270434 Cf. A270430, A270431, A270432, A270433.
%Y A270434 Cf. A270435 (positions of zeros).
%Y A270434 Cf. also A038698, A269364.
%K A270434 sign
%O A270434 1,2
%A A270434 _Antti Karttunen_, Mar 17 2016