OFFSET
1,2
COMMENTS
Conjecture: the sequence is infinite.
We observe two subsequences each having specific properties:
(i) a subsequence of numbers divisible by 5 such that a(n)^2+1 contains 4 divisors {1, 2, p, 2*p} including two even divisors 2 and 2*p = a(n)^2+1 where p is prime.
(ii) a subsequence of numbers > 3 not divisible by 5 such that a(n)^2+1 contains eight divisors {1, 2, 5, 10, q, 2*q, 5*q, 10*q} including four even divisors 2, 10, 2*q = (a(n)^2+1)/5 and 10*q = a(n)^2+1, where q is prime.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
5 is in the sequence because the divisors of 5^2+1 are {1, 2, 13, 26} and 2^2+1 = 5 is prime, 26^2+1 = 677 is prime.
277 is in the sequence because the divisors of 277^2+1 are {1, 2, 5, 10, 7673, 15346, 38365, 76730} and 2^2+1 = 5 is prime, 10^2+1 = 101 is prime, 15346^2+1 = 235499717 is prime, 76730^2+1 = 5887492901 is prime.
MAPLE
q:= k-> andmap(d-> d::odd or isprime(d^2+1), numtheory[divisors](k^2+1)):
select(q, [2*i-1$i=1..4000])[]; # Alois P. Heinz, Mar 30 2023
MATHEMATICA
Lst={}; A=Table[Length[Select[Divisors[n^2+1], EvenQ]], {n, 1, 10000}]; B=Array[DivisorSum[#^2+1, 1&, And[EvenQ@#, PrimeQ[#^2+1]]&]&, 10000]; Do[If[A[[m]]==B[[m]]||B[m]!=0||B[m]!=0, AppendTo[Lst, m]], {m, 1, 10000, 2}]; Lst
PROG
(PARI) isok(k) = if (k%2, my(d=select(x->!(x%2), divisors(k^2+1))); for (i=1, #d, if (!isprime(d[i]^2+1), return(0))); return(1)); \\ Michel Marcus, Mar 28 2023
(Python)
from sympy import divisors, isprime
def ok(n): return n&1 and all(d&1 or isprime(d**2+1) for d in divisors(n**2+1))
print([k for k in range(7000) if ok(k)]) # Michael S. Branicky, Apr 17 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Mar 28 2023
STATUS
approved