OFFSET
1,1
COMMENTS
Numbers n such that n mod 840 = 3 and n mod 2520 <> 3.
LINKS
FORMULA
a(n) = -3*(209+70*(-1)^n-420*n). a(n) = a(n-1)+a(n-2)-a(n-3). G.f.: 3*x*(279*x^2+280*x+281) / ((x-1)^2*(x+1)). - Colin Barker, Apr 11 2013
EXAMPLE
843 mod 2 = 844 mod 3 = 845 mod 4 = 846 mod 5 = 847 mod 6 = 848 mod 7 = 849 mod 8 = 1 and 850 mod 9 = 4, hence 843 is in the sequence.
MATHEMATICA
LinearRecurrence[{1, 1, -1}, {843, 1683, 3363}, 40] (* Harvey P. Dale, Nov 22 2015 *)
PROG
(PARI) {k=7; m=44000; for(n=1, m, j=0; b=1; while(b&&j<k, if((n+j)%(2+j)==1, j++, b=0)); if(b&&(n+k)%(2+k)!=1, print1(n, ", ")))}
(Magma) [n: n in [1..44000] | forall{j: j in [0..6] | IsOne((n+j) mod (2+j)) and (n+7) mod 9 ne 1}]; // Bruno Berselli, Apr 11 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Klaus Brockhaus, Jun 15 2004
STATUS
approved