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.

A193351 Numbers k such that A071324(k) is prime.

Original entry on oeis.org

3, 4, 8, 9, 16, 18, 49, 50, 64, 81, 169, 225, 288, 324, 392, 578, 625, 729, 882, 900, 1024, 1458, 1568, 1936, 2304, 2450, 2592, 3042, 3136, 3200, 3362, 3600, 4096, 4489, 4802, 4900, 5000, 6241, 6272, 6400, 6962, 7744, 7938, 8100, 10082, 11025, 11552, 12996
Offset: 1

Views

Author

Michel Lagneau, Dec 20 2012

Keywords

Comments

Numbers k such that the alternating sum of all divisors of k (divisors nonincreasing, starting with k) is prime.
The corresponding primes are 2, 3, 5, 7, 11, 13, 43, 31, 43, 61, 157, ...
It is interesting to note that all numbers except the first are squares, or twice a square, hence the conjecture:
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.
This conjecture is verified up to k <= 10^8. - Shreyansh Jaiswal, Apr 25 2025
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.
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.
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.
From Shreyansh Jaiswal, Apr 19 2025: (Start)
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.
Interestingly, out of the first 400 terms, 245 terms can be represented as a sum of two distinct positive integer squares.
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)

Examples

			169 is in the sequence because the divisors of 169 are 1, 13, 169 and 169 - 13 + 1 = 157 is prime.
		

Crossrefs

Programs

  • Maple
    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:
  • Mathematica
    Select[Range[13000],PrimeQ[Total[Times@@@Partition[Riffle[ Reverse[ Divisors[ #]],{1,-1},{2,-1,2}],2]]]&] (* Harvey P. Dale, Feb 04 2015 *)
  • Python
    from sympy import *; from functools import lru_cache
    cached_divisors = lru_cache()(divisors)
    def A071324(n):  return sum(d if i%2==0 else -d for i, d in enumerate(reversed(cached_divisors(n))))
    for n in range(1,13001):
        if isprime(A071324(n)):
            print(n, end=", ") # Shreyansh Jaiswal, Apr 17 2025