OFFSET
1,1
COMMENTS
Sequence contains all odd primes because of the fact that ((1-sqrt(2))^p + (1+sqrt(2))^p - 2) is divisible by p where p is an odd prime.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
3 is a term because 0 + 1 + 2 = 3 is divisible by 3.
4 is a term because 0 + 1 + 2 + 5 = 8 is divisible by 4.
5 is a term because 0 + 1 + 2 + 5 + 12 = 20 is divisible by 5.
7 is a term because 0 + 1 + 2 + 5 + 12 + 20 + 79 = 119 is divisible by 7.
MATHEMATICA
Module[{nn=250, pell}, pell=LinearRecurrence[{2, 1}, {0, 1}, nn]; Position[ Table[ Total[Take[pell, n]]/n, {n, nn}], _?(IntegerQ[#]&)]]//Flatten (* Harvey P. Dale, Nov 11 2021 *)
PROG
(PARI) a048739(n) = local(w=quadgen(8)); -1/2+(3/4+1/2*w)*(1+w)^n+(3/4-1/2*w)*(1-w)^n;
for(n=1, 1e3, if(a048739(n-1) % (n+1) == 0, print1(n+1, ", ")));
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan, Mar 15 2016
STATUS
approved