cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 10 results.

A006368 The "amusical permutation" of the nonnegative numbers: a(2n)=3n, a(4n+1)=3n+1, a(4n-1)=3n-1.

Original entry on oeis.org

0, 1, 3, 2, 6, 4, 9, 5, 12, 7, 15, 8, 18, 10, 21, 11, 24, 13, 27, 14, 30, 16, 33, 17, 36, 19, 39, 20, 42, 22, 45, 23, 48, 25, 51, 26, 54, 28, 57, 29, 60, 31, 63, 32, 66, 34, 69, 35, 72, 37, 75, 38, 78, 40, 81, 41, 84, 43, 87, 44, 90, 46, 93, 47, 96, 49, 99, 50, 102, 52, 105, 53
Offset: 0

Views

Author

Keywords

Comments

A permutation of the nonnegative integers.
There is a famous open question concerning the closed trajectories under this map - see A217218, A028393, A028394, and Conway (2013).
This is lodumo_3 of A131743. - Philippe Deléham, Oct 24 2011
Multiples of 3 interspersed with numbers other than multiples of 3. - Harvey P. Dale, Dec 16 2011
For n>0: a(2n+1) is the smallest number missing from {a(0),...,a(2n-1)} and a(2n) = a(2n-1) + a(2n+1). - Bob Selcoe, May 24 2017
From Wolfdieter Lang, Sep 21 2021: (Start)
The permutation P of positive natural numbers with P(n) = a(n-1) + 1, for n >= 1, is the inverse of the permutation given in A265667, and it maps the index n of A178414 to the index of A047529: A178414(n) = A047529(P(n)).
Thus each number {1, 3, 7} (mod 8) appears in the first column A178414 of the array A178415 just once. For the formulas see below. (End)
Starting at n = 1, the sequence equals the smallest unused positive number such that a(n)-a(n-1) does not appear as a term in the current sequence. - Scott R. Shannon, Dec 20 2023

Examples

			9 is odd so a(9) = round(3*9/4) = round(7-1/4) = 7.
		

References

  • J. H. Conway, Unpredictable iterations, in Proc. Number Theory Conf., Boulder, CO, 1972, pp. 49-52.
  • R. K. Guy, Unsolved Problems in Number Theory, E17.
  • J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010; see page 5.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a006368 n | u' == 0   = 3 * u
              | otherwise = 3 * v + (v' + 1) `div` 2
              where (u,u') = divMod n 2; (v,v') = divMod n 4
    -- Reinhard Zumkeller, Apr 18 2012
    
  • Magma
    [n mod 2 eq 1 select Round(3*n/4) else 3*n/2: n in [0..80]]; // G. C. Greubel, Jan 03 2024
  • Maple
    f:=n-> if n mod 2 = 0 then 3*n/2 elif n mod 4 = 1 then (3*n+1)/4 else (3*n-1)/4; fi; # N. J. A. Sloane, Jan 21 2011
    A006368:=(1+3*z+z**2+3*z**3+z**4)/(1+z**2)/(z-1)**2/(1+z)**2; # [Conjectured (correctly, except for the offset) by Simon Plouffe in his 1992 dissertation.]
  • Mathematica
    Table[If[EvenQ[n],(3n)/2,Floor[(3n+2)/4]],{n,0,80}] (* or *) LinearRecurrence[ {0,1,0,1,0,-1},{0,1,3,2,6,4},80] (* Harvey P. Dale, Dec 16 2011 *)
  • PARI
    a(n)=(3*n+n%2)\(2+n%2*2)
    
  • PARI
    a(n)=if(n%2,round(3*n/4),3*n/2)
    
  • Python
    def a(n): return 0 if n == 0 else 3*n//2 if n%2 == 0 else (3*n+1)//4
    print([a(n) for n in range(72)]) # Michael S. Branicky, Aug 12 2021
    

Formula

If n even, then a(n) = 3*n/2, otherwise, a(n) = round(3*n/4).
G.f.: x*(1+3*x+x^2+3*x^3+x^4)/((1-x^2)*(1-x^4)). - Michael Somos, Jul 23 2002
a(n) = -a(-n).
From Reinhard Zumkeller, Nov 20 2009: (Start)
a(n) = A006369(n) - A168223(n).
A168221(n) = a(a(n)).
A168222(a(n)) = A006369(n). (End)
a(n) = a(n-2) + a(n-4) - a(n-6); a(0)=0, a(1)=1, a(2)=3, a(3)=2, a(4)=6, a(5)=4. - Harvey P. Dale, Dec 16 2011
From Wolfdieter Lang, Sep 21 2021: (Start)
Formulas for the permutation P(n) = a(n-1) + 1 mentioned above:
P(n) = n + floor(n/2) if n is odd, and n - floor(n/4) if n is even.
P(n) = (3*n-1)/2 if n is odd; P(n) = (3*n+2)/4 if n == 2 (mod 4); and P(n) = 3*n/4 if n == 0 (mod 4). (End)

Extensions

Edited by Michael Somos, Jul 23 2002
I replaced the definition with the original definition of Conway and Guy. - N. J. A. Sloane, Oct 03 2012

A006369 a(n) = 2*n/3 for n divisible by 3, otherwise a(n) = round(4*n/3). Or, equivalently, a(3*n-2) = 4*n-3, a(3*n-1) = 4*n-1, a(3*n) = 2*n.

Original entry on oeis.org

0, 1, 3, 2, 5, 7, 4, 9, 11, 6, 13, 15, 8, 17, 19, 10, 21, 23, 12, 25, 27, 14, 29, 31, 16, 33, 35, 18, 37, 39, 20, 41, 43, 22, 45, 47, 24, 49, 51, 26, 53, 55, 28, 57, 59, 30, 61, 63, 32, 65, 67, 34, 69, 71, 36, 73, 75, 38, 77, 79, 40, 81, 83, 42, 85, 87, 44, 89, 91, 46, 93, 95
Offset: 0

Views

Author

Keywords

Comments

Original name was: Nearest integer to 4n/3 unless that is an integer, when 2n/3.
This function was studied by Lothar Collatz in 1932.
Fibonacci numbers lodumo_2. - Philippe Deléham, Apr 26 2009
a(n) = A006368(n) + A168223(n); A168222(n) = a(a(n)); A168221(a(n)) = A006368(n). - Reinhard Zumkeller, Nov 20 2009
The permutation P given in A265667 is P(n) = a(n-1) + 1, for n >= 0, with a(-1) = -1. Observed by Kevin Ryde. - Wolfdieter Lang, Sep 22 2021

Examples

			G.f. = x + 3*x^2 + 2*x^3 + 5*x^4 + 7*x^5 + 4*x^6 + 9*x^7 + 11*x^8 + 6*x^9 + ...
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, E17.
  • M. Klamkin, ed., Problems in Applied Mathematics: Selections from SIAM Review, SIAM, 1990; see pp. 579-581.
  • K. Knopp, Infinite Sequences and Series, Dover Publications, NY, 1958, p. 77.
  • J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010; see page 31 (g(n)) and page 270 (f(n)).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a006369 n | m > 0     = round (4 * fromIntegral n / 3)
              | otherwise = 2 * n' where (n',m) = divMod n 3
    -- Reinhard Zumkeller, Dec 31 2011
  • Maple
    A006369 := proc(n) if n mod 3 = 0 then 2*n/3 else round(4*n/3); fi; end;
    f:=proc(N) if N mod 3 = 0 then 2*(N/3); elif N mod 3 = 2 then 4*((N+1)/3)-1; else 4*((N+2)/3)-3; fi; end; # N. J. A. Sloane, Feb 04 2011
    A006369:=(1+z**2)*(z**2+3*z+1)/(z-1)**2/(z**2+z+1)**2; # Simon Plouffe, in his 1992 dissertation
  • Mathematica
    Table[If[Divisible[n,3],(2n)/3,Floor[(4n)/3+1/2]],{n,0,80}] (* Harvey P. Dale, Nov 03 2011 *)
    Table[n + Floor[(n + 1)/3] (-1)^Mod[n + 1, 3], {n, 0, 80}] (* Bruno Berselli, Dec 10 2015 *)
  • PARI
    {a(n) = if( n%3, round(4*n / 3), 2*n / 3)}; /* Michael Somos, Oct 05 2003 */
    

Formula

From Michael Somos, Oct 05 2003: (Start)
G.f.: x * (1 + 3*x + 2*x^2 + 3*x^3 + x^4) / (1 - x^3)^2.
a(3*n) = 2*n, a(3*n + 1) = 4*n + 1, a(3*n - 1) = 4*n - 1, a(n) = -a(-n) for all n in Z. (End)
The map is: n -> if n mod 3 = 0 then 2*n/3 elif n mod 3 = 1 then (4*n-1)/3 else (4*n+1)/3.
a(n) = (2 - ((2*n + 1) mod 3) mod 2) * floor((2*n + 1)/3) + (2*n + 1) mod 3 - 1. - Reinhard Zumkeller, Jan 23 2005
a(n) = lod_2(F(n)). - Philippe Deléham, Apr 26 2009
0 = 21 + a(n)*(18 + 4*a(n) - a(n+1) - 7*a(n+2)) + a(n+1)*(-a(n+2)) + a(n+2)*(-18 + 4*a(n+2)) for all n in Z. - Michael Somos, Aug 24 2014
a(n) = n + floor((n+1)/3)*(-1)^((n+1) mod 3). - Bruno Berselli, Dec 10 2015
a(n) = 2*a(n-3) - a(n-6) for n >= 6. - Werner Schulte, Mar 16 2021
Sum_{n>=1} (-1)^(n+1)/a(n) = log(sqrt(2)+2)/sqrt(2) + (1-sqrt(2)/2)*log(2)/2. - Amiram Eldar, Sep 29 2022

Extensions

New name from Jon E. Schoenfield, Jul 28 2015

A347834 An array A of the positive odd numbers, read by antidiagonals upwards, giving the present triangle T.

Original entry on oeis.org

1, 3, 5, 7, 13, 21, 9, 29, 53, 85, 11, 37, 117, 213, 341, 15, 45, 149, 469, 853, 1365, 17, 61, 181, 597, 1877, 3413, 5461, 19, 69, 245, 725, 2389, 7509, 13653, 21845, 23, 77, 277, 981, 2901, 9557, 30037, 54613, 87381, 25, 93, 309, 1109, 3925, 11605, 38229, 120149, 218453, 349525
Offset: 1

Views

Author

Wolfdieter Lang, Sep 20 2021

Keywords

Comments

For the definition of this array A see the formula section.
The rows of A appear in a draft by Immmo O. Kerner in eqs. (1) and (2) as so-called horizontal sequences (horizontale Folgen). Thanks to Dr. A. Eckert for sending me this paper.
This array with entry A(k, n) becomes equal to the array T with T(n, k) given in A178415 by using a permutation of the rows, and changing the offset: A(k, n) = T(pe(k), n+1), with pe(3*(L+1)) = 4*(L+1), pe(1+3*L) = 1 + 2*L, pe(2+3*L) = 2*(1 + 2*L), for L >= 0. This permutation appears in A265667.
A proper sub-array is A238475(n, k) = A(1 + 3*(k-1), n-1), for k >= 1 and n >= 1.
In the directed Collatz tree with nodes labeled with only positive odd numbers (see A256598 for the paths), here called CTodd, the level L = 0 (on the top) has the node with label 1 as root. Because 1 -> 1 there is an arrow (a 1-cycle or loop) at the root. The level L = 1 consists of the nodes with labels A(1, n), for n >= 1, and each node is connected to 1 by a downwards directed arrow. The next levels for L >= 2 are obtained using the successor rule (used also by Kerner): S(u) = (4*u - 1)/3 if u == 1 (mod 3), (2*u - 1)/3 if u == 5 (mod 3), and there is no successor S(u) = empty if u = 3 (mod 6), that is, this node is a leaf.
However, each node with label u on level L >= 1, except a leaf, has as successors at level L + 1 not only the node with S(u) but all the nodes with labels A(S(u), n), for n >= 0.
In this way each node (also the root) of this CTodd has in-degree 1 and infinite out-degree (for L >= 2 there are infinitely many infinite outgoing arrows). All nodes with label A(k, n) with n >= 1, have the same precursor as the node A(k,0) in this tree for each k >= 1.
Except for the loop (1-cycle) for the root 1 there are no cycles in this directed tree CTodd.
That each number N = 5 + 8*K, for K >= 0 appears in array A for some column n >= 1 uniquely can be proved, using the fact of strictly increasing rows and columns, by showing that the columns n = 1, 2, ..., c contain all positive integers congruent to 5 modulo 8 except those of the positive congruence class A(1, c+1) modulo 2^(2*c+3) by induction on c. [added Dec 05 2021]
Row index k for numbers congruent to 5 modulo 8: Each number N = 5 + 8*K, for K >= 0, from A004770 is a member of row k of the array A starting with element A(k, 0) = (2*A065883(2 + 3*N) - 1)/3. For this surjective map see A347840. [simplified Dec 05 2021]
The Collatz conjecture can be reduced to the conjecture that in this rooted and directed tree CTodd each positive odd number appears as a label once, that is, all entries of the array A appear.

Examples

			The array A(k, n) begins:
k\n  0   1   2    3    4     5      6      7       8       9       10 ...
-------------------------------------------------------------------------
1:   1   5  21   85  341  1365   5461  21845   87381  349525  1398101
2:   3  13  53  213  853  3413  13653  54613  218453  873813  3495253
3:   7  29 117  469 1877  7509  30037 120149  480597 1922389  7689557
4:   9  37 149  597 2389  9557  38229 152917  611669 2446677  9786709
5:  11  45 181  725 2901 11605  46421 185685  742741 2970965 11883861
6:  15  61 245  981 3925 15701  62805 251221 1004885 4019541 16078165
7:  17  69 277 1109 4437 17749  70997 283989 1135957 4543829 18175317
8:  19  77 309 1237 4949 19797  79189 316757 1267029 5068117 20272469
9:  23  93 373 1493 5973 23893  95573 382293 1529173 6116693 24466773
10: 25 101 405 1621 6485 25941 103765 415061 1660245 6640981 26563925
...
--------------------------------------------------------------------
The triangle T(k, n) begins:
k\n  0  1   2    3    4     5     6      7      8      9 ...
------------------------------------------------------------
1:   1
2:   3  5
3:   7 13  21
4:   9 29  53   85
5:  11 37 117  213  341
6:  15 45 149  469 853   1365
7:  17 61 181  597 1877  3413  5461
8:  19 69 245  725 2389  7509 13653  21845
9:  23 77 277  981 2901  9557 30037  54613  87381
10: 25 93 309 1109 3925 11605 38229 120149 218453 349525
...
-------------------------------------------------------------
Row index k of array A, for entries 5 (mod 8).
213 = 5 + 8*26. K = 28 is even, (3*231+1)/16 = 40, A065883(40) = 10, hence A(k, 0) = N' = (10-1)/3 = 3, and k = 2. Moreover, n = log_4((3*213 + 1)/(3*A(2,0) + 1)) = log_4(64) = 3. 213 = A(2, 3).
85 = 5 + 8*10. K = 10 is even, (3*85 + 1)/16 = 16, A065883(16) = 1, N' = (1-1)/3 = 0 is even, hence A(k, 0) = 4*0 + 1 = 1, k = 1. 85 = A(1, 3).
61 = 5 + 8*7, K = 7 is odd, k = (7+1)/2 + ceiling((7+1)/4) = 6, and n = log_4((3*61 + 1)/(3*A(6,0) + 1)) = 1. 61 = A(6, 1).
----------------------------------------------------------------------------
		

Crossrefs

Row sequences of the array A, also diagonal sequences of the triangle T: -A007583 (k=0), A002450(n+1), A072197, A072261(n+1), A206374(n+1), A072262(n+1), A072262(n+1), A072201(n+1), A330246(n+1), ...
Column sequences of the array A, also of the triangle T (shifted): A047529, A347836, A347837, ...

Programs

  • Maple
    # Seen as an array:
    A := (n, k) -> ((3*(n + floor(n/3)) - 1)*4^(k+1) - 2)/6:
    for n from 1 to 6 do seq(A(n, k), k = 0..9) od;
    # Seen as a triangle:
    T := (n, k) -> 2^(2*k + 1)*(floor((n - k)/3) - k + n - 1/3) - 1/3:
    for n from 1 to 9 do seq(T(n, k), k = 0..n-1) od;
    # Using row expansion:
    gf_row := k -> (1 / (x - 1) - A047395(k)) / (4*x - 1):
    for k from 1 to 10 do seq(coeff(series(gf_row(k), x, 11), x, n), n = 0..10) od;
    # Peter Luschny, Oct 09 2021
  • Mathematica
    A347834[k_, n_] := (4^n*(6*(Floor[k/3] + k) - 2) - 1)/3;
    Table[A347834[k - n, n], {k, 10}, {n, 0, k - 1}] (* Paolo Xausa, Jun 26 2025 *)

Formula

Array A:
A(k, 0) = A047529(k) (the positive odd numbers {1, 3, 7} (mod 8));
A(k, n) = ((3* A(k, 0) + 1)*4^n - 1)/3, for k >= 1 and n >= 0.
Recurrence for rows k >= 1: A(k, n) = 4*A(k, n-1) + 1, for n >= 1, with A(k, 0) = 2*(k + floor(k/3)) - 1 = A047529(k).
Explicit form: A(k, n) = ((3*(k + floor(k/3)) - 1)*4^(n+1) - 2)/6, k >= 1, n >= 0. Here 3*(k + floor(k/3)) = A319451(k).
Hence A(k, n) = 5 + 8*(2*A(k, n-2)), for n >= 1, with A(k, 0) = 2*(k + floor(k/3)) - 1 = A047529(k), and 2*A(k, -1) = (A(k, 1) - 5)/8 = k - 1 + floor(k/3) (equals index n of A(k, 1) in the sequence (A004770(n+1))_{n >= 0}). A(k, -1) is half-integer if k = A007494(m) = m + ceiling(m/2), for m >= 1, and A(k, -1) = 2*K if k = 1 + 3*K = A016777(K), for K >= 0.
O.g.f.: expansion in z gives o.g.f.s for rows k, also for k = 0: -A007583; expansion in x gives o.g.f.s for columns n.
G(z, x) = (2*(-1 + 3*z + 3*z^2 + 7*z^3)*(1-x) - (1-4*x)*(1-z^3)) / (3*(1-x)*(1-4*x)*(1-z)*(1-z^3)).
Triangle T:
T(k, n) = A(k - n, n), for k >= 1 and n = 0..k-1.
A(k, n) = [x^n] (1/(x - 1) - A047395(k)) / (4*x - 1). - Peter Luschny, Oct 09 2021

A265734 Permutation of nonnegative integers: a(n) = n + floor(n/5)*(-1)^(n mod 5).

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 5, 8, 7, 10, 12, 9, 14, 11, 16, 18, 13, 20, 15, 22, 24, 17, 26, 19, 28, 30, 21, 32, 23, 34, 36, 25, 38, 27, 40, 42, 29, 44, 31, 46, 48, 33, 50, 35, 52, 54, 37, 56, 39, 58, 60, 41, 62, 43, 64, 66, 45, 68, 47, 70, 72, 49, 74, 51, 76, 78, 53, 80
Offset: 0

Views

Author

Bruno Berselli, Dec 15 2015 - based on an idea by Paul Curtz

Keywords

Examples

			------------------------------------------------------------------------
0, 1, 2, 3, 4, 5,  6, 7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, ...
+  +  +  +  +  +   +  +   +   +   +   +   +   +   +   +   +   +   +
0, 0, 0, 0, 0, 1, -1, 1, -1,  1,  2, -2,  2, -2,  2,  3, -3,  3, -3, ...
------------------------------------------------------------------------
0, 1, 2, 3, 4, 6,  5, 8,  7, 10, 12,  9, 14, 11, 16, 18, 13, 20, 15, ...
------------------------------------------------------------------------
		

Crossrefs

Cf. A001477.
Cf. A064455: n+floor(n/2)*(-1)^(n mod 2).
Cf. A265667: n+floor(n/3)*(-1)^(n mod 3).
Cf. A265888: n+floor(n/4)*(-1)^(n mod 4)

Programs

  • Magma
    [n+Floor(n/5)*(-1)^(n mod 5): n in [0..80]];
  • Mathematica
    Table[n + Floor[n/5] (-1)^Mod[n, 5], {n, 0, 80}]
  • Sage
    [n+floor(n/5)*(-1)^mod(n, 5) for n in (0..80)]
    

Formula

G.f.: x*(1 + 2*x + 3*x^2 + 4*x^3 + 6*x^4 + 3*x^5 + 4*x^6 + x^7 + 2*x^8) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4)^2).
a(n) = 2*a(n-5) - a(n-10).
a(5*k+r) = (5+(-1)^r)*k + r, where r=0..4.
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi*(1/(2*sqrt(2))-1/(3*sqrt(3))) + log(2)/6. - Amiram Eldar, Mar 30 2023

A265888 a(n) = n + floor(n/4)*(-1)^(n mod 4).

Original entry on oeis.org

0, 1, 2, 3, 5, 4, 7, 6, 10, 7, 12, 9, 15, 10, 17, 12, 20, 13, 22, 15, 25, 16, 27, 18, 30, 19, 32, 21, 35, 22, 37, 24, 40, 25, 42, 27, 45, 28, 47, 30, 50, 31, 52, 33, 55, 34, 57, 36, 60, 37, 62, 39, 65, 40, 67, 42, 70, 43, 72, 45, 75, 46, 77, 48, 80, 49, 82, 51, 85, 52, 87
Offset: 0

Views

Author

Bruno Berselli, Dec 18 2015

Keywords

Comments

This sequence does not include the numbers of the type 3*A047202(n)+2.
a(n) = n + floor(n/4)*(-1)^(n mod 2). - Chai Wah Wu, Jan 29 2023

Crossrefs

Cf. A064455: n+floor(n/2)*(-1)^(n mod 2).
Cf. A265667: n+floor(n/3)*(-1)^(n mod 3).
Cf. A265734: n+floor(n/5)*(-1)^(n mod 5).

Programs

  • Magma
    [n+Floor(n/4)*(-1)^(n mod 4): n in [0..70]];
    
  • Mathematica
    Table[n + Floor[n/4] (-1)^Mod[n, 4], {n, 0, 70}]
    LinearRecurrence[{0, 1, 0, 1, 0, -1}, {0, 1, 2, 3, 5, 4}, 80]
  • PARI
    x='x+O('x^100); concat(0, Vec(x*(1+2*x+2*x^2+3*x^3)/((1+x^2)*(1- x^2)^2))) \\ Altug Alkan, Dec 22 2015
    
  • Python
    def A265888(n): return n+(-(n>>2) if n&1 else n>>2) # Chai Wah Wu, Jan 29 2023
  • Sage
    [n+floor(n/4)*(-1)^mod(n, 4) for n in (0..70)]
    

Formula

G.f.: x*(1 + 2*x + 2*x^2 + 3*x^3)/((1 + x^2)*(1 - x^2)^2).
a(n) = a(n-2) + a(n-4) - a(n-6) for n>5.
a(n+1) + a(n) = A047624(n+1).
a(4*k+r) = (4+(-1)^r)*k + r mod 3, where r = 0..3.

A347836 a(n) = 8*(n + floor(n/3)) - 3; second column of A347834.

Original entry on oeis.org

5, 13, 29, 37, 45, 61, 69, 77, 93, 101, 109, 125, 133, 141, 157, 165, 173, 189, 197, 205, 221, 229, 237, 253, 261, 269, 285, 293, 301, 317, 325, 333, 349, 357, 365, 381, 389, 397, 413, 421, 429, 445, 453, 461, 477, 485, 493
Offset: 1

Views

Author

Wolfdieter Lang, Oct 07 2021

Keywords

Crossrefs

Cf. A047529 (first column), A178415, A265667, A319451, A347834, A347837 (third column).

Programs

  • Maple
    seq(8*(n + floor(n/3)) - 3, n = 1..47); # Peter Luschny, Oct 10 2021
  • Mathematica
    A347836[n_] := 8*(n + Floor[n/3]) - 3; Array[A347836, 50] (* or *)
    LinearRecurrence[{1, 0, 1, -1}, {5, 13, 29, 37}, 50] (* Paolo Xausa, Feb 27 2024 *)

Formula

a(n) = A347834(n, 1) = A178415(A265667(n), 2), for n >= 1.
a(n) = ((3*A047529(n) + 1)*4 - 1)/3 = ((3*(n + floor(n/3)) - 1)*8 - 1)/3 = ((A319451(n) - 1)*8 - 1)/3, for n >= 1.
O.g.f.: G(x) = (-3 + 8*x + 8*x^2 + 19*x^3)/((1 - x)*(1 - x^3)), with a(0) = -3.

A347837 a(n) = 32*(n + floor(n/3)) - 11; third column of A347834.

Original entry on oeis.org

21, 53, 117, 149, 181, 245, 277, 309, 373, 405, 437, 501, 533, 565, 629, 661, 693, 757, 789, 821, 885, 917, 949, 1013, 1045, 1077, 1141, 1173, 1205, 1269, 1301, 1333, 1397, 1429, 1461, 1525, 1557, 1589, 1653, 1685
Offset: 1

Views

Author

Wolfdieter Lang, Oct 07 2021

Keywords

Crossrefs

Cf. A047529 (first column), A178415, A265667, A319451, A347834, A347836 (second column).

Programs

  • Magma
    [32*(n + Floor(n/3)) - 11 : n in [1..60]]; // Wesley Ivan Hurt, Oct 10 2021
  • Maple
    seq(32*(n + floor(n/3)) - 11, n=1..40); # Peter Luschny, Oct 10 2021
  • Mathematica
    A347837[n_] := 32*(n + Floor[n/3]) - 11; Array[A347837, 50] (* or *)
    LinearRecurrence[{1, 0, 1, -1}, {21, 53, 117, 149}, 50] (* Paolo Xausa, Feb 27 2024 *)

Formula

a(n) = A347834(n, 2) = A178415(A265667(n), 3), for n >= 1.
a(n) = ((3*A047529(n) + 1)*16 - 1)/3 = ((3*(n + floor(n/3)) - 1)*32 - 1)/3 = ((A319451(n) - 1)*32 - 1)/3, for n >= 1.
O.g.f.: G(x) = (-11 + 32*x + 32*x^2 + 75*x^3)/((1 - x)*(1 - x^3)), with a(0) = -11.

A265672 a(n) = n + floor((n+1)/7)*(-1)^((n+1) mod 7).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 6, 9, 8, 11, 10, 13, 15, 12, 17, 14, 19, 16, 21, 23, 18, 25, 20, 27, 22, 29, 31, 24, 33, 26, 35, 28, 37, 39, 30, 41, 32, 43, 34, 45, 47, 36, 49, 38, 51, 40, 53, 55, 42, 57, 44, 59, 46, 61, 63, 48, 65, 50, 67, 52, 69, 71, 54, 73, 56, 75
Offset: 0

Views

Author

Paul Curtz, Dec 13 2015

Keywords

Comments

A permutation of A001477. This sequence, without the terms of the form 8*k+5, becomes A265228.
Similar sequences of the type n + floor((n+1)/k)*(-1)^((n+1) mod k):
k = 1: A005408;
k = 2: A014682;
k = 3: A006369 (permutation of A001477);
k = 4: 0, 1, 2, 4, 3, 6, 5, 9, 6, 11, 8, 14, ...;
k = 5: 0, 1, 2, 3, 5, 4, 7, 6, 9, 11, 8, 13, ... (permutation of A001477);
k = 6: 0, 1, 2, 3, 4, 6, 5, 8, 7, 10, 9, 13, ...;
k = 7: this sequence.

Examples

			-------------------------------------------------------------------------
0, 1, 2, 3, 4, 5, 6,  7, 8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, ...
+  +  +  +  +  +  +   +  +   +   +   +   +   +   +   +   +   +   +
0, 0, 0, 0, 0, 0, 1, -1, 1, -1,  1, -1,  1,  2, -2,  2, -2,  2, -2, ...
-------------------------------------------------------------------------
0, 1, 2, 3, 4, 5, 7,  6, 9,  8, 11, 10, 13, 15, 12, 17, 14, 19, 16, ...
-------------------------------------------------------------------------
		

Crossrefs

Programs

  • Magma
    [n+Floor((n+1)/7)*(-1)^((n+1) mod 7): n in [0..80]]; // Bruno Berselli, Dec 26 2015
  • Maple
    A265672:=n->n + floor((n+1)/7)*(-1)^((n+1) mod 7): seq(A265672(n), n=0..100); # Wesley Ivan Hurt, Apr 09 2017
  • Mathematica
    Table[n + Floor[(n + 1)/7] (-1)^Mod[n + 1, 7], {n, 0, 80}] (* Bruno Berselli, Dec 22 2015 *)
  • PARI
    concat(0, Vec(x*(1 +x^2)*(1 +2*x +2*x^2 +2*x^3 +3*x^4 +5*x^5 +3*x^6 +2*x^7 +x^8 +3*x^9 +x^10) / ((1 -x)^2*(1 +x +x^2 +x^3 +x^4 +x^5 +x^6)^2) + O(x^100))) \\ Colin Barker, Dec 13 2015
    

Formula

a(n) = a(n-7) + (-1)^((n+1) mod 7) + 7 for n>6.
From Colin Barker, Dec 13 2015: (Start)
a(n) = 2*a(n-7) - a(n-14) for n>13.
G.f.: x*(1 +x^2)*(1 +2*x +2*x^2 +2*x^3 +3*x^4 +5*x^5 +3*x^6 +2*x^7 +x^8 +3*x^9 +x^10) / ((1 -x)^2*(1 +x +x^2 +x^3 +x^4 +x^5 +x^6)^2). (End)

Extensions

Edited by Bruno Berselli, Dec 22 2015

A267654 Irregular triangle of palindromic subsequences. Every row has 2*n+1 terms. From the second row, there are only two alternated numbers: 2*n+4 and 2*n+2.

Original entry on oeis.org

2, 4, 2, 4, 6, 4, 6, 4, 6, 8, 6, 8, 6, 8, 6, 8, 10, 8, 10, 8, 10, 8, 10, 8, 10, 12, 10, 12, 10, 12, 10, 12, 10, 12, 10, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 16, 14, 16, 14, 16, 14, 16, 14, 16, 14, 16, 14, 16, 14, 16
Offset: 0

Views

Author

Paul Curtz, Jan 19 2016

Keywords

Comments

Row sums = 2, 10, 26, 50, ... = A069894(n).
Starting from A053186(n) =
0, for b(n)
0, 1, 2, for c(n)
0, 1, 2, 3, 4, for d(n)
0, 1, 2, 3, 4, 5, 6,
etc,
a(n) is used for
1) b(n+1) = b(n) + (a(0)=2) i.e. 0, 2, 4, 6, ... = A005843(n).
2) c(n+3) = c(n) + (period 3:repeat 4, 2, 4) i.e. 0, 1, 2, 4, 3, 6, 8, ... = A265667(n).
3) d(n+5) = d(n) + (period 5:repeat 6, 4, 6, 4, 6) i.e. 0, 1, 2, 3, 4, 6, 5, 8, 7, 10, ... = A265734(n).
Etc.
a(n) has a companion with the same terms,differently distributed,yielding permutations of the nonnegative numbers. See A265672.
a(n) other writing (by pairs):
2, 4, 2, 4,
6, 4, 6, 4,
6, 8, 6, 8, 6, 8, 6, 8,
10 8, 10, 8, 10, 8, 10, 8,
10, 12, 10, 12, 10, 12, 10, 12, 10, 12, 10, 12,
14, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 12,
etc.
First column: A168276(n+2). Second column: A168273(n+2).
Row sums: 12, 20, 56, 72, ... = 4*A074378(n+1).
The last term of the successive rows is the number of their terms.
Main diagonal: A005843(n+1).

Examples

			The triangle is
2,
4, 2, 4,
6, 4, 6, 4, 6,
8, 6, 8, 6, 8, 6, 8,
etc.
		

Crossrefs

Programs

  • Mathematica
    Table[2 (n - 1) + 2 (Boole@ OddQ@ k + 1), {n, 0, 7}, {k, 2 n + 1}] // Flatten (* Michael De Vlieger, Jan 19 2016 *)

Formula

a(n) = 2 * A086520(n+2).
a(2n) = 4*n + 2 times 4*n + 2 = 2, 2, 6, 6, 6, 6, 6, 6, 10,....
a(2n+1) = 4*(n+1) times 4*(n+1) = 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 12, ....

A272188 Triangle with 2*n+1 terms per row, read by rows: the first row is 1 (by decree), following rows contain 0 to 2n+1 but omitting 2n.

Original entry on oeis.org

1, 0, 1, 3, 0, 1, 2, 3, 5, 0, 1, 2, 3, 4, 5, 7, 0, 1, 2, 3, 4, 5, 6, 7, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17
Offset: 0

Views

Author

Paul Curtz, Apr 22 2016

Keywords

Comments

Row n is row 2n+1 of A128138, a bisection.
The second bisection by rows
0, 2,
0, 1, 2, 4,
0, 1, 2, 3, 4, 6,
0, 1, 2, 3, 4, 5, 6, 8,
etc
is the basis of
0, 2, 4, 6, 8, 10, 12, ... the even numbers A005843(n)
0, 1, 2, 4, 3, 6, 8, 5, 10, ... a permutation of the nonnegative integers A265667(n).
0, 1, 2, 3, 4, 6, 5, 8, 7, 10, 12, ... a permutation of the nonnegative integers A265734(n)
etc.
A005843(n) - A005843(n-1) = 2, for n>0.
A265667(n) - A265667(n-3) = 4, 2, 4 (period 3), for n>2.
A265734(n) - A265734(n-5) = 6, 4, 6, 4, 6 (period 5), for n>4.
See A267654.
For
1, 3, 5, 7, 9, 11, 13 ... the odd numbers A005408(n),
0, 1, 3, 2, 5, 7, 4, 9, 11, ... a permutation of the nonnegative numbers A006369,
0, 1, 2, 3, 5, 4, 7, 6, 9, 11, 8, 13, 10, 15, ... another permutation,
a(n) must be extended with one term by row:
1, 3,
0, 1, 3, 2,
0, 1, 2, 3, 5, 4,

Examples

			Irregular triangle:
1,
0, 1, 3,
0, 1, 2, 3, 5,
0, 1, 2, 3, 4, 5, 7,
0, 1, 2, 3, 4, 5, 6, 7, 9,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13,
etc.
		

Crossrefs

Programs

  • Mathematica
    Table[Delete[Range[0, 2 n + 1], 2 n + 1], {n, 0, 8}] // Flatten (* Michael De Vlieger, Apr 25 2016 *)
Showing 1-10 of 10 results.