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 A193351 #46 May 02 2025 12:12:24 %S A193351 3,4,8,9,16,18,49,50,64,81,169,225,288,324,392,578,625,729,882,900, %T A193351 1024,1458,1568,1936,2304,2450,2592,3042,3136,3200,3362,3600,4096, %U A193351 4489,4802,4900,5000,6241,6272,6400,6962,7744,7938,8100,10082,11025,11552,12996 %N A193351 Numbers k such that A071324(k) is prime. %C A193351 Numbers k such that the alternating sum of all divisors of k (divisors nonincreasing, starting with k) is prime. %C A193351 The corresponding primes are 2, 3, 5, 7, 11, 13, 43, 31, 43, 61, 157, ... %C A193351 It is interesting to note that all numbers except the first are squares, or twice a square, hence the conjecture: %C A193351 For k > 3, if the alternating sum of all divisors of k (divisors nonincreasing, starting with k) is a prime number, then k is either a square or twice a square. %C A193351 This conjecture is verified up to k <= 10^8. - _Shreyansh Jaiswal_, Apr 25 2025 %C A193351 Nevertheless, the difficulty is only for the even numbers. The odd numbers k are necessarily square because the number of divisors of an integer j is odd if and only if j is a square => the alternate sum of the odd divisors is odd. %C A193351 For large k, the asymptotic law of the ratio r = (number of squares) / (number of twice squares) seems to be r ~ 1. For example, for k < 10^6 we obtain 213 primes corresponding to 118 squares and 95 twice squares. %C A193351 Similar considerations such as those discussed for the odd squares also exist for the sequence A023194 (numbers k such that sigma(k) is prime). All numbers k except the first are squares, and each number of this sequence is a prime power => sigma(k) is odd. %C A193351 From _Shreyansh Jaiswal_, Apr 19 2025: (Start) %C A193351 For k < 10^6, the ratio r is 118/95, approximately 1.24. For k <= 10^8, there are 815 perfect squares and 546 twice squares. This gives r = 815/546, which is approximately 1.49. This computational data does not hint that r ~ 1. %C A193351 Interestingly, out of the first 400 terms, 245 terms can be represented as a sum of two distinct positive integer squares. %C A193351 Another interesting aspect is terms of the form 10^n. For 1 <= n <= 500, only n = 8 (corresponding to 10^8) is a term in the sequence. It appears that terms of the form 10^n are quite uncommon. (End) %H A193351 Shreyansh Jaiswal, <a href="/A193351/b193351.txt">Table of n, a(n) for n = 1..1362</a> (terms 1..400 from Harvey P. Dale) [All terms upto 10^8] %e A193351 169 is in the sequence because the divisors of 169 are 1, 13, 169 and 169 - 13 + 1 = 157 is prime. %p A193351 with(numtheory):for n from 1 to 20000 do:x:=divisors(n):n1:=nops(x):s:=0: s:=sum('((-1)^(i+1))*x[n1-i+1]', 'i'=1..n1): if type(s,prime)=true then printf(`%d, `,n):else fi:od: %t A193351 Select[Range[13000],PrimeQ[Total[Times@@@Partition[Riffle[ Reverse[ Divisors[ #]],{1,-1},{2,-1,2}],2]]]&] (* _Harvey P. Dale_, Feb 04 2015 *) %o A193351 (Python) %o A193351 from sympy import *; from functools import lru_cache %o A193351 cached_divisors = lru_cache()(divisors) %o A193351 def A071324(n): return sum(d if i%2==0 else -d for i, d in enumerate(reversed(cached_divisors(n)))) %o A193351 for n in range(1,13001): %o A193351 if isprime(A071324(n)): %o A193351 print(n, end=", ") # _Shreyansh Jaiswal_, Apr 17 2025 %Y A193351 Cf. A023194, A055494, A071324. %K A193351 nonn %O A193351 1,1 %A A193351 _Michel Lagneau_, Dec 20 2012