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.

User: Daniel Blaine McBride

Daniel Blaine McBride's wiki page.

Daniel Blaine McBride has authored 2 sequences.

A318682 a(n) is the number of odd values minus the number of even values of the integer log of all positive integers up to and including n.

Original entry on oeis.org

-1, -2, -1, -2, -1, 0, 1, 0, -1, 0, 1, 2, 3, 4, 3, 2, 3, 2, 3, 4, 3, 4, 5, 6, 5, 6, 7, 8, 9, 8, 9, 8, 7, 8, 7, 6, 7, 8, 7, 8, 9, 8, 9, 10, 11, 12, 13, 14, 13, 12, 11, 12, 13, 14, 13, 14, 13, 14, 15, 14, 15, 16, 17, 16, 15, 14, 15, 16, 15, 14, 15, 14, 15, 16, 17, 18, 17, 16, 17, 18
Offset: 1

Author

Daniel Blaine McBride, Aug 30 2018

Keywords

Comments

a(n) = Sum_{k=1..n} (-1)^(sopfr(k)+1), with sopfr(n) the sum of the prime factors of n with repetition, also known as the integer log of n.

Examples

			a(4) = -1 - 1 + 1 - 1 = -2, since sopfr(1) = 0, sopfr(2) = 2, sopfr(3) = 3, and sopfr(4) = 4.
		

Crossrefs

Cf. A001414 (sum of prime divisors of n with repetition, sopfr(n)).
Cf. A036349 (numbers such that sopfr(n) is even).

Programs

  • Mathematica
    Nest[Append[#, #[[-1]] + (-1)^(1 + Total@ Flatten[ConstantArray[#1, #2] & @@@ FactorInteger[Length@ # + 1] ])] &, {-1}, 79] (* Michael De Vlieger, Sep 10 2018 *)
  • PARI
    sopfr(n) = my(f=factor(n)); sum(k=1, #f~, f[k, 1]*f[k, 2]);
    a(n) = sum(k=1, n, (-1)^(sopfr(k)+1)); \\ Michel Marcus, Sep 09 2018
  • Python
    from sympy import factorint
    def A318682(n):
        a_n = 0
        for i in range(1, n+1):
            a_n += (-1)**(sum(p*e for p, e in factorint(i).items())+1)
        return a_n
    

Formula

a(n) = a(n-1) + (-1)^(sopfr(n)+1) with a(1) = (-1)^(sopfr(1)+1) = -1.

A298156 Composite numbers n of which the sum of prime divisors of n (with repetition) equals the concatenation of two integers k and k + 1.

Original entry on oeis.org

35, 42, 50, 60, 64, 72, 76, 81, 86, 93, 136, 145, 153, 159, 164, 174, 253, 273, 289, 325, 365, 385, 390, 416, 438, 462, 468, 488, 494, 497, 549, 550, 555, 559, 592, 644, 658, 660, 664, 666, 686, 703, 704, 710, 737, 747, 792, 836, 852, 884, 885, 891, 920, 940, 944, 946, 980
Offset: 1

Author

Daniel Blaine McBride, Jan 13 2018

Keywords

Comments

Composite numbers n, of which A001414(n) (sum of prime divisors of n with repetition, sopfr(n)) is in sequence A001704 (numbers m which are the concatenation of k and k+1).

Examples

			35 = 5*7, sopfr(35) = 5+7 = 12, 12 =k||k+1 when k = 1.
		

Crossrefs

Cf. A001414 (sum of prime divisors of n with repetition, sopfr(n)).
Cf. A001704 (numbers which are the concatenation of k and k+1).

Programs

  • Mathematica
    Select[Range[10^3], And[CompositeQ@ #, Subtract @@ Map[FromDigits, TakeDrop[#, Floor[Length[#]/2]]] == -1 &@ IntegerDigits@ Total[Flatten@ Map[ConstantArray[#1, #2] & @@ # &, FactorInteger[#]]]] &] (* Michael De Vlieger, Jan 14 2018 *)
  • PARI
    is(n)=my(f = factor(n), sopfr = sum(i = 1, #f~, f[i, 1] * f[i, 2]); d = digits(sopfr), v); if((#d) % 2 == 0, v = vector(#d / 2); v[#v] = -1; return(vector(#d / 2, j, d[j]) - vector(#d / 2, #d / 2 + j, d[j]) == v), return(d == concat(digits(10^(#d \ 2) - 1), digits(10^(#d \ 2))))) \\ David A. Corneth, Jan 13 2018
    
  • PARI
    sopfr(n,f=factor(n))=sum(i=1,#f~, f[i,1]*f[i,2])
    has(n)=my(d=digits(n),k=#d); digits(fromdigits(d[1..k\2])+1) == d[k\2+1..k]
    list(lim)=my(v=List()); forfactored(n=35,lim\1, if(n[2][,2]!=[1]~ && has(sopfr(0,n[2])), listput(v,n[1]))); Vec(v) \\ Charles R Greathouse IV, Jan 15 2018

Formula

sopfr(n) = k||k+1 when n is not prime and k is a positive integer.