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.
%I A340901 #22 Feb 17 2024 08:18:16 %S A340901 0,-2,-3,4,-5,-5,-7,-8,9,-7,-11,1,-13,-9,-8,16,-17,7,-19,-1,-10,-13, %T A340901 -23,-11,25,-15,-27,-3,-29,-10,-31,-32,-14,-19,-12,13,-37,-21,-16,-13, %U A340901 -41,-12,-43,-7,4,-25,-47,13,49,23,-20,-9,-53,-29,-16,-15,-22,-31 %N A340901 Additive with a(p^e) = (-p)^e. %C A340901 The sequence contains every integer infinitely many times. %C A340901 Proof (outline): %C A340901 1. Every integer m > 9 is the sum of distinct odd primes [R. E. Dressler]. %C A340901 2. Any integer k (positive as negative) can be written as k = 4^e - m, for sufficiently large and infinitely many e > 0 and m > 9. %C A340901 3. Pick an arbitrary integer k and write it like k = 4^e - m. Let p_1, p_2, ..., p_i be distinct odd primes such that p_1 + p_2 + ... + p_i = m. Then a(p_1*p_2*...*p_i*4^e) = 4^e - m = k. Since there are infinitely many representations of any k of the form 4^e - m, this means that there are infinitely many n such that a(n) = k. %C A340901 Q.E.D. %H A340901 Sebastian Karlsson, <a href="/A340901/b340901.txt">Table of n, a(n) for n = 1..10000</a> %H A340901 R. E. Dressler, <a href="http://dx.doi.org/10.1090/S0002-9939-1972-0292746-6">A stronger Bertrand's postulate with an application to partitions</a>, Proc. Amer. Math. Soc., 33 (1972), 226-228. %F A340901 a(A002035(n)) = - A008475(A002035(n)). %F A340901 a(n^2) = A008475(n^2). %e A340901 a(20) = a(2^2*5) = (-2)^2 + (-5) = -1. %t A340901 a[n_] := Total@ (((-First[#])^Last[#]) & /@ FactorInteger[n]); a[1] = 0; Array[a, 100] (* _Amiram Eldar_, May 15 2023 *) %o A340901 (Python) %o A340901 from sympy import primefactors as pf, multiplicity as mult %o A340901 def a(n): %o A340901 return sum([(-p)**mult(p, n) for p in pf(n)]) %o A340901 for n in range(1, 59): %o A340901 print(a(n), end=', ') %o A340901 (PARI) a(n) = my(f=factor(n)); sum(k=1, #f~, (-f[k,1])^f[k,2]); \\ _Michel Marcus_, Jan 26 2021 %o A340901 (APL, Dyalog dialect) A340901 ← {1=⍵:0 ⋄ +/{(-⍺)*≢⍵}⌸factors(⍵)} ⍝ Needs also factors function from https://dfns.dyalog.com/c_factors.htm - _Antti Karttunen_, Feb 16 2024 %Y A340901 Cf. A001414, A002035, A008472, A008475, A008476, A316523. %K A340901 sign %O A340901 1,2 %A A340901 _Sebastian Karlsson_, Jan 26 2021