login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A047415 Numbers that are congruent to {1, 3, 4, 6} mod 8. 3
1, 3, 4, 6, 9, 11, 12, 14, 17, 19, 20, 22, 25, 27, 28, 30, 33, 35, 36, 38, 41, 43, 44, 46, 49, 51, 52, 54, 57, 59, 60, 62, 65, 67, 68, 70, 73, 75, 76, 78, 81, 83, 84, 86, 89, 91, 92, 94, 97, 99, 100, 102, 105, 107, 108, 110, 113, 115, 116, 118, 121, 123, 124 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Consider an operation SS(n) defined for a specific sequence b where b(n) is the n-th term of b. This operation is defined as follows: SS(1) = b(1); if b(n+1) > SS(n), SS(n+1) = SS(n) + b(n+1), otherwise SS(n+1) = SS(n) - b(n+1) (If b(n) = A000027(n), then SS(n) = A008344(n+1)). If the sequence b can represent any permutation of the first n natural numbers, then a(n) is the maximum possible value of SS(n). - Iain Fox, Sep 15 2020 (see link by Math StackExchage)
LINKS
Math StackExchange, Strange Sum of Numbers 1 to 100, September 2020.
FORMULA
G.f.: x*(1+x+2*x^3) / ( (1+x^2)*(x-1)^2 ). - R. J. Mathar, Oct 08 2011
a(n) = 2*(n-1)-(i^(n*(n+1))-1)/2, where i=sqrt(-1). - Bruno Berselli, Dec 06 2011
From Wesley Ivan Hurt, May 31 2016: (Start)
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) for n>4.
a(n) = (1+i)*(4*n-4*n*i+3*i-3+i^(1-n)-i^n)/4 where i=sqrt(-1).
a(2*k) = A047398(k), a(2*k-1) = A047461(k). (End)
E.g.f.: (4 + sin(x) - cos(x) + (4*x - 3)*exp(x))/2. - Ilya Gutkovskiy, May 31 2016
Sum_{n>=1} (-1)^(n+1)/a(n) = 3*Pi/16 - (sqrt(2)+1)*log(2)/8 + sqrt(2)*log(sqrt(2)+2)/4. - Amiram Eldar, Dec 24 2021
MAPLE
A047415:=n->2*(n-1)-(I^(n*(n+1))-1)/2: seq(A047415(n), n=1..100); # Wesley Ivan Hurt, May 31 2016
MATHEMATICA
Select[Range[108], MemberQ[{1, 3, 4, 6}, Mod[#, 8]]&] (* Bruno Berselli, Dec 06 2011 *)
PROG
(Maxima) makelist(2*(n-1)-(%i^(n*(n+1))-1)/2, n, 1, 55); /* Bruno Berselli, Dec 06 2011 */
(PARI) a(n)=2*(n-1)-(I^(n*(n+1))-1)/2 \\ Charles R Greathouse IV, Dec 06 2011
(Magma) [n : n in [0..150] | n mod 8 in [1, 3, 4, 6]]; // Wesley Ivan Hurt, May 31 2016
CROSSREFS
Sequence in context: A329862 A153236 A158705 * A087805 A213040 A173318
KEYWORD
nonn,easy
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 08:27 EDT 2024. Contains 371964 sequences. (Running on oeis4.)