OFFSET
1,1
COMMENTS
For all divisors d of n>0, Pell(d) divides Pell(n), so if a prime divides the n-th Pell number, so does it for all multiples of n.
For n > 1, a(n) is the multiplicative order of -3-2*sqrt(2), in GF(prime(n)) if 2 is a quadratic residue (mod prime(n)) or GF(prime(n)^2) otherwise. Thus a(n) divides prime(n)-1 if prime(n) == 1 or 7 (mod 8), i.e. n is in A024704, and a(n) divides prime(n)+1 if prime(n) == 3 or 5 (mod 8), i.e. n is 2 or is in A024705. - Robert Israel, Aug 28 2015
LINKS
Alois P. Heinz and Robert Israel, Table of n, a(n) for n = 1..10000 (n = 1 .. 1000 from Alois P. Heinz)
J. L. Schiffman, Exploring the Fibonacci sequence of order two with CAS technology, Paper C027, Electronic Proceedings of the Twenty-fourth Annual International Conference on Technology in Collegiate Mathematics, Orlando, Florida, March 22-25, 2012.
EXAMPLE
a(4)=6 because the 6th Pell number, 70, is the first that is divisible by the 4th prime (=7).
MAPLE
p:= proc(n) p(n):=`if`(n<2, n, 2*p(n-1)+p(n-2)) end:
a:= proc(n) local k, t; t:= ithprime(n);
for k while irem(p(k), t)>0 do od; k
end:
seq(a(n), n=1..100); # Alois P. Heinz, Mar 28 2014
f:= proc(n)
local p, r, G;
uses numtheory;
p:= ithprime(n);
if quadres(2, p)=1 then
r:= msqrt(2, p);
order(-3-2*r, p)
else
G:= GF(p, 2, r^2-2);
G:-order( G:-ConvertIn(-3-2*r));
fi
end proc:
2, seq(f(n), n=2..100); # Robert Israel, Aug 28 2015
MATHEMATICA
p[n_] := p[n] = If[n<2, n, 2*p[n-1] + p[n-2]]; a[n_] := Module[{k, t}, t = Prime[n]; For[k=1, Mod[p[k], t]>0, k++]; k]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jun 16 2015, after Alois P. Heinz *)
PROG
(PARI) a(n, p=prime(n))=my(cur=Mod(1, p), last, m=1); while(cur, m++; [last, cur]=[cur, 2*cur+last]); m \\ Charles R Greathouse IV, Jun 16 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Ralf Stephan, Aug 19 2006
STATUS
approved