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 11 results. Next

A347840 A surjective map of the positive numbers congruent to 5 modulo 8 (A004770) to the positive numbers congruent to 1, 3, or 7 modulo 8 (A047529).

Original entry on oeis.org

1, 3, 1, 7, 9, 11, 3, 15, 17, 19, 1, 23, 25, 27, 7, 31, 33, 35, 9, 39, 41, 43, 11, 47, 49, 51, 3, 55, 57, 59, 15, 63, 65, 67, 17, 71, 73, 75, 19, 79, 81, 83, 1, 87, 89, 91, 23, 95, 97, 99, 25, 103, 105, 107, 27, 111, 113, 115, 7, 119, 121
Offset: 1

Views

Author

Wolfdieter Lang, Oct 30 2021

Keywords

Comments

This map is obtained from the array A(k, m) given in A347834. There all positive numbers congruent to 5 modulo 8 (A004770) appear uniquely in the columns for m >= 1, and the m = 0 column gives all numbers congruent to {1, 3, 7} (mod 8) (A047529). The surjective map is f: A004770 -> A047529, with b(n) = A004770(n) -> f(b(n)) = a(n).
See also the array A178415 which has permuted rows.
This maps all entries of each row k of the array A(k, m), given in A347834, with columns m >= 1 to the entry A(k, 0) = A047529(k), for k >= 1. The numbers b(n) appear once in the array A for columns m >= 1. Column A(k, 1) = A347836(k) gives the numbers congruent to {5, 32, 29} (mod 32), and each entry for columns m >= 2 is congruent to 21 (mod 32).
The surjective map of the numbers b(n) = 5 + 8*(n-1) = A004770(n), for n >= 1, to A047529 with element a(n), is computed by switching to the companion array A347839 of A347834, with the simple recurrence, removing all factors of 4, and then going back to array A347834. See the formula below. Thanks to Antti Karttunen for motivating me to simplify the prescription, and to add in A347834 the hint for the induction proof that all 5 (mod 8) numbers appear once in the columns n >= 1.
This map f is of interest in the context of the Collatz 3*n+1 conjecture. The (modified) rooted tree with only odd labeled nodes has for each row k of the array A(k, m) (A347834) the same precursor (or (modified) Collatz map given in A075677(n+1), for 2*n+1). Therefore, all nodes with labels b(n) == 5 (mod 8) can be represented by a(n). This leads to a further restricted Collatz tree with only node labels congruent to {1, 3, 7} (mod 8) (A047529).
An even further restricted Collatz tree has only node labels congruent to 1 (mod 8) (A017077), as any positive integer can be written as m*2^(v+1)+2^v-1 or (m,v) where v is the number of trailing 1-bits in binary, and for v > 1 the next odd Collatz successor of (m,v) is (3*m+1,v-1). - Ruud H.G. van Tol, Sep 13 2023

Examples

			The sequence a(n) begins: (b(n) = A004770(n))
-------------------------------------------------------------------------
n:     1  2  3  4  5  6  7  8  9 10 11 12  13  14  15  16  17  18  19  20
b(n):  5 13 21 29 37 45 53 61 69 77 85 93 101 109 117 125 133 141 149 157
a(n):  1  3  1  7  9 11  3 15 17 19  1 23  25  27   7  31  35  35   9  39
-------------------------------------------------------------------------
n:     21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37 ...
b(n): 165 173 181 189 197 205 213 221 229 237 245 253 261 269 277 285 293 ...
a(n):  41  43  11  47  49  51   3  55  57  59  15  63  65  67  17  71  73 ...
-----------------------------------------------------------------------------
n = 6, b(6) = 45 = 13 + 32*1, case a), a(6) = 3 + 8*1 = 11.
n = 7, b(7) = 53 = 21 + 32*1, case b)1), first instance, L(7) = 0, a(7) = 3 + 8*0 = 3.
n = 31, b(31) = 245 = 117 + 128*1, case b)1), second instance, L(31) = 1, a(31) = 7 + 8*1 = 15.
n = 11, b(11) = 85 = 21 + 64*1, A065883(1 + 3*1) = 1, c(11) = 1, case b)2)i), a(11) = 85 = A347834(1, 3).
n = 19, b(19) = 149 = 21 + 64*2, A065883(1 + 3*2) = 7, c(19) = (7 - 1)/3 = 2, case b)2)ii), a(n) = 4*2 + 1 = 9.
		

Crossrefs

Programs

  • Mathematica
    A347840[n_] := NestWhile[Quotient[#, 4] &, 2*n - 1, Mod[#, 8] == 5 &];
    Array[A347840, 100] (* Paolo Xausa, Jun 25 2025 *)
  • PARI
    a(n) = n=2*n-1; while(5==n%8, n>>=2); n; \\ Ruud H.G. van Tol, Sep 13 2023
    
  • PARI
    a(n) = (2*n-1)>>(valuation(3*n-1,2)\2*2); \\ Ruud H.G. van Tol, Sep 20 2023

Formula

a(n) = (2*A065883((3*b(n)+1)/2) - 1)/3, with b(n) = A004770(n), for n >= 1.
a(n) = A385109(8*(n-1)+5). - Ralf Stephan, Jun 18 2025

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

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

A047484 Numbers that are congruent to {3, 5, 7} mod 8.

Original entry on oeis.org

3, 5, 7, 11, 13, 15, 19, 21, 23, 27, 29, 31, 35, 37, 39, 43, 45, 47, 51, 53, 55, 59, 61, 63, 67, 69, 71, 75, 77, 79, 83, 85, 87, 91, 93, 95, 99, 101, 103, 107, 109, 111, 115, 117, 119, 123, 125, 127, 131, 133, 135, 139, 141, 143, 147, 149, 151, 155, 157, 159
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    I:=[3, 5, 7, 11]; [n le 4 select I[n] else Self(n-1)+Self(n-3) -Self(n-4): n in [1..70]]; // Vincenzo Librandi, May 17 2012
  • Maple
    A047484:=n->(24*n-3-6*cos(2*n*Pi/3)+2*sqrt(3)*sin(2*n*Pi/3))/9: seq(A047484(n), n=1..100); # Wesley Ivan Hurt, Jun 10 2016
  • Mathematica
    Select[Range[0,300], MemberQ[{3,5,7}, Mod[#,8]]&] (* Vincenzo Librandi, May 17 2012 *)

Formula

G.f.: x*(3+2*x+2*x^2+x^3)/((1-x)^2*(1+x+x^2)). [Colin Barker, May 14 2012]
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4. - Vincenzo Librandi, May 17 2012
From Wesley Ivan Hurt, Jun 10 2016: (Start)
a(n) = (24*n-3-6*cos(2*n*Pi/3)+2*sqrt(3)*sin(2*n*Pi/3))/9.
a(3k) = 8k-1, a(3k-1) = 8k-3, a(3k-2) = 8k-5. (End)
a(n) = 3*n - floor((n-1)/3) - ((n-1) mod 3). - Wesley Ivan Hurt, Sep 26 2017
a(n) = 2*(n + floor((n-1)/3)) + 1. - Wolfdieter Lang, Sep 11 2021

A047478 Numbers that are congruent to {1, 5, 7} mod 8.

Original entry on oeis.org

1, 5, 7, 9, 13, 15, 17, 21, 23, 25, 29, 31, 33, 37, 39, 41, 45, 47, 49, 53, 55, 57, 61, 63, 65, 69, 71, 73, 77, 79, 81, 85, 87, 89, 93, 95, 97, 101, 103, 105, 109, 111, 113, 117, 119, 121, 125, 127, 129, 133, 135, 137, 141, 143, 145, 149, 151, 153, 157, 159
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    I:=[1, 5, 7, 9]; [n le 4 select I[n] else Self(n-1)+Self(n-3)-Self(n-4): n in [1..70]]; // Vincenzo Librandi, May 16 2012
  • Maple
    A047478:=n->(24*n-9-4*sqrt(3)*sin(2*n*Pi/3))/9: seq(A047478(n), n=1..100); # Wesley Ivan Hurt, Jun 10 2016
  • Mathematica
    Select[Range[0,300], MemberQ[{1,5,7}, Mod[#,8]]&] (* Vincenzo Librandi, May 16 2012 *)

Formula

G.f.: x*(1+4*x+2*x^2+x^3)/((1-x)^2*(1+x+x^2)). [Colin Barker, May 14 2012]
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4. - Vincenzo Librandi, May 16 2012
From Wesley Ivan Hurt, Jun 10 2016: (Start)
a(n) = (24*n-9-4*sqrt(3)*sin(2*n*Pi/3))/9.
a(3k) = 8k-1, a(3k-1) = 8k-3, a(3k-2) = 8k-7. (End)
a(n) = 2*(n + floor((n+1)/3)) - 1. - Wolfdieter Lang, Sep 11 2021

A047623 Numbers that are congruent to {1, 3, 5} mod 8.

Original entry on oeis.org

1, 3, 5, 9, 11, 13, 17, 19, 21, 25, 27, 29, 33, 35, 37, 41, 43, 45, 49, 51, 53, 57, 59, 61, 65, 67, 69, 73, 75, 77, 81, 83, 85, 89, 91, 93, 97, 99, 101, 105, 107, 109, 113, 115, 117, 121, 123, 125, 129, 131, 133, 137, 139, 141, 145, 147, 149, 153, 155, 157
Offset: 1

Views

Author

Keywords

Comments

Numbers that can be expressed as the sum of at most three square numbers (see Tattersall). - Stefano Spezia, Jul 02 2025

References

  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 17.

Crossrefs

Programs

  • Magma
    I:=[1, 3, 5, 9]; [n le 4 select I[n] else Self(n-1)+Self(n-3)-Self(n-4): n in [1..70]]; // Vincenzo Librandi, Apr 27 2012
  • Maple
    A047623:=n->(24*n-21-6*cos(2*n*Pi/3)+2*sqrt(3)*sin(2*n*Pi/3))/9: seq(A047623(n), n=1..100); # Wesley Ivan Hurt, Jun 10 2016
  • Mathematica
    Select[Range[0,150], MemberQ[{1,3,5}, Mod[#,8]]&] (* Vincenzo Librandi, Apr 27 2012 *)

Formula

a(n) = 2*floor((n-1)/3) + 2*n - 1. - Gary Detlefs, Mar 18 2010
From Colin Barker, Feb 03 2012: (Start)
G.f.: x*(1+2*x+2*x^2+3*x^3)/(1-x-x^3+x^4).
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4. (End)
From Wesley Ivan Hurt, Jun 10 2016: (Start)
a(n) = (24*n-21-6*cos(2*n*Pi/3)+2*sqrt(3)*sin(2*n*Pi/3))/9.
a(3k) = 8k-3, a(3k-1) = 8k-5, a(3k-2) = 8k-7. (End)

A178414 Least odd number in the Collatz (3x+1) preimage of odd numbers not a multiple of 3.

Original entry on oeis.org

1, 3, 9, 7, 17, 11, 25, 15, 33, 19, 41, 23, 49, 27, 57, 31, 65, 35, 73, 39, 81, 43, 89, 47, 97, 51, 105, 55, 113, 59, 121, 63, 129, 67, 137, 71, 145, 75, 153, 79, 161, 83, 169, 87, 177, 91, 185, 95, 193, 99, 201, 103, 209, 107, 217, 111, 225, 115, 233, 119, 241, 123, 249
Offset: 1

Views

Author

T. D. Noe, May 28 2010

Keywords

Comments

The odd non-multiples of 3 are 1, 5, 7, 11,... (A007310). The odd multiples of 3 have no odd numbers their Collatz pre-image. The next odd number in the Collatz iteration of a(2n) is 6n-1. The next odd number in the Collatz iteration of a(2n+1) is 6n+1. For each non-multiple of 3, there are an infinite number of odd numbers in its Collatz pre-image. For example:
Odd pre-images of 1: 1, 5, 21, 85, 341,... (A002450)
Odd pre-images of 5: 3, 13, 53, 213, 853,... (A072197)
Odd pre-images of 7: 9, 37, 149, 597, 2389,...
Odd pre-images of 11: 7, 29, 117, 469, 1877,...(A072261)
In each case, the pre-image sequence is t(k+1) = 4*t(k) + 1 with t(0)=a(n). The array of pre-images is in A178415.
a(n) = A047529(P(n)), with the permutation P(n) = A006368(n-1) + 1, for n >= 1. This shows that this sequence gives the numbers {1, 3, 7} (mod 8) uniquely. - Wolfdieter Lang, Sep 21 2021

Crossrefs

Programs

  • Mathematica
    Riffle[1+8*Range[0,50], 3+4*Range[0,50]]

Formula

a(n) = (n - 1)*(3 - (-1)^n) + 1. [Bogart B. Strauss, Sep 20 2013, adapted to the offset by Matthew House, Feb 14 2017]
From Matthew House, Feb 14 2017: (Start)
G.f.: x*(1 + 3*x + 7*x^2 + x^3)/((1 - x)^2*(1 + x)^2).
a(n) = 2*a(n-2) - a(n-4). (End)
From Philippe Deléham, Nov 06 2023: (Start)
a(2*n) = 4*n-1, a(2*n+1) = 8*n+1.
a(n) = 2*A022998(n-1)+1.
a(n) = 2*A114752(n)-1. (End)

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.

A265228 Interleave the even numbers with the numbers that are congruent to {1, 3, 7} mod 8.

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 6, 9, 8, 11, 10, 15, 12, 17, 14, 19, 16, 23, 18, 25, 20, 27, 22, 31, 24, 33, 26, 35, 28, 39, 30, 41, 32, 43, 34, 47, 36, 49, 38, 51, 40, 55, 42, 57, 44, 59, 46, 63, 48, 65, 50, 67, 52, 71, 54, 73, 56, 75, 58, 79, 60, 81, 62, 83, 64, 87, 66
Offset: 0

Views

Author

Paul Curtz, Dec 06 2015

Keywords

Comments

b(n) denotes the sequence:
0, 0, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, 2, -2, 2, -2, 2, -2, 2, 3, -3, 3, -3, 3, -3, 3, 4, -4, ..., and
c(n) = n + b(n) = n + floor((n+1)/7)*(-1)^((n+1) mod 7) provides:
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, ..., which is a permutation of A001477.
a(n) differs from c(n) because c(n) contains the terms of the form 8*k+5.

Crossrefs

Programs

  • Mathematica
    lim = 11; Riffle[Range[0, 6 lim, 2], Select[Range[8 lim], MemberQ[{1, 3, 7}, Mod[#, 8]] &]] (* Michael De Vlieger, Dec 06 2015 *)
  • PARI
    concat(0, Vec(x*(1+2*x+2*x^2+2*x^3+4*x^4+2*x^5+x^6)/((1-x)^2 *(1+x)^2*(1-x+x^2)*(1+x+x^2)) + O(x^100))) \\ Colin Barker, Dec 06 2015
    
  • PARI
    vector(100, n, n--; n+(1-(-1)^n)*floor(n/6+1/3)) \\ Altug Alkan, Dec 09 2015

Formula

a(n) = n + 2*A260160(n) = n + (1-(-1)^n)*floor(n/6+1/3). Therefore, for odd n, a(n) = A047529((n+1)/2); otherwise, a(n) = n.
a(n) = a(n-6) - (-1)^n + 7.
a(n) = A260708(n) - A260699(n-1) - A079979(n+3), with A260699(-1) = 0.
From Colin Barker, Dec 06 2015: (Start)
a(n) = a(n-2) + a(n-6) - a(n-8) for n > 7.
G.f.: x*(1+2*x+2*x^2+2*x^3+4*x^4+2*x^5+x^6) / ((1-x)^2*(1+x)^2*(1-x+x^2)*(1+x+x^2)). (End)
Showing 1-10 of 11 results. Next