OFFSET
1,1
COMMENTS
Equivalently, numbers m such that 2^m - m is divisible by 3. Indeed, for every prime p, there are infinitely many numbers m such that 2^m - m (A000325) is divisible by p, here are numbers m corresponding to p = 3. - Bernard Schott, Dec 10 2021
Numbers k for which A276076(k) and A276086(k) are multiples of nine. For a simple proof, consider the penultimate digit in the factorial and primorial base expansions of n, A007623 and A049345. - Antti Karttunen, Feb 08 2024
REFERENCES
Michael Doob, The Canadian Mathematical Olympiad & L'Olympiade Mathématique du Canada 1969-1993, Canadian Mathematical Society & Société Mathématique du Canada, Problem 4, 1983, page 158, 1993.
LINKS
David Lovler, Table of n, a(n) for n = 1..1000
The IMO Compendium, Problem 4, 15th Canadian Mathematical Olympiad 1983.
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
a(n) = 4 + 6*floor(n/2) + n mod 2.
a(n) = 6*n-a(n-1)-3, with a(1)=4. - Vincenzo Librandi, Aug 05 2010
G.f.: ( x*(4+x+x^2) ) / ( (1+x)*(x-1)^2 ). - R. J. Mathar, Oct 08 2011
a(n) = 3*n - (-1)^n. - Wesley Ivan Hurt, Mar 20 2015
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/(6*sqrt(3)) - log(2)/3. - Amiram Eldar, Dec 14 2021
E.g.f.: 1 + 3*x*exp(x) - exp(-x). - David Lovler, Aug 25 2022
MATHEMATICA
Select[Range@ 150, 4 <= Mod[#, 6] <= 5 &] (* Michael De Vlieger, Mar 20 2015 *)
LinearRecurrence[{1, 1, -1}, {4, 5, 10}, 50] (* Harvey P. Dale, Oct 16 2017 *)
PROG
(Maxima) A047257(n):=4 + 6*floor(n/2) + mod(n, 2)$ akelist(A047257(n), n, 0, 40); /* Martin Ettl, Oct 24 2012 */
(PARI) a(n) = 3*n - (-1)^n \\ David Lovler, Aug 25 2022
CROSSREFS
Cf. A000325.
KEYWORD
nonn,easy
AUTHOR
STATUS
approved