login
Numbers that are congruent to {1, 3, 7} mod 8.
12

%I #46 Jun 06 2024 08:23:42

%S 1,3,7,9,11,15,17,19,23,25,27,31,33,35,39,41,43,47,49,51,55,57,59,63,

%T 65,67,71,73,75,79,81,83,87,89,91,95,97,99,103,105,107,111,113,115,

%U 119,121,123,127,129,131,135,137,139,143,145,147,151,153,155,159

%N Numbers that are congruent to {1, 3, 7} mod 8.

%C Terms that occur on the first two rows of array A257852. Odd numbers that are not of the form 4k+1, where k is an odd number. - _Antti Karttunen_, Jun 06 2024

%H Colin Barker, <a href="/A047529/b047529.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,1,-1).

%F a(n) = (24*n+2*sqrt(3)*sin(2*Pi*n/3)+6*cos(2*Pi*n/3)-15)/9. - _Fred Daniel Kline_, Nov 12 2015

%F From _Colin Barker_, Nov 12 2015: (Start)

%F a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.

%F G.f.: x*(x^3+4*x^2+2*x+1) / ((x-1)^2*(x^2+x+1)). (End)

%F a(n+3) = a(n) + 8 for all n in Z. - _Michael Somos_, Nov 15 2015

%F a(3k) = 8k-1, a(3k-1) = 8k-5, a(3k-2) = 8k-7. - _Wesley Ivan Hurt_, Jun 13 2016

%F a(n) = 8 * floor((n-1) / 3) + 2^(((n-1) mod 3) + 1) - 1. - _Fred Daniel Kline_, Aug 09 2016

%F a(n) = 2*(n + floor(n/3)) - 1. - _Wolfdieter Lang_, Sep 10 2021

%e G.f. = x + 3*x^2 + 7*x^3 + 9*x^4 + 11*x^5 + 15*x^6 + 17*x^7 + 19*x^8 + 23*x^9 + ...

%p A047529:=n->(24*n+2*sqrt(3)*sin(2*Pi*n/3)+6*cos(2*Pi*n/3)-15)/9: seq(A047529(n), n=1..100); # _Wesley Ivan Hurt_, Jun 13 2016

%t Select[Range[150], MemberQ[{1,3,7}, Mod[#,8]]&] (* _Harvey P. Dale_, May 02 2011 *)

%t LinearRecurrence[{1, 0, 1, -1}, {1, 3, 7, 9}, 100] (* _Vincenzo Librandi_, Jun 14 2016 *)

%o (PARI) Vec(x*(x^3+4*x^2+2*x+1)/((x-1)^2*(x^2+x+1)) + O(x^100)) \\ _Colin Barker_, Nov 12 2015

%o (PARI) {a(n) = n\3 * 8 + [-1, 1, 3][n%3 + 1]}; /* _Michael Somos_, Nov 15 2015 */

%o (Magma) [n : n in [0..150] | n mod 8 in [1, 3, 7]]; // _Wesley Ivan Hurt_, Jun 13 2016

%Y Cf. A047478, A047484, A047623.

%Y Setwise difference A005408 \ A004770.

%Y Disjoint union of A004767 and A017077; see A257852.

%K nonn,easy

%O 1,2

%A _N. J. A. Sloane_