[go: up one dir, main page]

login
Search: a047247 -id:a047247
     Sort: relevance | references | number | modified | created      Format: long | short | data
Permutation of the nonnegative integers: lodumo_4 of A047247.
+20
1
2, 3, 0, 1, 4, 5, 6, 7, 10, 11, 8, 9, 12, 13, 14, 15, 18, 19, 16, 17, 20, 21, 22, 23, 26, 27, 24, 25, 28, 29, 30, 31, 34, 35, 32, 33, 36, 37, 38, 39, 42, 43, 40, 41, 44, 45, 46, 47, 50, 51, 48, 49, 52, 53, 54, 55, 58, 59, 56, 57, 60, 61, 62, 63, 66, 67, 64
OFFSET
0,1
COMMENTS
Write n in base 8, then apply the following substitution to the rightmost digit: '0'->'2, '1'->'3', and vice versa. Convert back to decimal.
A self-inverse permutation: a(a(n)) = n.
Array whose columns are, in this order, A047463, A047621, A047451 and A047522, read by rows.
FORMULA
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - 2*a(n-4) + 2*a(n-5) - 2*a(n-6) + 2*a(n-7) - a(n-8), n > 7.
a(n) = (4*(floor(((2*n + 4) mod 8)/4) - floor(((n + 2) mod 8)/4)) + 2*n)/2.
a(n) = lod_4(A047247(n+1)).
a(4*n) = A047463(n+1).
a(4*n+1) = A047621(n+1).
a(4*n+2) = A047451(n+1).
a(4*n+3) = A047522(n+1).
a(A042948(n)) = A047596(n+1).
a(A042964(n+1)) = A047551(n+1).
G.f.: (x^7 + x^5 + 3*x^3 - 2*x^2 - x + 2)/((x-1)^2 * (x^2+1) * (x^4+1)).
E.g.f.: x*exp(x) + cos(x) + sin(x) + cos(x/sqrt(2))*cosh(x/sqrt(2)) + (sqrt(2)*cos(x/sqrt(2)) - sin(x/sqrt(2)))*sinh(x/sqrt(2)).
a(n+8) = a(n) + 8 . - Philippe Deléham, Mar 09 2023
Sum_{n>=3} (-1)^(n+1)/a(n) = 1/6 + log(2). - Amiram Eldar, Mar 12 2023
EXAMPLE
a(25) = a('3'1') = '3'3' = 27.
a(26) = a('3'2') = '3'0' = 24.
a(27) = a('3'3') = '3'1' = 25.
a(28) = a('3'4') = '3'4' = 28.
a(29) = a('3'5') = '3'5' = 29.
The sequence as array read by rows:
2, 3, 0, 1;
4, 5, 6, 7;
10, 11, 8, 9;
12, 13, 14, 15;
18, 19, 16, 17;
20, 21, 22, 23;
26, 27, 24, 25;
28, 29, 30, 31;
...
MATHEMATICA
Table[(4*(Floor[1/4 Mod[2*n + 4, 8]] - Floor[1/4 Mod[n + 2, 8]]) + 2*n)/2, {n, 0, 100}]
f[n_] := Block[{id = IntegerDigits[n, 8]}, FromDigits[ Join[Most@ id /. {{} -> {0}}, {id[[-1]] /. {0 -> 2, 1 -> 3, 2 -> 0, 3 -> 1}}], 8]]; Array[f, 67, 0] (* or *)
CoefficientList[ Series[(x^7 + x^5 + 3x^3 - 2x^2 - x + 2)/((x - 1)^2 (x^6 + x^4 + x^2 + 1)), {x, 0, 70}], x] (* or *)
LinearRecurrence[{2, -2, 2, -2, 2, -2, 2, -1}, {2, 3, 0, 1, 4, 5, 6, 7}, 70] (* Robert G. Wilson v, Aug 01 2018 *)
PROG
(Maxima) makelist((4*(floor(mod(2*n + 4, 8)/4) - floor(mod(n + 2, 8)/4)) + 2*n)/2, n, 0, 100);
(PARI) my(x='x+O('x^100)); Vec((x^7+x^5+3*x^3-2*x^2-x+2)/((1-x)^2*(x^6+x^4+ x^2+1))) \\ G. C. Greubel, Sep 25 2018
(Magma) m:=100; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((x^7+x^5+3*x^3-2*x^2-x+2)/((1-x)^2*(x^6+x^4+ x^2+1)))); // G. C. Greubel, Sep 25 2018
KEYWORD
nonn,easy,base
AUTHOR
STATUS
approved
Numbers that are congruent to {4, 5} mod 6.
+10
10
4, 5, 10, 11, 16, 17, 22, 23, 28, 29, 34, 35, 40, 41, 46, 47, 52, 53, 58, 59, 64, 65, 70, 71, 76, 77, 82, 83, 88, 89, 94, 95, 100, 101, 106, 107, 112, 113, 118, 119, 124, 125, 130, 131, 136, 137, 142, 143, 148, 149
OFFSET
1,1
COMMENTS
Equivalently, numbers m such that 2^m - m is divisible by 3. Indeed, for every prime p, there are infinitely many numbers m such that 2^m - m (A000325) is divisible by p, here are numbers m corresponding to p = 3. - Bernard Schott, Dec 10 2021
Numbers k for which A276076(k) and A276086(k) are multiples of nine. For a simple proof, consider the penultimate digit in the factorial and primorial base expansions of n, A007623 and A049345. - Antti Karttunen, Feb 08 2024
REFERENCES
Michael Doob, The Canadian Mathematical Olympiad & L'Olympiade Mathématique du Canada 1969-1993, Canadian Mathematical Society & Société Mathématique du Canada, Problem 4, 1983, page 158, 1993.
LINKS
The IMO Compendium, Problem 4, 15th Canadian Mathematical Olympiad 1983.
FORMULA
a(n) = 4 + 6*floor(n/2) + n mod 2.
a(n) = 6*n-a(n-1)-3, with a(1)=4. - Vincenzo Librandi, Aug 05 2010
G.f.: ( x*(4+x+x^2) ) / ( (1+x)*(x-1)^2 ). - R. J. Mathar, Oct 08 2011
a(n) = 3*n - (-1)^n. - Wesley Ivan Hurt, Mar 20 2015
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/(6*sqrt(3)) - log(2)/3. - Amiram Eldar, Dec 14 2021
E.g.f.: 1 + 3*x*exp(x) - exp(-x). - David Lovler, Aug 25 2022
MATHEMATICA
Select[Range@ 150, 4 <= Mod[#, 6] <= 5 &] (* Michael De Vlieger, Mar 20 2015 *)
LinearRecurrence[{1, 1, -1}, {4, 5, 10}, 50] (* Harvey P. Dale, Oct 16 2017 *)
PROG
(Maxima) A047257(n):=4 + 6*floor(n/2) + mod(n, 2)$ akelist(A047257(n), n, 0, 40); /* Martin Ettl, Oct 24 2012 */
(PARI) a(n) = 3*n - (-1)^n \\ David Lovler, Aug 25 2022
CROSSREFS
Cf. A000325.
Similar with: A299174 (p = 2), this sequence (p = 3), A349767 (p = 5).
KEYWORD
nonn,easy
STATUS
approved
Numbers that are congruent to {1, 2, 3, 4} mod 6.
+10
5
1, 2, 3, 4, 7, 8, 9, 10, 13, 14, 15, 16, 19, 20, 21, 22, 25, 26, 27, 28, 31, 32, 33, 34, 37, 38, 39, 40, 43, 44, 45, 46, 49, 50, 51, 52, 55, 56, 57, 58, 61, 62, 63, 64, 67, 68, 69, 70, 73, 74, 75, 76, 79, 80, 81, 82, 85, 86, 87, 88, 91, 92, 93, 94, 97, 98
OFFSET
1,2
COMMENTS
a(k)^m is a term for k and m in N. - Jerzy R Borysowicz, Apr 18 2023
FORMULA
From Johannes W. Meijer, Jul 07 2011: (Start)
a(n) = floor((n+2)/4) + floor((n+1)/4) + floor(n/4) + 2*floor((n-1)/4) + floor((n+3)/4).
G.f.: x*(1 + x + x^2 + x^3 + 2*x^4)/(x^5 - x^4 - x + 1). (End)
From Wesley Ivan Hurt, May 20 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
a(n) = (6n - 5 - i^(2n) + (1+i)*i^(1-n) + (1-i)*i^(n-1))/4 where i=sqrt(-1).
a(2n) = A047235(n), a(2n-1) = A047241(n). (End)
E.g.f.: (4 + sin(x) - cos(x) + (3*x - 2)*sinh(x) + 3*(x - 1)*cosh(x))/2. - Ilya Gutkovskiy, May 21 2016
From Wesley Ivan Hurt, May 21 2016: (Start)
a(n) = A047246(n) + 1.
a(n+2) - a(n+1) = A093148(n) for n>0.
a(1-n) = - A047247(n). (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = sqrt(3)*Pi/12 + 2*log(2)/3 - log(3)/4. - Amiram Eldar, Dec 17 2021
MAPLE
A047227:=n->(6*n-5-I^(2*n)+(1+I)*I^(1-n)+(1-I)*I^(n-1))/4: seq(A047227(n), n=1..100); # Wesley Ivan Hurt, May 20 2016
MATHEMATICA
Complement[Range[100], Flatten[Table[{6n - 1, 6n}, {n, 0, 15}]]] (* Alonso del Arte, Jul 07 2011 *)
Select[Range[100], MemberQ[{1, 2, 3, 4}, Mod[#, 6]]&] (* Vincenzo Librandi, Jan 06 2013 *)
PROG
(Magma) [n: n in [0..100] | n mod 6 in [1..4]]; // Vincenzo Librandi, Jan 06 2013
(PARI) a(n)=([0, 1, 0, 0, 0; 0, 0, 1, 0, 0; 0, 0, 0, 1, 0; 0, 0, 0, 0, 1; -1, 1, 0, 0, 1]^(n-1)*[1; 2; 3; 4; 7])[1, 1] \\ Charles R Greathouse IV, May 03 2023
CROSSREFS
Complement of A047264. Equals A203016 divided by 3.
KEYWORD
nonn,easy
STATUS
approved
a(2n-1) = prime(n+2)-3, a(2n) = prime(n+2)-2.
+10
2
2, 3, 4, 5, 8, 9, 10, 11, 14, 15, 16, 17, 20, 21, 26, 27, 28, 29, 34, 35, 38, 39, 40, 41, 44, 45, 50, 51, 56, 57, 58, 59, 64, 65, 68, 69, 70, 71, 76, 77, 80, 81, 86, 87, 94, 95, 98, 99, 100, 101, 104, 105, 106, 107, 110, 111, 124, 125, 128, 129, 134, 135, 136, 137, 146
OFFSET
1,1
LINKS
FORMULA
a(n) ~ 0.5 n log n. - Charles R Greathouse IV, May 25 2011
EXAMPLE
a(1)=5-3=2; a(2)=5-2=3; a(3)=7-3=4.
MATHEMATICA
Table[If[OddQ[n], Prime[(n+1)/2+2]-3, Prime[n/2+2]-2], {n, 70}] (* Harvey P. Dale, Oct 25 2020 *)
PROG
(PARI) forprime(p=5, 97, print1(p-3", "p-2", ")) \\ Charles R Greathouse IV, May 25 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Entries checked by R. J. Mathar, Apr 14 2010
Definition reworded by N. J. A. Sloane, Aug 24 2012
STATUS
approved

Search completed in 0.005 seconds