A361904 Odd numbers k such that for all even divisors d of k^2+1, d^2+1 is a prime number.
1, 3, 5, 45, 65, 175, 277, 345, 435, 573, 673, 695, 715, 875, 955, 985, 1095, 1255, 1405, 1495, 1515, 1845, 1915, 2035, 2135, 2315, 2375, 2525, 2687, 2805, 2837, 2965, 3035, 3665, 3715, 3725, 4185, 4225, 4265, 4345, 4495, 4635, 4865, 5987, 6195, 6205, 6315
Offset: 1
Keywords
Examples
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.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
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
-
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
Comments