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!)
A179054 a(n) = (1^k + 2^k + ... + n^k) modulo (n+2), where k is any odd integer greater than or equal to 3. 1
1, 1, 1, 4, 1, 1, 1, 6, 1, 1, 1, 8, 1, 1, 1, 10, 1, 1, 1, 12, 1, 1, 1, 14, 1, 1, 1, 16, 1, 1, 1, 18, 1, 1, 1, 20, 1, 1, 1, 22, 1, 1, 1, 24, 1, 1, 1, 26, 1, 1, 1, 28, 1, 1, 1, 30, 1, 1, 1, 32, 1, 1, 1, 34, 1, 1, 1, 36, 1, 1, 1, 38, 1, 1, 1, 40, 1, 1, 1, 42, 1, 1, 1, 44, 1, 1, 1, 46, 1, 1, 1, 48, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
LINKS
FORMULA
a(n) = 2m+2, if n = 4m for some integer m; a(n) = 1 otherwise.
G.f.: (x+x^2+x^3+4*x^4-x^5-x^6-x^7-2*x^8)/(1-2*x^4+x^8). - Robert Israel, Dec 05 2016
EXAMPLE
a(4) = (1^3 + 2^3 + 3^3 + 4^3) mod 6 = 100 mod 6 = 4.
MAPLE
seq(op([1, 1, 1, 2*k]), k=2..50); # Robert Israel, Dec 05 2016
MATHEMATICA
f[n_] := Mod[n^2(n + 1)^2/4, n + 2]; Array[f, 100] (* Robert G. Wilson v, Jul 01 2010 *)
LinearRecurrence[{0, 0, 0, 2, 0, 0, 0, -1}, {1, 1, 1, 4, 1, 1, 1, 6}, 100] (* Vincenzo Librandi, Dec 05 2016 *)
PROG
(PARI) s=0; for(n=1, 100, s+=n^3; print(s%(n+2)))
(Magma) &cat [[1, 1, 1, 2*n]: n in [1..30]]; // Vincenzo Librandi, Dec 05 2016
CROSSREFS
Sequence in context: A162400 A332012 A365788 * A063928 A344910 A326135
KEYWORD
easy,nonn
AUTHOR
Nick Hobson, Jun 27 2010
EXTENSIONS
Typo in name of sequence corrected and formula added by Nick Hobson, Jun 27 2010
More terms from Robert G. Wilson v, Jul 01 2010
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 04:42 EDT 2024. Contains 371964 sequences. (Running on oeis4.)