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-3 of 3 results.

A133419 Image of n under one application of the "5x+1" map.

Original entry on oeis.org

6, 1, 1, 2, 26, 3, 36, 4, 3, 5, 56, 6, 66, 7, 5, 8, 86, 9, 96, 10, 7, 11, 116, 12, 126, 13, 9, 14, 146, 15, 156, 16, 11, 17, 176, 18, 186, 19, 13, 20, 206, 21, 216, 22, 15, 23, 236, 24, 246, 25, 17, 26, 266, 27, 276, 28, 19, 29, 296, 30, 306, 31, 21, 32, 326, 33, 336, 34, 23, 35
Offset: 1

Views

Author

N. J. A. Sloane, Nov 27 2007

Keywords

Comments

The 5x+1 map sends x to x/2 if x is even, x/3 if x is odd and divisible by 3, otherwise 5x+1.

Crossrefs

Cf. A133420.

Programs

  • Mathematica
    Table[If[EvenQ[n], n/2, If[Mod[n, 3] == 0, n/3, 5*n + 1]], {n, 1, 80}] (* Stefan Steinerberger, Feb 16 2008 *)
    Table[Which[EvenQ[n],n/2,Divisible[n,3],n/3,True,5n+1],{n,70}] (* Harvey P. Dale, Jul 08 2018 *)
  • PARI
    a(n)=if(n%2,if(n%3,5*n+1,n/3),n/2) \\ Charles R Greathouse IV, Sep 02 2015

Formula

From Chai Wah Wu, Mar 04 2018: (Start)
a(n) = 2*a(n-6) - a(n-12) for n > 12.
G.f.: x*(4*x^10 + x^9 + x^8 + 2*x^7 + 24*x^6 + 3*x^5 + 26*x^4 + 2*x^3 + x^2 + x + 6)/(x^12 - 2*x^6 + 1). (End)

Extensions

More terms from Stefan Steinerberger, Feb 16 2008
Comment clarified by Chai Wah Wu, Mar 04 2018

A350035 Number of steps to reach 1 under repeated applications of the A350034 map, or -1 if 1 is never reached.

Original entry on oeis.org

0, 1, 1, 2, 11, 1, 3, 3, 2, 12, 7, 2, 9, 4, 12, 4, 6, 2, 6, 13, 4, 8, 16, 3, 6, 10, 3, 5, 13, 12, 12, 5, 8, 7, 12, 2, 14, 7, 10, 14, 9, 4, 4, 9, 13, 17, 21, 4, 11, 7, 7, 11, 19, 3, 19, 6, 7, 14, 18, 13, 9, 13, 5, 6, 13, 8, 8, 8, 17, 13, 20, 3, 11, 15, 7, 8, 15, 10, 10, 15, 4, 10, 15, 5, 22, 5
Offset: 1

Views

Author

Keywords

Examples

			5 -> 26 -> 13 -> 66 -> 11 -> 56 -> 28 -> 14 -> 7 -> 36 -> 6 -> 1. Thus a(5) = 11.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=1, 0, 1+
          a((g-> `if`(g>1, n/g, 5*n+1))(igcd(n, 6))))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Jan 19 2022
  • Mathematica
    f[n_]:=If[GCD[n,6]>1,n/GCD[n,6],5*n+1];Table[f[n],{n,0,100}];
    S[n_]:=S[n]=Which[n==1,0,f[n]==1,1,True,1+S[f[n]]];
    Table[S[n],{n,1,86}]
  • PARI
    A350034(n) = my(g = gcd(n, 6)); if (g>1, n/g, 5*n+1);
    a(n)=my(r=0); while(n != 1, n = A350034(n); r+=1); r \\ Winston de Greef, Oct 02 2023

A270968 Reduced 5x+1 function R applied to the odd integers: a(n) = R(2n-1), where R(k) = (5k+1)/2^r, with r as large as possible.

Original entry on oeis.org

3, 1, 13, 9, 23, 7, 33, 19, 43, 3, 53, 29, 63, 17, 73, 39, 83, 11, 93, 49, 103, 27, 113, 59, 123, 1, 133, 69, 143, 37, 153, 79, 163, 21, 173, 89, 183, 47, 193, 99, 203, 13, 213, 109, 223, 57, 233, 119, 243, 31, 253, 129, 263, 67, 273, 139, 283, 9, 293, 149, 303
Offset: 1

Views

Author

Michel Lagneau, Mar 27 2016

Keywords

Comments

The odd-indexed terms a(2i+1) = 10i+3 = A017305(i), i>=0;
a(4i+4) = 10i+9 = A017377(i), i>=0;
a(8i+6) = 10i+7 = A017353(i), i>=0;
a(16i+2) = 10i+1 = A017281(i), i>=0.
Note that a(n) = a(16n-6) = a(6n-2)/3. No multiple of 5 is in this sequence.
a(n) = R(2n-1) < 2n-1 for n = 2, 6, 10, ..., 2+4i,...

Examples

			a(4)=9 because (2*4-1) = 7  -> (5*7+1)/2^2 = 9.
		

Crossrefs

Programs

  • Mathematica
    nextOddK[n_] := Module[{m=5n+1}, While[EvenQ[m], m=m/2]; m]; (* assumes odd n *) Table[nextOddK[n], {n, 1, 200, 2}]
  • PARI
    a(n) = my(m = 2*n-1, c = 5*m+1); c/2^valuation(c, 2); \\ Michel Marcus, Mar 27 2016

Formula

a(n) = A000265(A017341(n-1)). - Michel Marcus, Mar 27 2016
Showing 1-3 of 3 results.