OFFSET
1,1
COMMENTS
Observed to be the same as when all consecutive terms in the sequence a(0) = n+1, a(k+1) = a(k)^2 - a(k) + 1 will eventually end in 57, 93, 57, 93, ... - Eugene Dorokhin, Aug 28 2018
LINKS
Jinyuan Wang, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,1,-1). [R. J. Mathar, Apr 15 2010]
FORMULA
From R. J. Mathar, Apr 15 2010 (Start)
a(n) = a(n-1) + a(n-6) - a(n-7).
G.f.: x*(3 + 4*x + x^2 + 3*x^3 + x^4 + 4*x^5 + 4*x^6)/ ((1+x) * (x^2-x+1) * (1+x+x^2) * (x-1)^2). (End)
EXAMPLE
11 is in the sequence because 11*12/2 = 66 ends in 6. - Emeric Deutsch, Apr 10 2010
MAPLE
a := proc (n) if `mod`((1/2)*n*(n+1), 10) = 6 or `mod`((1/2)*n*(n+1), 10) = 8 then n else end if end proc: seq(a(n), n = 1 .. 200); # Emeric Deutsch, Apr 10 2010
MATHEMATICA
LinearRecurrence[{1, 0, 0, 0, 0, 1, -1}, {3, 7, 8, 11, 12, 16, 23}, 50] (* Stefano Spezia, Sep 01 2018 *)
Position[Accumulate[Range[200]], _?(Mod[#, 10]==6 ||Mod[#, 10]==8&)]//Flatten (* Harvey P. Dale, May 23 2024 *)
PROG
(PARI) is(n) = #setintersect([n*(n+1)/2%10], [6, 8])==1 \\ Felix Fröhlich, Sep 01 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
J. Lowell, Mar 31 2010
EXTENSIONS
More terms from Emeric Deutsch, Apr 10 2010
STATUS
approved