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

A087272 a(n) is the largest prime number in 3x+1 trajectory initiated at n.

Original entry on oeis.org

2, 5, 2, 5, 5, 17, 2, 17, 5, 17, 5, 13, 17, 53, 2, 17, 17, 29, 5, 2, 17, 53, 5, 29, 13, 1619, 17, 29, 53, 1619, 2, 29, 17, 53, 17, 37, 29, 101, 5, 1619, 2, 43, 17, 17, 53, 1619, 5, 37, 29, 29, 13, 53, 1619, 1619, 17, 43, 29, 101, 53, 61, 1619, 1619, 2, 37, 29, 101, 17, 13, 53
Offset: 2

Views

Author

Labos Elemer, Sep 18 2003

Keywords

Crossrefs

Programs

  • Mathematica
    c[x_] := (1-Mod[x, 2])*(x/2)+Mod[x, 2]*(3*x+1); c[1]=1; fpl[x_] := Delete[FixedPointList[c, x], -1] ofp[x_] := Part[fpl[x], Flatten[Position[PrimeQ[fpl[x]], True]]] Table[Max[ofp[w]], {w, 1, 256}]
    Table[Max[Select[NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#>1&],PrimeQ]],{n,2,70}] (* Harvey P. Dale, Feb 27 2023 *)
  • PARI
    a(n) = my (mx=2); while (n>1, if (isprime(n), mx=max(mx,n)); n=if (n%2, 3*n+1, n/2)); mx \\ Rémy Sigrist, Oct 08 2018

Extensions

Offset corrected by Rémy Sigrist, Oct 08 2018

A087221 Number of compositions (ordered partitions) of n into powers of 4.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 4, 5, 7, 10, 14, 19, 26, 36, 50, 69, 96, 133, 184, 254, 352, 488, 676, 935, 1294, 1792, 2482, 3436, 4756, 6584, 9116, 12621, 17473, 24190, 33490, 46365, 64190, 88868, 123034, 170334, 235818, 326478, 451994, 625764, 866338, 1199400, 1660510
Offset: 0

Views

Author

Paul D. Hanna, Aug 27 2003

Keywords

Comments

Series trisections have a common ratio:
sum(k>=0, a(3k+1)*x^k) / sum(k>=0, a(3k)*x^k)
= sum(k>=0, a(3k+2)*x^k) / sum(k>=0, a(3k+1)*x^k)
= sum(k>=0, a(3k+3)*x^k) / sum(k>=0, a(3k+2)*x^k)
= sum(k>=0, x^((4^n-1)/3) ) = (1 + x + x^5 + x^21 + x^85 + x^341 +...).

Examples

			A(x) = A(x^4) + x*A(x^4)^2 + x^2*A(x^4)^3 + x^3*A(x^4)^4 + ...
= 1 +x + x^2 +x^3 +2x^4 +3x^5 +5x^6 +7x^7 + 10x^8 +...
		

Crossrefs

Cf. A078932, A087222, A087232, A087224. Different from A003269.

Programs

  • Maple
    a:= proc(n) option remember;
          `if`(n=0, 1, add(a(n-4^i), i=0..ilog[4](n)))
        end:
    seq(a(n), n=0..50);  # Alois P. Heinz, Jan 11 2014
  • Mathematica
    a[n_] := a[n] = If[n==0, 1, Sum[a[n-4^i], {i, 0, Log[4, n]}]]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Mar 24 2015, after Alois P. Heinz *)
  • PARI
    a(n)=local(A,m); if(n<1,n==0,m=1; A=1+O(x); while(m<=n,m*=4; A=1/(1/subst(A,x,x^4)-x)); polcoeff(A,n))
    
  • PARI
    N=66; x='x+O('x^N);
    Vec( 1/( 1 - sum(k=0, ceil(log(N)/log(4)), x^(4^k)) ) )
    /* Joerg Arndt, Oct 21 2012 */

Formula

G.f.: 1/( 1 - sum(k>=0, x^(4^k) ) ). [Joerg Arndt, Oct 21 2012]
G.f. satisfies A(x) = A(x^4)/(1 - x*A(x^4)), A(0) = 1.
a(n) ~ c * d^n, where d=1.384450093664460722709070772652942206959424183007359023442195..., c=0.526605891697738213614083414993893445498621299371909641096106... - Vaclav Kotesovec, May 01 2014

A087222 G.f. satisfies A(x) = 1 + x*A(x)*f(x)^3, where f(x) = Sum_{k>=0} x^((4^k-1)/3).

Original entry on oeis.org

1, 1, 4, 10, 26, 69, 184, 488, 1294, 3436, 9116, 24190, 64190, 170334, 451994, 1199400, 3182706, 8445556, 22410946, 59469200, 157806184, 418751069, 1111188772, 2948626472, 7824411358, 20762688580, 55095420880, 146200015984
Offset: 0

Views

Author

Paul D. Hanna, Aug 27 2003

Keywords

Examples

			Given f(x) = 1 + x + x^5 + x^21 + x^85 + x^341 + ...
so that f(x)^3 = 1 + 3x + 3x^2 + x^3 + 3x^5 + 6x^6 + 3x^7 + 3x^10 + ...
then A(x) = 1 + x*A(x)*(1 + 3x + 3x^2 + x^3 + 3x^5 + 6x^6 + ...)
= 1 + x + 4x^2 + 10x^3 + 26x^4 + 69x^5 + 184x^6 + ...
		

Crossrefs

Programs

  • Mathematica
    nmax = 30; CoefficientList[Series[1/(1 - Sum[x^((4^k - 1)/3), {k, 0, nmax}]^3*x), {x, 0, nmax}], x] (* Vaclav Kotesovec, Oct 11 2020 *)
  • PARI
    a(n)=local(A,m); if(n<1,n==0,m=1; A=1+O(x); while(m<=3*n+3,m*=4; A=1/(1/subst(A,x,x^4)-x)); polcoeff(A,3*n))

Formula

a(n) = A087221(3n).

A348006 Largest increment in the trajectory from n to 1 in the Collatz map (or 3x+1 problem), or -1 if no such trajectory exists.

Original entry on oeis.org

0, 0, 11, 0, 11, 11, 35, 0, 35, 11, 35, 11, 27, 35, 107, 0, 35, 35, 59, 11, 43, 35, 107, 11, 59, 27, 6155, 35, 59, 107, 6155, 0, 67, 35, 107, 35, 75, 59, 203, 11, 6155, 43, 131, 35, 91, 107, 6155, 11, 99, 59, 155, 27, 107, 6155, 6155, 35, 131, 59, 203, 107
Offset: 1

Views

Author

Paolo Xausa, Oct 02 2021

Keywords

Comments

The largest increment occurs when the trajectory reaches its largest value via a 3x+1 step.
All nonzero terms are odd, since they are of the form 2k+1, for some k >= 5.

Examples

			a(3) = 11 because the trajectory starting at 3 is 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1, and the largest increment (from 5 to 16) is 11.
a(4) = 0 because there are only halving steps in the Collatz trajectory starting at 4.
		

Crossrefs

Programs

  • Mathematica
    nterms=100;Table[c=n;mr=0;While[c>1,If[OddQ[c],mr=Max[mr,2c+1];c=3c+1,c/=2^IntegerExponent[c,2]]];mr,{n,nterms}]
  • PARI
    a(n)=n>>=valuation(n,2); my(r); while(n>1, my(t=2*n+1); n+=t; n>>=valuation(n,2); if(t>r, r=t)); r \\ Charles R Greathouse IV, Oct 25 2022
  • Python
    def A348006(n):
        c, mr = n, 0
        while c > 1:
            if c % 2:
                mr = max(mr, 2*c+1)
                c = 3*c+1
            else:
                c //= 2
        return mr
    print([A348006(n) for n in range(1, 100)])
    

Formula

If n = 2^k (for k >= 0), a(n) = 0; otherwise a(n) = 2*A087232(n)+1 = (2*A025586(n)+1)/3 = A025586(n)-A087232(n).

A225105 Odd numbers n such that the largest odd term in Collatz(3x+1) trajectory of n is prime.

Original entry on oeis.org

3, 5, 7, 9, 11, 13, 15, 17, 19, 23, 25, 29, 35, 37, 39, 53, 59, 61, 67, 75, 79, 87, 89, 99, 101, 105, 113, 115, 119, 131, 149, 153, 157, 173, 179, 181, 187, 197, 211, 219, 229, 241, 247, 249, 255, 267, 269, 277, 281, 307, 317, 329, 349, 371, 373, 383, 397
Offset: 1

Views

Author

Jayanta Basu, Apr 28 2013

Keywords

Examples

			15 is in the list since highest odd number in Collatz trajectory of 15 is 53, a prime.
		

Crossrefs

Programs

  • Haskell
    a225105 n = a225105_list !! (n-1)
    a225105_list = filter
       ((== 1) . a010051' . maximum . filter odd . a070165_row) a005408_list
    -- Reinhard Zumkeller, Apr 30 2013
  • Mathematica
    Coll[n_]:=NestWhileList[If[EvenQ[#],#/2,3*# + 1] &,n, #>1&];t={};Do[If[PrimeQ[Max[Select[Coll[n],OddQ]]],AppendTo[t,n]],{n,1,300,2}];t
Showing 1-5 of 5 results.