|
|
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
|
|
|
MATHEMATICA
|
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)))
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
Typo in name of sequence corrected and formula added by Nick Hobson, Jun 27 2010
|
|
STATUS
|
approved
|
|
|
|