login
Numbers k such that A065876(k) = k^2-k+1.
3

%I #15 May 05 2022 08:36:55

%S 0,2,3,4,5,6,7,9,10,11,14,15,16,19,20,24,25,26,29,35,36,39,40,41,45,

%T 49,51,54,56,59,61,65,66,69,71,74,79,84,85,90,94,95,101,110,116,120,

%U 121,124,126,130,131,134,139,141,145,146,150,156,159,160,165,169,170,171

%N Numbers k such that A065876(k) = k^2-k+1.

%H Amiram Eldar, <a href="/A071557/b071557.txt">Table of n, a(n) for n = 1..1000</a>

%t q[n_] := Module[{m = n+1}, While[!Divisible[m^2 + 1, n^2 + 1], m++]; m == n^2 - n + 1]; Select[Range[200], q] (* _Amiram Eldar_, May 05 2022 *)

%o (PARI) for(n=0,300,q=n+1; while((q^2+1)%(n^2+1)>0,q++); if(q==n^2-n+1,print1(n,",")))

%Y Cf. A065876.

%K easy,nonn

%O 1,2

%A _Benoit Cloitre_, May 30 2002

%E a(1) = 0 added by _Amiram Eldar_, May 05 2022