|
|
A047596
|
|
Numbers that are congruent to {2, 3, 4, 5} mod 8.
|
|
2
|
|
|
2, 3, 4, 5, 10, 11, 12, 13, 18, 19, 20, 21, 26, 27, 28, 29, 34, 35, 36, 37, 42, 43, 44, 45, 50, 51, 52, 53, 58, 59, 60, 61, 66, 67, 68, 69, 74, 75, 76, 77, 82, 83, 84, 85, 90, 91, 92, 93, 98, 99, 100, 101, 106, 107, 108, 109, 114, 115, 116, 117, 122, 123
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
For n > 2, a(n) is the decimal value that results from the conversion of n-1 to binary whose last two bits are altered by either of the following rules: 00->010, 01->011, 10->100, 11->101. For example a(10) = 19 because 10 - 1 = 9 = '10'01'->'10'011' = 19. - Franck Maminirina Ramaharo, Jul 25 2018
|
|
LINKS
|
|
|
FORMULA
|
G.f.: x*(2+x+x^2+x^3+3*x^4)/((1+x)*(1-x)^2*(1+x^2)). [Bruno Berselli, Jul 17 2012]
a(n) = 2*n-1-i^(n*(n+1))-(1+(-1)^n)/2, where i=sqrt(-1). [Bruno Berselli, Jul 17 2012]
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
E.g.f.: 3 + sin(x) - cos(x) + (2*x - 1)*sinh(x) + 2*(x - 1)*cosh(x). - Ilya Gutkovskiy, Jun 02 2016
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/16 - (sqrt(2)+3)*log(2)/8 + sqrt(2)*log(sqrt(2)+2)/4. - Amiram Eldar, Dec 25 2021
|
|
MAPLE
|
|
|
MATHEMATICA
|
Select[Range[120], MemberQ[{2, 3, 4, 5}, Mod[#, 8]] &] (* or *) LinearRecurrence[{1, 0, 0, 1, -1}, {2, 3, 4, 5, 10}, 60] (* Bruno Berselli, Jul 17 2012 *)
|
|
PROG
|
(Magma) [n: n in [1..120] | n mod 8 in [2..5]]; // Bruno Berselli, Jul 17 2012
(Maxima) makelist(2*n-1-%i^(n*(n+1))-(1+(-1)^n)/2, n, 1, 60); /* Bruno Berselli, Jul 17 2012 */
(PARI) Vec((2+x+x^2+x^3+3*x^4)/((1+x)*(1-x)^2*(1+x^2))+O(x^60)) \\ Bruno Berselli, Jul 17 2012
(GAP) Filtered([1..130], n->n mod 8=2 or n mod 8=3 or n mod 8=4 or n mod 8=5); # Muniru A Asiru, Jul 27 2018
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|