OFFSET
1,3
COMMENTS
Numbers k that have the same last digit as k^2.
REFERENCES
L. E. Dickson, History of the Theory of Numbers, I, p. 459.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
a(n) = 5*n - a(n-1) - 9, n >= 2. - Vincenzo Librandi, Nov 18 2010 [Corrected for offset by David Lovler, Oct 10 2022]
G.f.: x^2*(1+4*x) / ( (1+x)*(x-1)^2 ). - R. J. Mathar, Oct 07 2011
a(n) = floor((5/3)*floor(3*(n-1)/2)). - Clark Kimberling, Jul 04 2012
a(n) = (10*n - 13 - 3*(-1)^n)/4. - Robert Israel, Nov 17 2014 [Corrected by David Lovler, Sep 21 2022]
E.g.f.: 4 + ((10*x - 13)*exp(x) - 3*exp(-x))/4. - David Lovler, Sep 11 2022
Sum_{n>=2} (-1)^n/a(n) = sqrt(1+2/sqrt(5))*Pi/10 + log(phi)/(2*sqrt(5)) + log(5)/4, where phi is the golden ratio (A001622). - Amiram Eldar, Oct 12 2022
MAPLE
a[0]:=0:a[1]:=1:for n from 2 to 100 do a[n]:=a[n-2]+5 od: seq(a[n], n=0..61); # Zerinvary Lajos, Mar 16 2008
MATHEMATICA
Select[Range[0, 151], MemberQ[{0, 1}, Mod[#, 5]] &] (* T. D. Noe, Mar 31 2013 *)
PROG
(Haskell)
a008851 n = a008851_list !! (n-1)
a008851_list = [10*n + m | n <- [0..], m <- [0, 1, 5, 6]]
-- Reinhard Zumkeller, Jul 27 2011
(PARI) a(n) = 5*(n\2)+bitand(n, 1); /* Joerg Arndt, Mar 31 2013 */
(PARI) a(n) = floor((5/3)*floor(3*(n-1)/2)); /* Joerg Arndt, Mar 31 2013 */
(Magma) [n: n in [0..200] | n mod 5 in {0, 1}]; // Vincenzo Librandi, Nov 17 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Offset corrected by Reinhard Zumkeller, Jul 27 2011
STATUS
proposed