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.

Previous Showing 21-30 of 36 results. Next

A028393 Iterate the map in A006368 starting at 8.

Original entry on oeis.org

8, 12, 18, 27, 20, 30, 45, 34, 51, 38, 57, 43, 32, 48, 72, 108, 162, 243, 182, 273, 205, 154, 231, 173, 130, 195, 146, 219, 164, 246, 369, 277, 208, 312, 468, 702, 1053, 790, 1185, 889, 667, 500, 750, 1125, 844, 1266, 1899, 1424, 2136, 3204, 4806, 7209, 5407
Offset: 0

Views

Author

Keywords

Comments

It is conjectured that this trajectory never repeats, but no proof of this has been found. - N. J. A. Sloane, Jul 14 2009

References

  • J. H. Conway, Unpredictable iterations, in Proc. Number Theory Conf., Boulder, CO, 1972, pp. 49-52. - N. J. A. Sloane, Oct 04 2012
  • R. K. Guy, Unsolved Problems in Number Theory, E17. - N. J. A. Sloane, Oct 04 2012
  • J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010; see page 5. [From N. J. A. Sloane, Jan 21 2011]

Crossrefs

Programs

  • Haskell
    a028393 n = a028393_list !! n
    a028393_list = iterate a006368 8  -- Reinhard Zumkeller, Apr 18 2012
    
  • Maple
    F := proc(n) option remember; if n = 0 then 8 elif 3*F(n-1) mod 2 = 0 then 3*F(n-1)/2 else round(3*F(n-1)/4); fi; end; [ seq(F(i),i=0..80) ];
  • Mathematica
    f[n_?EvenQ] := 3*n/2; f[n_] := Round[3*n/4]; a[0] = 8; a[n_] := a[n] = f[a[n - 1]]; Table[a[n], {n, 0, 52}]  (* Jean-François Alcover, Jun 10 2013 *)
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def F(n):
        if n == 0: return 8
        elif 3*F(n-1)%2 == 0: return 3*F(n-1)//2
        else: return (3*F(n-1)+1)//4
    print([F(i) for i in range(81)]) # Michael S. Branicky, Aug 12 2021 after J. H. Conway

Formula

a(n+1) = A006368(a(n)).

A180853 Trajectory of 4 under map n->A006368(n).

Original entry on oeis.org

4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5, 4, 6, 9, 7, 5
Offset: 0

Views

Author

N. J. A. Sloane, Jan 22 2011

Keywords

Comments

The trajectory of 8 is a famous unsolved problem - see A028393.

References

  • D. Gale, Tracking the Automatic Ant and Other Mathematical Explorations, A Collection of Mathematical Entertainments Columns from The Mathematical Intelligencer, Springer, 1998; see p. 16.

Crossrefs

Programs

Formula

Periodic with period of length 5.
G.f.: ( -4-6*x-9*x^2-7*x^3-5*x^4 ) / ( (x-1)*(1+x+x^2+x^3+x^4) ). - R. J. Mathar, Mar 10 2011
a(n+1) = A006368(a(n)).
a(n) = a(n-5). - Wesley Ivan Hurt, Apr 26 2021

A182205 Iterate the map in A006368 starting at 40.

Original entry on oeis.org

40, 60, 90, 135, 101, 76, 114, 171, 128, 192, 288, 432, 648, 972, 1458, 2187, 1640, 2460, 3690, 5535, 4151, 3113, 2335, 1751, 1313, 985, 739, 554, 831, 623, 467, 350, 525, 394, 591, 443, 332, 498, 747, 560, 840, 1260, 1890, 2835, 2126, 3189, 2392, 3588, 5382
Offset: 0

Views

Author

Reinhard Zumkeller, Apr 18 2012

Keywords

Comments

Like for iterations with starting points 8 or 14, it is conjectured that also this trajectory never repeats.

References

  • D. Gale, Tracking the Automatic Ant and Other Mathematical Explorations, A Collection of Mathematical Entertainments Columns from The Mathematical Intelligencer, Springer, 1998; see p. 16.

Crossrefs

Programs

  • Haskell
    a182205 n = a182205_list !! n
    a182205_list = iterate a006368 40
  • Mathematica
    SubstitutionSystem[{n_ :> If[EvenQ[n], 3 n/2, Round[3 n/4]]}, {40}, 60] // Flatten (* Jean-François Alcover, Mar 01 2019 *)

Formula

a(n+1) = A006368(a(n)), with a(0) = 40.

A217218 Trajectory of 44 under the map k -> A006368(k).

Original entry on oeis.org

44, 66, 99, 74, 111, 83, 62, 93, 70, 105, 79, 59, 44, 66, 99, 74, 111, 83, 62, 93, 70, 105, 79, 59, 44, 66, 99, 74, 111, 83, 62, 93, 70, 105, 79, 59, 44, 66, 99, 74, 111, 83, 62, 93, 70, 105, 79, 59, 44, 66, 99, 74, 111, 83, 62, 93, 70, 105, 79, 59, 44, 66, 99, 74, 111, 83, 62, 93, 70, 105, 79, 59, 44, 66, 99, 74, 111, 83, 62, 93, 70, 105, 79, 59, 44, 66, 99, 74, 111, 83, 62, 93, 70, 105, 79, 59
Offset: 1

Views

Author

N. J. A. Sloane, Oct 04 2012

Keywords

Comments

Periodic with period length 12.
It is believed that this is the longest trajectory that cycles (the others are {1}, {2,3}, {4,6,9,7,5}).

References

  • See also references and links in A006368.

Crossrefs

Programs

  • Haskell
    a217218 n = a217218_list !! (n-1)
    a217218_list = iterate a006368 44  -- Reinhard Zumkeller, Apr 06 2013
    
  • Magma
    &cat[ [44,66,99,74,111,83,62,93,70,105,79,59]: n in [0..9] ]; // Vincenzo Librandi, Jun 28 2015
    
  • Mathematica
    t={44}; While[n=t[[-1]]; s=If[EvenQ[n], 3*n/2, Round[3*n/4]]; Length[t]<100&&!MemberQ[t, s], AppendTo[t, s]]; t (* Vincenzo Librandi, Jun 28 2015 *)
    PadRight[{},120,{44,66,99,74,111,83,62,93,70,105,79,59}] (* Harvey P. Dale, Jul 30 2025 *)
  • PARI
    Vec(x*(44 + 66*x + 99*x^2 + 74*x^3 + 111*x^4 + 83*x^5 + 62*x^6 + 93*x^7 + 70*x^8 + 105*x^9 + 79*x^10 + 59*x^11) / ((1 - x)*(1 + x)*(1 - x + x^2)*(1 + x^2)*(1 + x + x^2)*(1 - x^2 + x^4)) + O(x^40)) \\ Colin Barker, Aug 16 2019

Formula

a(n+1) = A006368(a(n)).
From Colin Barker, Aug 16 2019: (Start)
G.f.: x*(44 + 66*x + 99*x^2 + 74*x^3 + 111*x^4 + 83*x^5 + 62*x^6 + 93*x^7 + 70*x^8 + 105*x^9 + 79*x^10 + 59*x^11) / ((1 - x)*(1 + x)*(1 - x + x^2)*(1 + x^2)*(1 + x + x^2)*(1 - x^2 + x^4)).
a(n) = a(n-12) for n>12.
(End)

A223088 Trajectory of 82 under the map n-> A006368(n).

Original entry on oeis.org

82, 123, 92, 138, 207, 155, 116, 174, 261, 196, 294, 441, 331, 248, 372, 558, 837, 628, 942, 1413, 1060, 1590, 2385, 1789, 1342, 2013, 1510, 2265, 1699, 1274, 1911, 1433, 1075, 806, 1209, 907, 680, 1020, 1530, 2295, 1721, 1291, 968, 1452, 2178, 3267, 2450, 3675
Offset: 1

Views

Author

N. J. A. Sloane, Mar 22 2013

Keywords

Comments

It is conjectured that this trajectory does not close on itself.

Crossrefs

Programs

  • 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;
    t1:=[82];
    for n from 1 to 100 do t1:=[op(t1),f(t1[nops(t1)])]; od:
    t1;
  • Mathematica
    t = {82}; While[n = t[[-1]]; s = If[EvenQ[n], 3*n/2, Round[3*n/4]]; Length[t] < 100 && ! MemberQ[t, s], AppendTo[t, s]]; t (* T. D. Noe, Mar 22 2013 *)
    SubstitutionSystem[{n_ :> If[EvenQ[n], 3n/2, Round[3n/4]]}, {82}, 100] // Flatten (* Jean-François Alcover, Mar 01 2019 *)

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

Original entry on oeis.org

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

Views

Author

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

Keywords

Comments

The inverse permutation is given by P(n) = A006368(n-1) + 1, for n >= 1, and P(0) = 0. - Wolfdieter Lang, Sep 21 2021
This permutation is given by A006369(n-1) + 1, with A006369(-1) = -1. Observed by Kevin Ryde. - Wolfdieter Lang, Sep 22 2021

Examples

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

Crossrefs

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

Programs

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

Formula

G.f.: x*(1 + 2*x + 4*x^2 + x^3 + 2*x^4) / ((1 - x)^2*(1 + x + x^2)^2).
a(n) = 2*a(n-3) - a(n-6).
a(3*k) = 4*k;
a(3*k+1) = 2*k+1, hence a(3*k+1) = a(3*k)/2 + 1;
a(3*k+2) = 4*k+2, hence a(3*k+2) = 2*a(3*k+1) = a(3*k) + 2.
Sum_{i=0..n} a(i) = A008738(A032793(n+1)).
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/8 + log(2)/4. - Amiram Eldar, Mar 30 2023

A168221 a(n) = A006368(A006368(n)).

Original entry on oeis.org

0, 1, 2, 3, 9, 6, 7, 4, 18, 5, 11, 12, 27, 15, 16, 8, 36, 10, 20, 21, 45, 24, 25, 13, 54, 14, 29, 30, 63, 33, 34, 17, 72, 19, 38, 39, 81, 42, 43, 22, 90, 23, 47, 48, 99, 51, 52, 26, 108, 28, 56, 57, 117, 60, 61, 31, 126, 32, 65, 66, 135, 69, 70, 35, 144, 37, 74, 75, 153, 78, 79, 40
Offset: 0

Views

Author

Reinhard Zumkeller, Nov 20 2009

Keywords

Comments

Inverse integer permutation to A168222;
a(A006369(n)) = A006368(n).

Crossrefs

Programs

  • Mathematica
    Table[Nest[If[OddQ[#],Floor[(3#+2)/4],3#/2]&,n,2],{n,0,100}] (* Paolo Xausa, Dec 15 2023 *)
    LinearRecurrence[{0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,-1},{0,1,2,3,9,6,7,4,18,5,11,12,27,15,16,8,36,10,20,21,45,24,25,13},80] (* Harvey P. Dale, Feb 07 2024 *)
  • Python
    def A006368(n):
        if n%2 == 0:
            return 3*(n//2)
        elif n%4 == 1:
            return 3*(n//4)+1
        else:
            return 3*(n+1)//4-1
    n = 0
    while n < 30:
        print(n,A006368(A006368(n)))
        n = n+1 # A.H.M. Smeets, Aug 14 2019

Formula

From Luce ETIENNE, Aug 14 2019: (Start)
a(n) = 2*a(n-16) - a(n-32).
a(n) = (-18*(40*m^7 - 973*m^6 + 9352*m^5 - 45115*m^4 + 114520*m^3 - 145432*m^2 + 75168*m - 10080)*floor(n/8) - m*(332*m^6 - 7973*m^5 + 75236*m^4 - 352835*m^3 + 855008*m^2 - 999992*m + 422664) + m*(4*m^6 - 105*m^5 + 1120*m^4 - 6195*m^3 + 18676*m^2 - 28980*m + 18000)*(-1)^(n/8))/10080 where m = n mod 8.
(End)
From A.H.M. Smeets, Aug 14 2019: (Start)
a(4*n) = 9*n.
a(8*n+1) = a(8*n-1)+1, n > 0.
a(8*n+3) = a(8*n+2)+1.
a(8*n+5) = a(8*n+3)+3 = a(8*n+2)+4.
a(8*n+6) = a(8*n+5)+1 = a(8*n+3)+4 = a(8*n+2)+5.
a(16*n+1) = 9*n+1.
a(16*n+2) = 18*n+2.
a(16*n+3) = a(16*n+2)+1 = 18*n+3.
a(16*n+5) = a(16*n+3)+3 = 18*n+6.
a(16*n+6) = a(16*n+5)+1 = 18*n+7.
a(16*n+7) = (a(16*n+6)+1)/2 = 9*n+4.
a(16*n+9) = 9*n+5.
a(16*n+10) = 2*a(16*n+9)+1 = 18*n+11.
a(16*n+11) = a(16*n+10)+1 = 18*n+12.
a(16*n+13) = a(16*n+11)+3 = 18*n+15.
a(16*n+14) = a(16*n+13) = 18*n+16.
a(16*n+15) = a(16*n+14)/2 = 9*n+8.
From this, (9*n-7)/16 <= a(n) <= 9*n/4.
(End)
From Colin Barker, Aug 23 2019: (Start)
G.f.: x*(1 - x + x^2)*(1 + 3*x + 5*x^2 + 11*x^3 + 12*x^4 + 8*x^5 + 10*x^7 + 14*x^8 + 13*x^9 + 8*x^10 + 13*x^11 + 14*x^12 + 10*x^13 + 8*x^15 + 12*x^16 + 11*x^17 + 5*x^18 + 3*x^19 + x^20) / ((1 - x)^2*(1 + x)^2*(1 + x^2)^2*(1 + x^4)^2*(1 + x^8)).
a(n) = a(n-8) + a(n-16) - a(n-24) for n>23.
(End)

A349378 a(n) = A349376(n) + A349377(n).

Original entry on oeis.org

2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -6, 0, 0, 0, 10, 9, 0, 0, -8, 0, -30, 0, -4, 0, 0, 24, 27, 0, 0, 0, 34, 0, -40, 0, -14, -6, 0, 0, -34, 16, -66, 0, -14, 0, 10, 42, 44, 0, 0, 0, 166, 0, 0, -8, 11, 42, -70, 0, -20, 0, -172, 0, -70, 0, 0, -42, -22, 56, -70, 0, -103, 1, 0, 0, 216, 60, 0, 0, 78
Offset: 1

Views

Author

Antti Karttunen, Nov 17 2021

Keywords

Crossrefs

Programs

Formula

a(1) = 2, and for n >1, a(n) = -Sum_{d|n, 1A349376(d) * A349377(n/d). [As the sequences are Dirichlet inverses of each other]

A134625 Sum-fill array starting with (1,2,3,4,...).

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Nov 04 2007

Keywords

Comments

Every row is a permutation of the positive integers. (Row 2) = A006369. The sequence represents the para-sequence in which the "final ordering" << is given by 1 << ... << 4 << 3 << 2. In every row after row n, for each k<=n, k+1 precedes k and all the numbers between k+1 and k exceed k+1.

Examples

			Starting with x = row 1, Step 1 gives
y = (1,3,2,5,3,7,4,9,5,11,6,13,...).
Delete the second 3,5,7,... leaving row 2:
(1,3,2,5,7,4,9,11,6,13,...).
Northwest corner:
1 2 3 4 5 6 7 8
1 3 2 5 7 4 9 11
1 4 3 5 2 7 12 11
1 5 4 7 3 8 2 9
1 6 5 9 4 11 7 10.
		

References

  • C. Kimberling, Proper self-containing sequences, fractal sequences and para-sequences, preprint, 2007.

Crossrefs

Formula

Row 1 is the sequence of positive integers. Row n>=2 is produced from row n by the sum-fill operation, defined on an arbitrary infinite or finite sequence x = (x(1), x(2), x(3), ...) by the following two steps: Step 1. Form the sequence x(1), x(1)+x(2), x(2), x(2)+x(3), x(3), x(3)+x(4), ...; i.e., fill the space between x(n) and x(n+1) by their sum. Step 2. Delete duplicates; i.e. letting y be the sequence resulting from Step 1, if y(n+h)=y(n) for some h>=1, then delete y(n+h).

A223086 Trajectory of 64 under the map n-> A006368(n).

Original entry on oeis.org

64, 96, 144, 216, 324, 486, 729, 547, 410, 615, 461, 346, 519, 389, 292, 438, 657, 493, 370, 555, 416, 624, 936, 1404, 2106, 3159, 2369, 1777, 1333, 1000, 1500, 2250, 3375, 2531, 1898, 2847, 2135, 1601, 1201, 901, 676, 1014, 1521, 1141, 856, 1284, 1926, 2889
Offset: 1

Views

Author

N. J. A. Sloane, Mar 22 2013

Keywords

Comments

It is conjectured that this trajectory does not close on itself.

Crossrefs

Programs

  • 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;
    t1:=[64];
    for n from 1 to 100 do t1:=[op(t1),f(t1[nops(t1)])]; od:
    t1;
  • Mathematica
    t = {64}; While[n = t[[-1]]; s = If[EvenQ[n], 3 n/2, Round[3 n/4]]; Length[t] < 100 && ! MemberQ[t, s], AppendTo[t, s]]; t (* T. D. Noe, Mar 22 2013 *)
    SubstitutionSystem[{n_ :> If[EvenQ[n], 3n/2, Round[3n/4]]}, {64}, 100] // Flatten (* Jean-François Alcover, Mar 01 2019 *)
Previous Showing 21-30 of 36 results. Next