OFFSET
1,2
COMMENTS
a(n+1) = a(n) + (a(n) mod 7). - Ben Paul Thurston, Jan 09 2008
Also defined by: a(1)=1, and a(n) = smallest number larger than a(n-1) such that a(n)^3 - a(n-1)^3 is divisible by 7. - Zak Seidov, Apr 21 2009
Indices of the even numbers in the Padovan sequence. - Francesco Daddi, Jul 31 2011
Euler's problem (see Link lines, English translation by David Zao): Finding the values of a so that the form a^3-1 is divisible by 7. The three residuals that remain after the division of any square by 7 are 1, 2 and 4. Hence the values are 7n+1, 7n+2, 7n+4. - Bruno Berselli, Oct 24 2012
LINKS
Leonhard Euler, The Euler Archive, Theoremata circa divisores numerorum (E134), Novi Commentarii academiae scientiarum imperialis Petropolitanae, Volume 1 (1750), p. 40 (Theorem II, example 2).
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
From R. J. Mathar, Apr 28 2009: (Start)
G.f.: x*(1 + x + 2*x^2 + 3*x^3)/((1 + x + x^2)*(x-1)^2).
a(n) = a(n-1) + a(n-3) - a(n-4) for n > 4.
a(n) = a(n-3) + 7 for n > 3. (End)
From Wesley Ivan Hurt, Jun 13 2016: (Start)
a(n) = (21*n - 21 - 6*cos(2*n*Pi/3) + 4*sqrt(3)*sin(2*n*Pi/3))/9.
a(3k) = 7k-3, a(3k-1) = 7k-5, a(3k-2) = 7k-6. (End)
a(n) = 4*n - 3 - 2*floor(n/3) - 3*floor((n+1)/3). - Ridouane Oudra, Nov 23 2022
MAPLE
A047350:=n->(21*n-21-6*cos(2*n*Pi/3)+4*sqrt(3)*sin(2*n*Pi/3))/9: seq(A047350(n), n=1..100); # Wesley Ivan Hurt, Jun 13 2016
MATHEMATICA
Select[Range[0, 150], MemberQ[{1, 2, 4}, Mod[#, 7]] &] (* Wesley Ivan Hurt, Jun 13 2016 *)
PROG
(PARI) a(n)=n\3*7+[-3, 1, 2][n%3+1] \\ Charles R Greathouse IV, Jul 31 2011
(Magma) [n : n in [0..150] | n mod 7 in [1, 2, 4]]; // Wesley Ivan Hurt, Jun 13 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved