OFFSET
1,1
COMMENTS
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
{a(n)} = {8+(k + m)*26} union {18+(k + m)*26} for m = 0, 5, 10,...,5p,... and k = 1, 2, 3 (values in increasing order).
EXAMPLE
34 is in the sequence because 34^2+1= 13*89.
MAPLE
* first program *
with(numtheory):p:=13:
for n from 1 to 1000 do:
if factorset(n^2+1)[1] = p then printf(`%d, `, n):
else
fi:
od:
* second program using the formula*
for n from 0 to 100 by 5 do:
for k from 1 to 3 do:
x:=8+(k+n)*26:y:=18+(k+n)*26:
printf(`%d, `, x):printf(`%d, `, y):
od:
od:
MATHEMATICA
lst={}; Do[If[FactorInteger[n^2+1][[1, 1]]==13, AppendTo[lst, n]], {n, 2, 2000}]; lst
p = 13; ps = Select[Range[p - 1], Mod[#, 4] != 3 && PrimeQ[#] &]; Select[Range[1200], Divisible[(nn = #^2 + 1), p] && ! Or @@ Divisible[nn, ps] &] (* Amiram Eldar, Aug 16 2019 *)
PROG
(PARI) isok(n) = factor(n^2+1)[1, 1] == 13; \\ Michel Marcus, Oct 08 2014
(Magma) [n: n in [2..3000] | PrimeDivisors(n^2+1)[1] eq 13]; // Bruno Berselli, Oct 08 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Oct 08 2014
STATUS
approved